X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=daklib%2Fchecks.py;h=664bca3e1c966a28d3ea2c7fd3b0708ff8b794ac;hb=12d561ac9f920dd7648e76ed928af4efd82e4e15;hp=3a6c78244224cbfab2696d386a6bb4f01a7723fc;hpb=25b7ccdf77eb39d59c48cf9b37ab32222a818522;p=dak.git diff --git a/daklib/checks.py b/daklib/checks.py index 3a6c7824..664bca3e 100644 --- a/daklib/checks.py +++ b/daklib/checks.py @@ -638,11 +638,14 @@ class LintianCheck(Check): changespath = os.path.join(upload.directory, changes.filename) try: - if cnf.unprivgroup: - cmd = "sudo -H -u {0} -- /usr/bin/lintian --show-overrides --tags-from-file {1} {2}".format(cnf.unprivgroup, temp_filename, changespath) - else: - cmd = "/usr/bin/lintian --show-overrides --tags-from-file {0} {1}".format(temp_filename, changespath) - result, output = commands.getstatusoutput(cmd) + cmd = [] + + user = cnf.get('Dinstall::UnprivUser') or None + if user is not None: + cmd.extend(['sudo', '-H', '-u', user]) + + cmd.extend(['/usr/bin/lintian', '--show-overrides', '--tags-from-file', temp_filename, changespath]) + result, output = commands.getstatusoutput(" ".join(cmd)) finally: os.unlink(temp_filename)