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 <dput-ng@packages.debian.org>; Source for dput-ng is src:dput-ng (PTS, buildd, popcon).

Reported by: Louis-Philippe Véronneau <pollo@debian.org>

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

Severity: normal

Found in version dput-ng/1.32

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, dput-ng Maintainers <dput-ng@packages.debian.org>:
Bug#983160; Package dput-ng. (Sat, 20 Feb 2021 07:18:04 GMT) (full text, mbox, link).


Acknowledgement sent to Louis-Philippe Véronneau <pollo@debian.org>:
New Bug report received and forwarded. Copy sent to dput-ng Maintainers <dput-ng@packages.debian.org>. (Sat, 20 Feb 2021 07:18:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Louis-Philippe Véronneau <pollo@debian.org>
To: submit@bugs.debian.org
Subject: dput-ng: --override doesn't override profile parameters
Date: Sat, 20 Feb 2021 02:13:51 -0500
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
  ⢿⡄⠘⠷⠚⠋   pollo@debian.org / veronneau.org
  ⠈⠳⣄



Information forwarded to debian-bugs-dist@lists.debian.org, dput-ng Maintainers <dput-ng@packages.debian.org>:
Bug#983160; Package dput-ng. (Tue, 14 Sep 2021 09:27:03 GMT) (full text, mbox, link).


Acknowledgement sent to Paride Legovini <paride@debian.org>:
Extra info received and forwarded to list. Copy sent to dput-ng Maintainers <dput-ng@packages.debian.org>. (Tue, 14 Sep 2021 09:27:03 GMT) (full text, mbox, link).


Message #10 received at 983160@bugs.debian.org (full text, mbox, reply):

From: Paride Legovini <paride@debian.org>
To: 983160@bugs.debian.org
Cc: pollo@debian.org, arno@debian.org
Subject: Re: dput-ng: --override doesn't override profile parameters
Date: Tue, 14 Sep 2021 11:22:52 +0200
On Sat, 20 Feb 2021 <pollo@debian.org> wrote:
> Package: dput-ng
> Version: 1.32
> 
> It seems the `--override` option in dput-ng doesn't really override
> parameters in profiles.

Hi, this is just to confirm this issue. I had a look at the dput-ng 
commit history and I'm failing to see how this was supposed to work even 
when --override was first implemented [1].

[1] 
https://salsa.debian.org/debian/dput-ng/-/commit/a283c444ec73780962c3a1e783d5b957999b1f96



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Jun 19 16:19:17 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU 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.