backup: Try to fix again the infamous issue where from_yunohost_version gets filled with 'BASH_XTRACEFD'

This commit is contained in:
Alexandre Aubin 2022-09-30 16:20:21 +02:00
parent b7bea608f6
commit 14fb1cfd8d

View file

@ -40,7 +40,7 @@ def get_ynh_package_version(package):
# may handle changelog differently !
changelog = "/usr/share/doc/%s/changelog.gz" % package
cmd = "gzip -cd %s 2>/dev/null | head -n1" % changelog
cmd = "gzip -cd %s 2>/dev/null | grep -v 'BASH_XTRACEFD' | head -n1" % changelog
if not os.path.exists(changelog):
return {"version": "?", "repo": "?"}
out = check_output(cmd).split()