mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
Recommend to use ynh_add_config
This commit is contained in:
parent
2874e9a6f7
commit
769aa810fc
1 changed files with 11 additions and 1 deletions
|
@ -1446,6 +1446,16 @@ class Script(TestSuite):
|
||||||
if self.contains("--others_var"):
|
if self.contains("--others_var"):
|
||||||
yield Info("Option --others_var is deprecated / irrelevant since 4.2, Yunohost now manages conf using ynh_add_config which automatically replace all __FOOBAR__ by $foobar")
|
yield Info("Option --others_var is deprecated / irrelevant since 4.2, Yunohost now manages conf using ynh_add_config which automatically replace all __FOOBAR__ by $foobar")
|
||||||
|
|
||||||
|
@test(only=["install", "upgrade"])
|
||||||
|
def deprecated_replace_string(self):
|
||||||
|
cmd1 = "grep -Ec 'ynh_replace_string' '%s'" % self.path
|
||||||
|
cmd2 = "grep -Ec 'ynh_replace_string.*__\w+__' '%s'" % self.path
|
||||||
|
|
||||||
|
count1 = int(subprocess.check_output(cmd1, shell=True).decode('utf-8').strip())
|
||||||
|
count2 = int(subprocess.check_output(cmd2, shell=True).decode('utf-8').strip())
|
||||||
|
|
||||||
|
if count2 > 0 or count1 >= 5:
|
||||||
|
yield Info("Please consider using 'ynh_add_config' to handle config files instead of gazillions of manual cp + 'ynh_replace_string' + chmod")
|
||||||
|
|
||||||
@test()
|
@test()
|
||||||
def set_is_public_setting(self):
|
def set_is_public_setting(self):
|
||||||
|
@ -1558,7 +1568,7 @@ class Script(TestSuite):
|
||||||
@test()
|
@test()
|
||||||
def sed(self):
|
def sed(self):
|
||||||
if self.containsregex(r"sed\s+(-i|--in-place)\s+(-r\s+)?s") or self.containsregex(r"sed\s+s\S*\s+(-i|--in-place)"):
|
if self.containsregex(r"sed\s+(-i|--in-place)\s+(-r\s+)?s") or self.containsregex(r"sed\s+s\S*\s+(-i|--in-place)"):
|
||||||
yield Info("You should avoid using 'sed -i' for substitutions, please use 'ynh_replace_string' instead")
|
yield Info("You should avoid using 'sed -i' for substitutions, please use 'ynh_add_config' instead")
|
||||||
|
|
||||||
@test()
|
@test()
|
||||||
def sudo(self):
|
def sudo(self):
|
||||||
|
|
Loading…
Reference in a new issue