From c1f328894ee76c2ae3e0397e3e3ab138bf733bb5 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 19 Apr 2019 17:42:40 +0200 Subject: [PATCH 1/2] Improve detection of apps messing with sources.list --- package_linter.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/package_linter.py b/package_linter.py index 0dbd921..e34cdbf 100755 --- a/package_linter.py +++ b/package_linter.py @@ -439,6 +439,7 @@ class Script(): def __init__(self, app_path, name): self.name = name + self.app_path = app_path self.path = app_path + "/scripts/" + name self.exists = file_exists(self.path) if not self.exists: @@ -602,12 +603,15 @@ class Script(): "You can use 'ynh_print_info' or 'ynh_script_progression' for this." ) - if self.name == "install" and self.contains("/etc/apt/sources.list"): - print_warning( - "[YEP-3.7] Adding custom apt repositories (or messing with apt's " - "sources.lists) is discouraged and should be avoided. " - "Please consider alternatives like downloading a .deb if possible." - ) + if self.name == "install": + if self.contains("/etc/apt/sources.list") \ + or (os.path.exists(self.app_path + "/scripts/_common.sh") and "/etc/apt/sources.list" in open(self.app_path+"/scripts/_common.sh").read()): + print_warning( + "[YEP-3.7] Manually messing with apt's sources.lists is strongly discouraged " + "and should be avoided. Please consider alternatives like using a .deb directly " + "or using experimental helpers (c.f. " + "https://github.com/YunoHost-Apps/Experimental_helpers/tree/master/ynh_add_secure_repos )" + ) def check_source_common(self): From 729e95fec2558d582987b3a947136b3ca91dc91b Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 19 Apr 2019 17:58:12 +0200 Subject: [PATCH 2/2] Report usage of extra repo / messing up with sources.list as error --- package_linter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_linter.py b/package_linter.py index e34cdbf..1cd989f 100755 --- a/package_linter.py +++ b/package_linter.py @@ -606,7 +606,7 @@ class Script(): if self.name == "install": if self.contains("/etc/apt/sources.list") \ or (os.path.exists(self.app_path + "/scripts/_common.sh") and "/etc/apt/sources.list" in open(self.app_path+"/scripts/_common.sh").read()): - print_warning( + print_error( "[YEP-3.7] Manually messing with apt's sources.lists is strongly discouraged " "and should be avoided. Please consider alternatives like using a .deb directly " "or using experimental helpers (c.f. "