Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#63438 closed defect (fixed)

port checksum outdated doesn't work: version ... is not available

Reported by: jmarshallidau Owned by: jmroot (Joshua Root)
Priority: Normal Milestone: MacPorts 2.7.2
Component: base Version: 2.7.1
Keywords: Cc: jmroot (Joshua Root), dgilman (David Gilman)
Port:

Description

Ever since upgrading MacPorts to 2.7.1, 'port checksum outdated' chokes on the first 'outdated' port with:

Error: ${first_outdated_port} version ${old_version} is not available (current version is ${new_version})

See following example. 'port upgrade outdated' works just fine.

rwnb04# port selfupdate
--->  Updating MacPorts base sources using rsync
MacPorts base version 2.7.1 installed,
MacPorts base version 2.7.1 downloaded.
--->  Updating the ports tree
--->  MacPorts base is already the latest version

The ports tree has been updated. To upgrade your installed ports, you should run
  port upgrade outdated
rwnb04# 
rwnb04# port outdated
The following installed ports are outdated:
apr                            1.7.0_2 < 1.7.0_3         
glib2                          2.62.6_0 < 2.62.6_1       
libffi                         3.3_1 < 3.4.2_0           
p11-kit                        0.24.0_0 < 0.24.0_1       
python27                       2.7.18_2 < 2.7.18_3       
python38                       3.8.11_0 < 3.8.12_1       
python39                       3.9.6_0 < 3.9.7_0         
realpath                       1.0.1_1 < 1.0.2_0         
ruby24                         2.4.10_5 < 2.4.10_6       
ruby26                         2.6.8_0 < 2.6.8_1         
tesseract                      4.1.1_1 < 4.1.1_2         
rwnb04# 
rwnb04# port checksum outdated
Error: apr version 1.7.0_2 is not available (current version is 1.7.0_3)
rwnb04# 

I work around this problem with:

rwnb04# port checksum $(port -q outdated | cut -d' ' -f1)
--->  Fetching distfiles for apr
--->  Attempting to fetch apr-1.7.0.tar.bz2 from file:///kits/macports/links
--->  Verifying checksums for apr
--->  Fetching distfiles for glib2
...

Change History (7)

comment:1 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jmroot added
Summary: base 2.7.1: port checksum outdated chokesport checksum outdated doesn't work: version ... is not available

Well, the change was intentional, though I certainly didn't anticipate that anybody would run port checksum outdated or that the change would have this effect in that case. You can read about the change in #60454.

The change was that port version numbers may no longer be specified when it is inappropriate to do so. Originally the change only applied to the "install" action. It was then changed to apply to all actions except for "clean". The "outdated" pseudoport expands to a list of port names and their currently-installed version/revision/variants, hence the problem you experienced. We could also allow it in the "checksum" action, however if you expect port checksum outdated to work then you might expect port fetch outdated, port patch outdated, port configure outdated, port build outdated, port test outdated, and port destroot outdated to work too, and they also don't anymore since MacPorts 2.7.0. (port upgrade outdated still works, as we would want it to, though I'm unclear on how that's being allowed through.) Should we go back to just prohibiting version numbers in the "install" action?

Last edited 3 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:2 Changed 3 years ago by reneeotten (Renee Otten)

see also 63578

comment:3 Changed 3 years ago by dgilman (David Gilman)

The code already has a whitelist, I guess checksum/livecheck could be whitelisted. Or maybe just flip it to a blacklist of install/uninstall? If someone can give direction there I can take a stab at the patch.

comment:4 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: dgilman added

As I explained above, it seems reasonable to want to do almost any action, not just the few that are being proposed for whitelisting.

comment:5 Changed 3 years ago by jmroot (Joshua Root)

All the actions handled by action_target can (by their nature as Portfile targets) only run on the current version in the tree. If the current version of foo is 1.1, it's just as impossible to checksum foo @1.0 as to install foo @1.0. The real issue is that we have no way to specify "the current versions in the tree corresponding to the ports that are installed/active/whatever".

It's probably good enough to ignore versions added implicitly from the registry, and only error if the unavailable version was specified by the user. (It would actually be possible to really run some targets on the specified version if it is installed, by using the Portfile stored in the registry. But that would probably be even more confusing.)

Last edited 3 years ago by jmroot (Joshua Root) (previous) (diff)

comment:6 Changed 3 years ago by jmroot (Joshua Root)

Owner: set to jmroot
Resolution: fixed
Status: newclosed

In db498e03d83e86bde460c87d8205382fdce64c87/macports-base (master):

Ignore implicitly set versions in action_target

Fixes: #63438

comment:7 Changed 3 years ago by jmroot (Joshua Root)

Milestone: MacPorts 2.7.2
Note: See TracTickets for help on using tickets.