Opened 8 years ago

Last modified 12 months ago

#52303 new defect

`port uninstall --follow-dependents` uninstalls more ports than `port rdependents` reports

Reported by: ksze (Kal Sze) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: base Version: 2.3.4
Keywords: Cc:
Port:

Description

OS: macOS Sierra 10.12 MacPorts 2.3.4 installed using the Sierra-specific pkg.

port rdependents perl5.22 showed me this listing:

The following ports are dependent on perl5.22:
  p5.22-authen-sasl
  p5.22-cgi
  p5.22-digest-hmac
  p5.22-digest-sha1
  p5.22-encode-locale
    p5.22-http-message
      p5.22-html-form
        p5.22-libwww-perl
          p5.22-xml-parser
      p5.22-http-cookies
      p5.22-http-daemon
      p5.22-http-negotiate
  p5.22-error
  p5.22-file-listing
  p5.22-getopt-long
  p5.22-gssapi
  p5.22-html-parser
  p5.22-html-tagset
  p5.22-http-date
  p5.22-io
    p5.22-io-socket-inet6
  p5.22-io-html
  p5.22-io-socket-ip
  p5.22-io-socket-ssl
    p5.22-lwp-protocol-https
    p5.22-net-http
    p5.22-net-smtp-ssl
  p5.22-locale-gettext
  p5.22-lwp-mediatypes
  p5.22-mime-base64
    p5.22-uri
      p5.22-www-robotrules
  p5.22-mozilla-ca
  p5.22-net-libidn
  p5.22-net-ssleay
  p5.22-pathtools
  p5.22-scalar-list-utils
  p5.22-socket
  p5.22-socket6
  p5.22-sub-uplevel
    p5.22-test-exception
    p5.22-test-warn
  p5.22-term-readkey
  p5.22-test-deep
  p5.22-test-nowarnings
  p5.22-test-simple

But then when I ran port uninstall --follow-dependents perl5.22, these ports actually got uninstalled:

--->  Deactivating p5.22-authen-sasl @2.160.0_0
--->  Cleaning p5.22-authen-sasl
--->  Uninstalling p5.22-authen-sasl @2.160.0_0
--->  Cleaning p5.22-authen-sasl
--->  Deactivating p5.22-digest-hmac @1.30.0_0
--->  Cleaning p5.22-digest-hmac
--->  Uninstalling p5.22-digest-hmac @1.30.0_0
--->  Cleaning p5.22-digest-hmac
--->  Deactivating p5.22-digest-sha1 @2.130.0_4
--->  Cleaning p5.22-digest-sha1
--->  Uninstalling p5.22-digest-sha1 @2.130.0_4
--->  Cleaning p5.22-digest-sha1
--->  Deactivating p5.22-xml-parser @2.440.0_0
--->  Cleaning p5.22-xml-parser
--->  Uninstalling p5.22-xml-parser @2.440.0_0
--->  Cleaning p5.22-xml-parser
--->  Deactivating p5.22-libwww-perl @6.150.0_0+ssl
--->  Cleaning p5.22-libwww-perl
--->  Uninstalling p5.22-libwww-perl @6.150.0_0+ssl
--->  Cleaning p5.22-libwww-perl
--->  Deactivating p5.22-http-negotiate @6.10.0_1
--->  Cleaning p5.22-http-negotiate
--->  Uninstalling p5.22-http-negotiate @6.10.0_1
--->  Cleaning p5.22-http-negotiate
--->  Deactivating p5.22-html-form @6.30.0_1
--->  Cleaning p5.22-html-form
--->  Uninstalling p5.22-html-form @6.30.0_1
--->  Cleaning p5.22-html-form
--->  Deactivating p5.22-http-cookies @6.10.0_1
--->  Cleaning p5.22-http-cookies
--->  Uninstalling p5.22-http-cookies @6.10.0_1
--->  Cleaning p5.22-http-cookies
--->  Deactivating p5.22-http-daemon @6.10.0_1
--->  Cleaning p5.22-http-daemon
--->  Uninstalling p5.22-http-daemon @6.10.0_1
--->  Cleaning p5.22-http-daemon
--->  Deactivating p5.22-http-message @6.110.0_0
--->  Cleaning p5.22-http-message
--->  Uninstalling p5.22-http-message @6.110.0_0
--->  Cleaning p5.22-http-message
--->  Deactivating p5.22-encode-locale @1.50.0_0
--->  Cleaning p5.22-encode-locale
--->  Uninstalling p5.22-encode-locale @1.50.0_0
--->  Cleaning p5.22-encode-locale
--->  Deactivating p5.22-error @0.170.240_0
--->  Cleaning p5.22-error
--->  Uninstalling p5.22-error @0.170.240_0
--->  Cleaning p5.22-error
--->  Deactivating p5.22-getopt-long @2.49.1_0
--->  Cleaning p5.22-getopt-long
--->  Uninstalling p5.22-getopt-long @2.49.1_0
--->  Cleaning p5.22-getopt-long
--->  Deactivating p5.22-gssapi @0.280.0_3
--->  Cleaning p5.22-gssapi
--->  Uninstalling p5.22-gssapi @0.280.0_3
--->  Cleaning p5.22-gssapi
--->  Deactivating p5.22-cgi @4.330.0_0
--->  Cleaning p5.22-cgi
--->  Uninstalling p5.22-cgi @4.330.0_0
--->  Cleaning p5.22-cgi
--->  Deactivating p5.22-html-parser @3.720.0_0
--->  Cleaning p5.22-html-parser
--->  Uninstalling p5.22-html-parser @3.720.0_0
--->  Cleaning p5.22-html-parser
--->  Deactivating p5.22-html-tagset @3.200.0_4
--->  Cleaning p5.22-html-tagset
--->  Uninstalling p5.22-html-tagset @3.200.0_4
--->  Cleaning p5.22-html-tagset
--->  Deactivating p5.22-file-listing @6.40.0_1
--->  Cleaning p5.22-file-listing
--->  Uninstalling p5.22-file-listing @6.40.0_1
--->  Cleaning p5.22-file-listing
--->  Deactivating p5.22-http-date @6.20.0_1
--->  Cleaning p5.22-http-date
--->  Uninstalling p5.22-http-date @6.20.0_1
--->  Cleaning p5.22-http-date
--->  Deactivating p5.22-io-socket-inet6 @2.720.0_0
--->  Cleaning p5.22-io-socket-inet6
--->  Uninstalling p5.22-io-socket-inet6 @2.720.0_0
--->  Cleaning p5.22-io-socket-inet6
--->  Deactivating p5.22-io @1.250.0_4
--->  Cleaning p5.22-io
--->  Uninstalling p5.22-io @1.250.0_4
--->  Cleaning p5.22-io
--->  Deactivating p5.22-io-html @1.1.0_0
--->  Cleaning p5.22-io-html
--->  Uninstalling p5.22-io-html @1.1.0_0
--->  Cleaning p5.22-io-html
--->  Deactivating p5.22-locale-gettext @1.70.0_0
--->  Cleaning p5.22-locale-gettext
--->  Uninstalling p5.22-locale-gettext @1.70.0_0
--->  Cleaning p5.22-locale-gettext
--->  Deactivating p5.22-lwp-mediatypes @6.20.0_1
--->  Cleaning p5.22-lwp-mediatypes
--->  Uninstalling p5.22-lwp-mediatypes @6.20.0_1
--->  Cleaning p5.22-lwp-mediatypes
--->  Deactivating p5.22-www-robotrules @6.20.0_1
--->  Cleaning p5.22-www-robotrules
--->  Uninstalling p5.22-www-robotrules @6.20.0_1
--->  Cleaning p5.22-www-robotrules
--->  Deactivating p5.22-lwp-protocol-https @6.60.0_1
--->  Cleaning p5.22-lwp-protocol-https
--->  Uninstalling p5.22-lwp-protocol-https @6.60.0_1
--->  Cleaning p5.22-lwp-protocol-https
--->  Deactivating p5.22-net-http @6.90.0_0
--->  Cleaning p5.22-net-http
--->  Uninstalling p5.22-net-http @6.90.0_0
--->  Cleaning p5.22-net-http
--->  Deactivating p5.22-uri @1.710.0_0
--->  Cleaning p5.22-uri
--->  Uninstalling p5.22-uri @1.710.0_0
--->  Cleaning p5.22-uri
--->  Deactivating p5.22-mime-base64 @3.150.0_0
--->  Cleaning p5.22-mime-base64
--->  Uninstalling p5.22-mime-base64 @3.150.0_0
--->  Cleaning p5.22-mime-base64
--->  Deactivating p5.22-mozilla-ca @20160104_0
--->  Cleaning p5.22-mozilla-ca
--->  Uninstalling p5.22-mozilla-ca @20160104_0
--->  Cleaning p5.22-mozilla-ca
--->  Deactivating p5.22-net-smtp-ssl @1.30.0_0
--->  Cleaning p5.22-net-smtp-ssl
--->  Uninstalling p5.22-net-smtp-ssl @1.30.0_0
--->  Cleaning p5.22-net-smtp-ssl
--->  Deactivating p5.22-io-socket-ssl @2.38.0_0
--->  Cleaning p5.22-io-socket-ssl
--->  Uninstalling p5.22-io-socket-ssl @2.38.0_0
--->  Cleaning p5.22-io-socket-ssl
--->  Deactivating p5.22-net-libidn @0.120.0_4
--->  Cleaning p5.22-net-libidn
--->  Uninstalling p5.22-net-libidn @0.120.0_4
--->  Cleaning p5.22-net-libidn
--->  Deactivating p5.22-pathtools @3.620.0_0
--->  Cleaning p5.22-pathtools
--->  Uninstalling p5.22-pathtools @3.620.0_0
--->  Cleaning p5.22-pathtools
--->  Deactivating p5.22-scalar-list-utils @1.450.0_0
--->  Cleaning p5.22-scalar-list-utils
--->  Uninstalling p5.22-scalar-list-utils @1.450.0_0
--->  Cleaning p5.22-scalar-list-utils
--->  Deactivating p5.22-io-socket-ip @0.380.0_0
--->  Cleaning p5.22-io-socket-ip
--->  Uninstalling p5.22-io-socket-ip @0.380.0_0
--->  Cleaning p5.22-io-socket-ip
--->  Deactivating p5.22-socket @2.24.0_0
--->  Cleaning p5.22-socket
--->  Uninstalling p5.22-socket @2.24.0_0
--->  Cleaning p5.22-socket
--->  Deactivating p5.22-socket6 @0.280.0_0
--->  Cleaning p5.22-socket6
--->  Uninstalling p5.22-socket6 @0.280.0_0
--->  Cleaning p5.22-socket6
--->  Deactivating p5.22-test-exception @0.430.0_0
--->  Cleaning p5.22-test-exception
--->  Uninstalling p5.22-test-exception @0.430.0_0
--->  Cleaning p5.22-test-exception
--->  Deactivating p5.22-test-warn @0.300.0_1
--->  Cleaning p5.22-test-warn
--->  Uninstalling p5.22-test-warn @0.300.0_1
--->  Cleaning p5.22-test-warn
--->  Deactivating p5.22-sub-uplevel @0.260.0_0
--->  Cleaning p5.22-sub-uplevel
--->  Uninstalling p5.22-sub-uplevel @0.260.0_0
--->  Cleaning p5.22-sub-uplevel
--->  Deactivating p5.22-term-readkey @2.330.0_0
--->  Cleaning p5.22-term-readkey
--->  Uninstalling p5.22-term-readkey @2.330.0_0
--->  Cleaning p5.22-term-readkey
--->  Deactivating p5.22-test-deep @1.123.0_0
--->  Cleaning p5.22-test-deep
--->  Uninstalling p5.22-test-deep @1.123.0_0
--->  Cleaning p5.22-test-deep
--->  Deactivating p5.22-test-nowarnings @1.40.0_1
--->  Cleaning p5.22-test-nowarnings
--->  Uninstalling p5.22-test-nowarnings @1.40.0_1
--->  Cleaning p5.22-test-nowarnings
--->  Deactivating p5.22-test-simple @1.302.56_0
--->  Cleaning p5.22-test-simple
--->  Uninstalling p5.22-test-simple @1.302.56_0
--->  Cleaning p5.22-test-simple
--->  Deactivating rrdtool @1.5.5_1
--->  Cleaning rrdtool
--->  Uninstalling rrdtool @1.5.5_1
--->  Cleaning rrdtool
--->  Deactivating intltool @0.51.0_2
--->  Cleaning intltool
--->  Uninstalling intltool @0.51.0_2
--->  Cleaning intltool
--->  Deactivating p5.24-xml-parser @2.440.0_0
--->  Cleaning p5.24-xml-parser
--->  Uninstalling p5.24-xml-parser @2.440.0_0
--->  Cleaning p5.24-xml-parser
--->  Deactivating p5.24-libwww-perl @6.150.0_0+ssl
--->  Cleaning p5.24-libwww-perl
--->  Uninstalling p5.24-libwww-perl @6.150.0_0+ssl
--->  Cleaning p5.24-libwww-perl
--->  Deactivating p5.24-www-robotrules @6.20.0_1
--->  Cleaning p5.24-www-robotrules
--->  Uninstalling p5.24-www-robotrules @6.20.0_1
--->  Cleaning p5.24-www-robotrules
--->  Deactivating p5.24-http-negotiate @6.10.0_1
--->  Cleaning p5.24-http-negotiate
--->  Uninstalling p5.24-http-negotiate @6.10.0_1
--->  Cleaning p5.24-http-negotiate
--->  Deactivating p5.24-html-form @6.30.0_1
--->  Cleaning p5.24-html-form
--->  Uninstalling p5.24-html-form @6.30.0_1
--->  Cleaning p5.24-html-form
--->  Deactivating p5.24-http-cookies @6.10.0_1
--->  Cleaning p5.24-http-cookies
--->  Uninstalling p5.24-http-cookies @6.10.0_1
--->  Cleaning p5.24-http-cookies
--->  Deactivating p5.24-http-daemon @6.10.0_1
--->  Cleaning p5.24-http-daemon
--->  Uninstalling p5.24-http-daemon @6.10.0_1
--->  Cleaning p5.24-http-daemon
--->  Deactivating p5.24-http-message @6.110.0_0
--->  Cleaning p5.24-http-message
--->  Uninstalling p5.24-http-message @6.110.0_0
--->  Cleaning p5.24-http-message
--->  Deactivating p5.24-lwp-protocol-https @6.60.0_1
--->  Cleaning p5.24-lwp-protocol-https
--->  Uninstalling p5.24-lwp-protocol-https @6.60.0_1
--->  Cleaning p5.24-lwp-protocol-https
--->  Deactivating p5.24-net-http @6.90.0_0
--->  Cleaning p5.24-net-http
--->  Uninstalling p5.24-net-http @6.90.0_0
--->  Cleaning p5.24-net-http
--->  Deactivating p5.24-uri @1.710.0_0
--->  Cleaning p5.24-uri
--->  Uninstalling p5.24-uri @1.710.0_0
--->  Cleaning p5.24-uri
--->  Deactivating p5.24-io-socket-ssl @2.38.0_0
--->  Cleaning p5.24-io-socket-ssl
--->  Uninstalling p5.24-io-socket-ssl @2.38.0_0
--->  Cleaning p5.24-io-socket-ssl
--->  Deactivating p5.22-net-ssleay @1.780.0_0
--->  Cleaning p5.22-net-ssleay
--->  Uninstalling p5.22-net-ssleay @1.780.0_0
--->  Cleaning p5.22-net-ssleay
--->  Deactivating perl5.22 @5.22.2_1
--->  Cleaning perl5.22
--->  Uninstalling perl5.22 @5.22.2_1
--->  Cleaning perl5.22

Note the extra packages not reported by port rdependents perl5.22, e.g.:

  • rrdtool
  • intltool
  • p5.24-*

Change History (2)

comment:1 Changed 14 months ago by jmroot (Joshua Root)

The issue may have been that this loop assumes that the identifiers refer to the same registry entries across the uninstall operation, which potentially deletes and opens multiple entries: https://github.com/macports/macports-base/blob/v2.3.4/src/registry2.0/portuninstall.tcl#L123

That assumption should actually hold after [fc212a0b550ed961d07c261c715ca83580deac56/macports-base], so this may have been fixed incidentally.

comment:2 in reply to:  1 Changed 12 months ago by barracuda156

Replying to jmroot:

The issue may have been that this loop assumes that the identifiers refer to the same registry entries across the uninstall operation, which potentially deletes and opens multiple entries: https://github.com/macports/macports-base/blob/v2.3.4/src/registry2.0/portuninstall.tcl#L123

That assumption should actually hold after [fc212a0b550ed961d07c261c715ca83580deac56/macports-base], so this may have been fixed incidentally.

For some reason this command does not work at all for me. It only uninstalls a port being specified, leaving dependents broken but installed:

svacchanda@Sergeys-MacBook-Air ~ % sudo port uninstall --follow-dependents R-CRAN-recommended
The following versions of R-CRAN-recommended are currently installed:
 1) R-CRAN-recommended @1.0.0_0
 2) R-CRAN-recommended @1.0.0_1 (active)
. . .
Continue? [y/N]: y
Warning: Uninstall forced.  Proceeding despite dependencies.
--->  Deactivating R-CRAN-recommended @1.0.0_1
--->  Cleaning R-CRAN-recommended
--->  Uninstalling R-CRAN-recommended @1.0.0_1
Note: See TracTickets for help on using tickets.