-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
selfupdate: Prints number of outdated ports after updating ports tree #314
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution. This would close https://trac.macports.org/ticket/33820.
This commit declares updatestatusvar in selfupdate::main as a dict, indicates that whether we updated base and portindex is needed.
src/port/port.tcl
Outdated
@@ -2798,6 +2798,20 @@ proc action_selfupdate { action portlist opts } { | |||
fatal "port selfupdate failed: $result" | |||
} | |||
|
|||
if {![info exists options(ports_${action}_no-sync)] || !$options(ports_${action}_no-sync)} { | |||
if {[dict get $selfupdate_status needed_portindex]} { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does needed_portindex
actually required if the port base has been updated with no --no-sync
given?
Seems that we can just check base_updated
at here to print messages for rerun port selfupdate
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving this message to port.tcl looks good to me, as it is up to the client to restart the selfupdate (or ask the user to do so).
The check for --no-sync is the same as inside the macports1.0 API and that seems redundant. The needed_portindex
would not be set otherwise.
But your change lost the condition on base_updated
here.
As a side note, the macports1.0 API change is not backwards compatible, so we should only ship this with the next 2.x.0 release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check for --no-sync is the same as inside the macports1.0 API and that seems redundant. The
needed_portindex
would not be set otherwise.
Checking for --no-sync
might be required for messages about restarting the selfupdate at here.
It can be returned by macports::selfupdate
, but I'm not sure if it's necessary since there are some similar checks in port.tcl
.
But your change lost the condition on
base_updated
here.
The check for base_updated
might not be required at here, asportindex
may not running in some cases:
macports-base/src/macports1.0/macports.tcl
Line 3034 in 87a8c78
set needs_portindex false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is when the ports tree was downloaded, but the Portfiles use new features of base, so they cannot be parsed with the old version. The message being printed only makes sense when base was updated.
63c3da8
to
d2a2e7e
Compare
Hi,
Here is a tiny suggestion about user interface.
People may want to know how many ports can be upgraded after the ports tree has been updated by
port selfupdate
.This patch prints about numbers of outdated ports like this:
and when no installed ports are outdated will look like this: