Opened 3 years ago

#56008 new defect

port mirror does not indicate failure when checksum verification fails

Reported by: ryandesign (Ryan Schmidt) Owned by:
Priority: Normal Milestone:
Component: base Version: 2.4.2
Keywords: Cc: jmroot (Joshua Root)
Port:

Description

port mirror correctly returns an error code if fetch fails. For example if I modify the zlib port to fetch a nonexistent version:

$ sudo /opt/local/bin/port mirror zlib; echo $?
--->  Fetching distfiles for zlib
--->  Attempting to fetch zlib-1.2.1111.tar.xz from https://distfiles.macports.org/zlib
--->  Attempting to fetch zlib-1.2.1111.tar.xz from http://www.zlib.net/
Error: Failed to mirror zlib: The requested URL returned error: 404 Not Found
Error: See /opt/local/var/macports/logs/_Users_rschmidt_macports_macports-ports-svn-trunk_archivers_zlib/zlib/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port zlib failed
1

But if fetch succeeds but checksum verification fails, it does not indicate this. For example if I deliberately make the checksum of the zlib port incorrect:

$ sudo /opt/local/bin/port mirror zlib; echo $?
--->  Fetching distfiles for zlib
--->  Attempting to fetch zlib-1.2.11.tar.xz from https://distfiles.macports.org/zlib
Error: Checksum (rmd160) mismatch for zlib-1.2.11.tar.xz                             
0

We already tell people to run port -p mirror if they want to mirror all files and proceed past errors, so fixing it to correctly indicate its error status seems like the right thing to do.

Change History (0)

Note: See TracTickets for help on using tickets.