Opened 2 years ago

Last modified 10 months ago

#56549 new defect

selfupdate loses error message returned by mportsync

Reported by: jmroot (Joshua Root) Owned by:
Priority: Normal Milestone:
Component: base Version:
Keywords: Cc: Schamschula (Marius Schamschula), siccegge (Christoph Egger)


% sudo port sync                    
--->  Updating the ports tree
port sync failed: Synchronization of 1 source failed

The last line there is sometimes the only error message generated outside of verbose mode, e.g. when a git repo fails to sync. selfupdate::main does this:

        try {
            mportsync $optionslist
        }  catch {{*} eCode eMessage} {
            return -code error "Couldn't sync the ports tree: $eMessage"

which should return an error message that includes mportsync's. But apparently something further up the call chain fails to print it:

% sudo port selfupdate   
--->  Updating MacPorts base sources using rsync
MacPorts base version 2.5.99 installed,
MacPorts base version 2.5.0 downloaded.
--->  Updating the ports tree

Needless to say, this is pretty confusing.

Change History (3)

comment:1 Changed 2 years ago by jmroot (Joshua Root)

Actually it's worse than that. From action_selfupdate:

    if { [catch {macports::selfupdate [array get options] base_updated} result ] } {
        ui_debug $::errorInfo
        ui_error $result
        if {![macports::ui_isset ports_verbose]} {
            ui_msg "Please run `port -v selfupdate' for details."
        } else {
            # Let's only print the ticket URL if the user has followed the
            # advice we printed earlier.
        fatal "port selfupdate failed: $result"

None of that stuff is being printed, which means macports::selfupdate is appearing to succeed when it in fact failed.

comment:2 Changed 2 years ago by Schamschula (Marius Schamschula)

Cc: Schamschula added

comment:3 Changed 10 months ago by siccegge (Christoph Egger)

Cc: siccegge added
Note: See TracTickets for help on using tickets.