From 5f075c6c6cd9c65417c4622754e4f9f697da747c Mon Sep 17 00:00:00 2001 From: Moul Date: Tue, 7 Feb 2017 19:33:21 +0100 Subject: [PATCH] [enh] sources management check: check if there is more than 5 files on 'sources' folder to say if using local stored sources. --- package_linter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package_linter.py b/package_linter.py index b550f27..eafe6c7 100755 --- a/package_linter.py +++ b/package_linter.py @@ -67,7 +67,9 @@ def read_file(file_path): def check_source_management(app_path): print (c.BOLD + c.HEADER + "\n>>>> SOURCES MANAGEMENT <<<<" + c.END) - if os.path.exists(os.path.join(app_path, "sources")): + DIR = os.path.join(app_path, "sources") + # Check if there is more than six files on 'sources' folder + if len([name for name in os.listdir(DIR) if os.path.isfile(os.path.join(DIR, name))]) > 5: print_wrong("Upstream app sources shouldn't be stored on this 'sources' folder of this git repository as a copy/paste.\n" + "At installation, the package should download sources from upstream via 'wget', git submodule or git subtree.\n" + "See https://dev.yunohost.org/issues/201#Conclusion-chart")