openSUSE / zypper

World's most powerful command line package manager
http://en.opensuse.org/Portal:Zypper
Other
405 stars 110 forks source link

Incorrect XML output with GPG options #390

Closed PrimaryCanary closed 3 years ago

PrimaryCanary commented 3 years ago

Zypper (version 1.14.43) seems to output incorrect XML when a repo with any GPG option is printed using the --xmlout option.

Steps to reproduce:

  1. Start by adding any repo with a GPG option: sudo zypper addrepo --gpgcheck-allow-unsigned https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/ packman

  2. Verify its correctness:

    
    $ zypper repos
    #  | Alias                     | Name                               | Enabled | GPG Check | Refresh
    ---+---------------------------+------------------------------------+---------+-----------+--------
    1 | packman                   | packman                            | Yes     | ( p) Yes  | No
    <more below>

$ cat /etc/zypp/repos.d/packman.repo [packman] enabled=1 autorefresh=0 baseurl=https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/ gpgcheck=1 repo_gpgcheck=0 pkg_gpgcheck=0

3. Verify its XML:

$ zypper --xmlout repos <?xml version='1.0'?>

https://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Tumbleweed/ ``` Note that the XML GPG options are all one. This has been reproduced by others as well. See https://github.com/ansible-collections/community.general/issues/2519#issuecomment-843621797 and beyond.
mlandres commented 3 years ago

Well, zypper --xmlout repos prints the effective settings. They are computed from the (optional) values in the .repo file and the global settings (or builtin defaults). I dare not changing the semantic of the attributes, but I can add (optional) raw_*gpgcheck attributes showing the values as they occur in the .repo file.

mlandres commented 3 years ago

Will be available with libzpp-17.27.0 (Will go as online update to all Code15 distributions and TW)