mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
Merge pull request #70 from YunoHost/improve-sources-list-detection
Improve sources list detection + report messing with sources.list as an error (if not using the helpers)
This commit is contained in:
commit
209e1367c7
1 changed files with 10 additions and 6 deletions
|
@ -444,6 +444,7 @@ class Script():
|
||||||
|
|
||||||
def __init__(self, app_path, name):
|
def __init__(self, app_path, name):
|
||||||
self.name = name
|
self.name = name
|
||||||
|
self.app_path = app_path
|
||||||
self.path = app_path + "/scripts/" + name
|
self.path = app_path + "/scripts/" + name
|
||||||
self.exists = file_exists(self.path)
|
self.exists = file_exists(self.path)
|
||||||
if not self.exists:
|
if not self.exists:
|
||||||
|
@ -609,12 +610,15 @@ class Script():
|
||||||
"You can use 'ynh_print_info' or 'ynh_script_progression' for this."
|
"You can use 'ynh_print_info' or 'ynh_script_progression' for this."
|
||||||
)
|
)
|
||||||
|
|
||||||
if self.name == "install" and self.contains("/etc/apt/sources.list"):
|
if self.name == "install":
|
||||||
print_warning(
|
if self.contains("/etc/apt/sources.list") \
|
||||||
"[YEP-3.7] Adding custom apt repositories (or messing with apt's "
|
or (os.path.exists(self.app_path + "/scripts/_common.sh") and "/etc/apt/sources.list" in open(self.app_path+"/scripts/_common.sh").read()):
|
||||||
"sources.lists) is discouraged and should be avoided. "
|
print_error(
|
||||||
"Please consider alternatives like downloading a .deb if possible."
|
"[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):
|
def check_source_common(self):
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue