Hi Josh,
While I agree that PUP-1061 would fix the issue, I'm not sure I would call it a duplicate, as this issue is not reproducible on my Debian system. Observe:
wouter@gangtai:~/pup-5539$ apt-cache show 'pup-5539-*' Package: pup-5539-2 Status: install ok installed Priority: optional Section: misc Installed-Size: 9 Maintainer: Wouter Verhelst <wou...@debian.org> Architecture: all Multi-Arch: foreign Version: 1.0 Depends: pup-5539-1 Description: Demo for
PUP-5539
- 2 This package demonstrates circular dependencies in the context of
PUP-5539
Description-md5: e16ff26ca636fb3ca372318d2193d8d7
Package: pup-5539-1 Status: install ok installed Priority: optional Section: misc Installed-Size: 9 Maintainer: Wouter Verhelst <wou...@debian.org> Architecture: all Multi-Arch: foreign Version: 1.0 Depends: pup-5539-2 Description: Demo for
PUP-5539
- 1 This package demonstrates circular dependencies in the context of
PUP-5539
Description-md5: a471646946df2c687ad3933e9611e645
wouter@gangtai:~/pup-5539$ cat remove.pp $packages = [ "pup-5539-1", "pup-5539-2" ] package { $packages: ensure => absent, }
wouter@gangtai:~/pup-5539$ sudo puppet apply --test remove.pp Password: Notice: Compiled catalog for gangtai.grep.be in environment production in 0.26 seconds Info: Applying configuration version '1448308191' Notice: /Stage[main]/Main/Package[pup-5539-2]/ensure: removed Error: Execution of '/usr/bin/apt-get -y -q remove pup-5539-1' returned 100: Reading package lists... Building dependency tree... Reading state information... E: Unable to locate package pup-5539-1 Error: /Stage[main]/Main/Package[pup-5539-1]/ensure: change from 1.0 to absent failed: Execution of '/usr/bin/apt-get -y -q remove pup-5539-1' returned 100: Reading package lists... Building dependency tree... Reading state information... E: Unable to locate package pup-5539-1 Info: Creating state file /var/lib/puppet/state/state.yaml Notice: Finished catalog run in 2.69 seconds wouter@gangtai:~/pup-5539$ dpkg -l pup-5539-1 dpkg-query: no packages found matching pup-5539-1
While the spurious error about one of the two packages is slightly annoying and might result in false positives, the end result is still that both packages are not installed, exactly what is wanted. A simple way to work around that problem would be to list just one of the packages in the circular dependency; once you've done that, puppet will remove the packages, no problem.
This is because the apt provider uses apt-get remove to remove a package, rather than calling dpkg directly. In contrast, the yum provider uses the rpm command to remove packages, rather than using yum erase, which will (similarly to apt-get remove) consider dependencies before removal.
Since I believe that fixing PUP-1061 will require more work than changing the yum provider so that it calls yum erase rather than rpm -e, and since this is a discrepancy in behaviour between operating systems, I urge you to reconsider.
Having said that, this is your ticketing system and not mine, so I'm not going to insist
|