From 6b15f169029df70c256c06cc7e9a403b2feefca7 Mon Sep 17 00:00:00 2001 From: Moul Date: Thu, 9 Feb 2017 17:59:47 +0100 Subject: [PATCH] =?UTF-8?q?[fix]=20close=20#19:=C2=A0crash=20if=20'sources?= =?UTF-8?q?'=20folder=20do=20not=20exists.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package_linter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package_linter.py b/package_linter.py index eafe6c7..265d65f 100755 --- a/package_linter.py +++ b/package_linter.py @@ -69,7 +69,8 @@ def check_source_management(app_path): print (c.BOLD + c.HEADER + "\n>>>> SOURCES MANAGEMENT <<<<" + c.END) 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: + if os.path.exists(os.path.join(app_path, "sources")) and \ + 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")