Opened 9 years ago

Closed 7 years ago

Last modified 7 years ago

#48439 closed enhancement (fixed)

port selfupdate - privileges error message

Reported by: grunermonzon@… Owned by: macports-tickets@…
Priority: Low Milestone: MacPorts 2.4.0
Component: base Version: 2.3.3
Keywords: Cc:
Port:

Description

When trying to run selfupdate without the appropriate privileges, a cryptic message prints out:

--->  Updating MacPorts base sources using rsync
receiving file list ... done
rsync: mkstemp "/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/.base.tar.d146Xp" failed: Permission denied (13)
inflate returned -3 (19 bytes)
rsync error: error in rsync protocol data stream (code 12) at /SourceCache/rsync/rsync-45/rsync/token.c(419) [receiver=2.6.9]
rsync: connection unexpectedly closed (31 bytes received so far) [generator]
rsync error: error in rsync protocol data stream (code 12) at /SourceCache/rsync/rsync-45/rsync/io.c(453) [generator=2.6.9]
Command failed: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/tarballs/base.tar /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
Exit code: 12
Error: Error synchronizing MacPorts sources: command execution failed
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: /opt/local/bin/port: port selfupdate failed: Error synchronizing MacPorts sources: command execution failed

Other commands, such as install, perform a safe check before and print out a nice message

Error: Insufficient privileges to write to MacPorts install prefix.

I thought it would be a nice enhancement to check for the appropriate privileges when running self update, such as install does.

Change History (3)

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

Keywords: selfupate permissions removed

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

Resolution: fixed
Status: newclosed

In 68016b8/macports-base:

Add prefix_unwritable check for selfupdate

Fail early with a good message if the user forgot to use sudo or
otherwise can't write to the prefix.

Fixes: #48439

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

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