<pre style='margin:0'>
Umesh Singla (umeshksingla) pushed a commit to branch gsoc17-migrate
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/468865e414ec8be275c979c055c176046d20be50">https://github.com/macports/macports-base/commit/468865e414ec8be275c979c055c176046d20be50</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 468865e414ec8be275c979c055c176046d20be50
</span>Author: Clemens Lang <cal@macports.org>
AuthorDate: Sun Jan 7 15:21:43 2018 +0100
<span style='display:block; white-space:pre;color:#404040;'> selfupdate: Add --migrate: rebuilds w/o downgrade
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> For 'port migrate' we want to automatically re-install MacPorts base
</span><span style='display:block; white-space:pre;color:#404040;'> even if there is no never version available. We do have 'port -f
</span><span style='display:block; white-space:pre;color:#404040;'> selfupdate' that would achieve this, but 'port -f selfupdate' would also
</span><span style='display:block; white-space:pre;color:#404040;'> downgrade any pre-release installations to the latest released version.
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Since a pre-release version could have changed the database layout,
</span><span style='display:block; white-space:pre;color:#404040;'> a downgrade from pre-release versions is not safe. Instead provide
</span><span style='display:block; white-space:pre;color:#404040;'> --migrate (mostly for internal use by 'port migrate') so that users with
</span><span style='display:block; white-space:pre;color:#404040;'> a pre-release version can be prompted to upgrade their base installation
</span><span style='display:block; white-space:pre;color:#404040;'> manually.
</span>---
doc/port-selfupdate.1.txt | 13 +++++++++----
src/macports1.0/selfupdate.tcl | 5 ++++-
src/port/port.tcl | 2 +-
3 files changed, 14 insertions(+), 6 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/doc/port-selfupdate.1.txt b/doc/port-selfupdate.1.txt
</span><span style='display:block; white-space:pre;color:#808080;'>index 5b69e40..d214a17 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/doc/port-selfupdate.1.txt
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/doc/port-selfupdate.1.txt
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -9,7 +9,7 @@ port-selfupdate - Upgrade MacPorts itself and update the port definition files.
</span> SYNOPSIS
--------
[cmdsynopsis]
<span style='display:block; white-space:pre;background:#ffe0e0;'>-*port* [*-qvdf*] *selfupdate* [--nosync]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+*port* [*-qvdf*] *selfupdate* [--nosync] [--migrate]
</span>
DESCRIPTION
-----------
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -29,6 +29,11 @@ OPTIONS
</span> Only check for updates - and install if available - for MacPorts itself. Do
not update the ports tree.
<span style='display:block; white-space:pre;background:#e0ffe0;'>+*--migrate*::
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ Rebuild even if no new version is available, upgrade if a new version is
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ available. Contrary to *-f*, this flag will prevent downgrades. This flag is
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ useful when upgrading to a newer macOS major version.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> include::global-flags.txt[]
*-q*::
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -39,9 +44,9 @@ include::global-flags.txt[]
</span> currently installed one, but always rebuild and reinstall MacPorts.
+
You can use this to downgrade from a beta or development version to the
<span style='display:block; white-space:pre;background:#ffe0e0;'>- latest release. Note that there is no guarantee that there have not been
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- made incompatible and irreversible changes to MacPorts' internal data
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- structures, making a downgrade impossible.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ latest release. Note that there is no guarantee that no incompatible and
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ irreversible changes have been made to MacPorts' internal data structures,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ which can make downgrading impossible.
</span>
EXAMPLES
--------
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/selfupdate.tcl b/src/macports1.0/selfupdate.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index a2d3f8a..5ebd036 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/selfupdate.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/selfupdate.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -158,7 +158,10 @@ proc selfupdate::main {{optionslist {}} {updatestatusvar {}}} {
</span> }
}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {$use_the_force_luke || $comp > 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Check whether we need to re-install base because of a migration
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set migrating [expr {[info exists options(ports_selfupdate_migrate)] && $options(ports_selfupdate_migrate)}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$use_the_force_luke || $comp > 0 || ($comp == 0 && $migrating)} {
</span> if {[info exists options(ports_dryrun)] && $options(ports_dryrun)} {
ui_msg "$macports::ui_prefix MacPorts base is outdated, selfupdate would install $macports_version_new (dry run)"
} else {
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port/port.tcl b/src/port/port.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index c99f015..88cef4e 100755
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port/port.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port/port.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4468,7 +4468,7 @@ array set cmd_opts_array {
</span> depends description epoch exact glob homepage line
long_description maintainer maintainers name platform
platforms portdir regex revision variant variants version}
<span style='display:block; white-space:pre;background:#ffe0e0;'>- selfupdate {nosync}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ selfupdate {migrate nosync}
</span> space {{units 1} total}
activate {no-exec}
deactivate {no-exec}
</pre><pre style='margin:0'>
</pre>