Debian Bug report logs - #983160
dput-ng: --override doesn't override profile parameters

version graph

Package: dput-ng; Maintainer for dput-ng is dput-ng Maintainers <[email protected]>; Source for dput-ng is src:dput-ng (PTS, buildd, popcon).

Reported by: Louis-Philippe Véronneau <[email protected]>

Date: Sat, 20 Feb 2021 07:18:02 UTC

Severity: normal

Tags: patch

Found in version dput-ng/1.32

Fixed in version dput-ng/1.43

Done: Colin Watson <[email protected]>

Full log


🔗 View this message in rfc822 format

X-Loop: [email protected]
Subject: Bug#983160: dput-ng: --override doesn't override profile parameters
Reply-To: Louis-Philippe Véronneau <[email protected]>, [email protected]
Resent-From: Louis-Philippe Véronneau <[email protected]>
Resent-To: [email protected]
Resent-CC: dput-ng Maintainers <[email protected]>
X-Loop: [email protected]
Resent-Date: Sat, 20 Feb 2021 07:18:02 +0000
Resent-Message-ID: <[email protected]>
Resent-Sender: [email protected]
X-Debian-PR-Message: report 983160
X-Debian-PR-Package: dput-ng
X-Debian-PR-Keywords: 
X-Debian-PR-Source: dput-ng
Received: via spool by [email protected] id=B.161380524128552
          (code B); Sat, 20 Feb 2021 07:18:02 +0000
Received: (at submit) by bugs.debian.org; 20 Feb 2021 07:14:01 +0000
X-Spam-Checker-Version: SpamAssassin 3.4.2-bugs.debian.org_2005_01_02
	(2018-09-13) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-20.9 required=4.0 tests=BAYES_00,FOURLA,
	FROMDEVELOPER,HAS_PACKAGE,MURPHY_DRUGS_REL8,RCVD_IN_DNSWL_LOW,
	RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE,TXREP
	autolearn=ham autolearn_force=no
	version=3.4.2-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 53; hammy, 150; neutral, 165; spammy,
	0. spammytokens: hammytokens:0.000-+--python3,
	0.000-+--H*RU:198.252.153.129,
	0.000-+--Hx-spam-relays-external:mx1.riseup.net,
	0.000-+--Hx-spam-relays-external:198.252.153.129, 0.000-+--H*r:Domain
Received: from mx1.riseup.net ([198.252.153.129]:56322)
	by buxtehude.debian.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <[email protected]>)
	id 1lDMSn-0007Pr-J7
	for [email protected]; Sat, 20 Feb 2021 07:14:01 +0000
Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84])
	(using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified))
	by mx1.riseup.net (Postfix) with ESMTPS id 4DjKS21h5VzFpPt
	for <[email protected]>; Fri, 19 Feb 2021 23:13:54 -0800 (PST)
X-Riseup-User-ID: 3F88892EDE2DF33A5704FE1E54D2537F68CD8AF9255A02AEB40DA0A97A6A1B10
Received: from [127.0.0.1] (localhost [127.0.0.1])
	 by fews2.riseup.net (Postfix) with ESMTPSA id 4DjKS173vMz1y6g
	for <[email protected]>; Fri, 19 Feb 2021 23:13:52 -0800 (PST)
From: Louis-Philippe Véronneau <[email protected]>
To: [email protected]
Message-ID: <[email protected]>
Date: Sat, 20 Feb 2021 02:13:51 -0500
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: 8bit
Delivered-To: [email protected]
Package: dput-ng
Version: 1.32

Dear maintainers,

It seems the `--override` option in dput-ng doesn't really override
parameters in profiles.

I've added the `check-debs` hook to my test profile and added the
following default values:

    "check-debs": {
        "enforce": "source",
        "skip": false
    },

To debug this issue, I also made `dput/uploader.py` print the values of
`args.override` and `profile` right before `run_pre_hooks(changes,
profile)` is ran:

foo@bar:/usr/lib/python3/dist-packages/dput# diff -C 3 uploader.py
new_uploader.py
*** uploader.py	2021-02-20 02:09:11.222489435 -0500
--- new_uploader.py	2021-02-20 02:09:05.314403878 -0500
***************
*** 310,315 ****
--- 310,317 ----

      if changes.get_changes_file().endswith(".changes"):
          if 'hooks' in profile:
+             print("Printing overrides:\n", args.override) ## NEW
+             print("Printing profile:\n", profile)  ## NEW
              run_pre_hooks(changes, profile)
          else:
              logger.trace(profile)

Here's the result:

foo@bar:$ dput --override "check-debs.enforce=debs" --override
"check-debs.skip=true" test foo_1.0.0-1_amd64.changes

Uploading foo using ftp to test (host: test.org; directory:
/pub/UploadQueue/)
Printing overrides:
 {'check-debs': {'enforce': [['debs']], 'skip': [['true']]}}
Printing profile:
 {'name': 'test', 'allow_dcut': True, 'allow_unsigned_uploads': False,
'allowed_distributions': '(?!UNRELEASED)', 'default_host_main': 'test',
'full_upload_log': False, 'hash': 'md5', 'interface': 'cli', 'login':
'anonymous', 'meta': 'debian', 'method': 'ftp', 'passive_ftp': True,
'post_upload_command': '', 'pre_upload_command': '', 'run_lintian':
False, 'scp_compress': False, 'allowed-distribution':
{'codename-groups': ['general', 'backport', 'rm-managed']}, 'codenames':
'debian', 'hooks': ['allowed-distribution', 'protected-distribution',
'check-debs', 'checksum', 'suite-mismatch', 'gpg'], 'run_dinstall':
False, 'check_version': False, 'fqdn': 'test.org', 'incoming':
'/pub/UploadQueue/', 'check-debs': {'enforce': 'source', 'skip': False},
'valid_commands': ['break-the-archive', 'cancel', 'dm', 'reschedule',
'rm', 'upload']}
running allowed-distribution: check whether a local profile permits
uploads to the target distribution
running protected-distribution: warn before uploading to distributions
where a special policy applies
running check-debs: makes sure the upload contains a binary package
There are .debs in this upload, and enforcing they don't exist.

As you can see, the proper overrides are passed to `args.override`, but
they don't seem to be merged with the `profile` variable, which is the
one passed to the `run_pre_hooks(changes, profile)` command.

This makes it impossible to actually override any profile variables :(

I've put this in on my TODO list, but I'm not sure I'll have time to
send a patch anytime soon.

If someone else wants to have a go at this bug, please be my guest :)

-- 
  ⢀⣴⠾⠻⢶⣦⠀
  ⣾⠁⢠⠒⠀⣿⡁  Louis-Philippe Véronneau
  ⢿⡄⠘⠷⠚⠋   [email protected] / veronneau.org
  ⠈⠳⣄

Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 17:42:58 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.