Opened 6 years ago

Closed 19 months ago

Last modified 19 months ago

#56008 closed defect (fixed)

port mirror does not indicate failure when checksum verification fails

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: jmroot (Joshua Root)
Priority: Normal Milestone: MacPorts 2.8.0
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 (3)

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

Owner: set to jmroot
Resolution: fixed
Status: newclosed

In 7ada403f32369d9fcf15394be76d8adb8487a410/macports-base (master):

portmirror: indicate error when checksum fails

Closes: #56008

comment:2 Changed 19 months ago by jmroot (Joshua Root)

Milestone: MacPorts Future

comment:3 Changed 19 months ago by jmroot (Joshua Root)

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