<pre style='margin:0'>
Clemens Lang (neverpanic) pushed a commit to branch gsoc17-migrate
in repository macports-base.
</pre>
<p><a href="https://github.com/macports/macports-base/commit/affd02be70bd871118eb220ab941a10d539d220b">https://github.com/macports/macports-base/commit/affd02be70bd871118eb220ab941a10d539d220b</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit affd02be70bd871118eb220ab941a10d539d220b
</span>Author: Umesh Singla <umeshksingla@macports.org>
AuthorDate: Thu Jul 20 02:46:18 2017 +0530
<span style='display:block; white-space:pre;color:#404040;'> import migrate module to macports
</span>---
src/macports1.0/macports.tcl | 14 ++++++++++++++
src/macports1.0/migrate.tcl | 23 ++++++++++++++++++-----
2 files changed, 32 insertions(+), 5 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/macports.tcl b/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 154ecf6..d8e6071 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -39,6 +39,7 @@ package require diagnose 1.0
</span> package require reclaim 1.0
package require selfupdate 1.0
package require snapshot 1.0
<span style='display:block; white-space:pre;background:#e0ffe0;'>+package require migrate 1.0
</span> package require Tclx
# catch wrapper shared with port1.0
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -4431,6 +4432,19 @@ proc macports::snapshot_main {opts} {
</span> return 0
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+proc macports::migrate_main {opts} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Calls the main function for the 'port migrate' command.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Args:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # None
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Returns:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # 0 on successful execution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ migrate::main $opts
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> ##
# Execute the rev-upgrade scan and attempt to rebuild all ports found to be
# broken. Depends on the revupgrade_mode setting from macports.conf.
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/migrate.tcl b/src/macports1.0/migrate.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index d227304..333dd91 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/migrate.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/migrate.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -40,7 +40,7 @@ namespace eval migrate {
</span>
# create a snapshot
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set snapshot snapshot::main
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # set snapshot snapshot::main
</span>
# fetch ports and variants for this snapshot
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -48,9 +48,23 @@ namespace eval migrate {
</span>
# ASSUMING I GET THE FINAL PORTLIST FOR NOW
# $portlist
<span style='display:block; white-space:pre;background:#ffe0e0;'>- uninstall_installed portlist
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- sort_ports portlist
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- recover_ports_state portlist
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set portlist [registry::entry imaged]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set portlist1 [sort_portlist_by_dependendents $portlist]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set portlist2 [sort_ports $portlist]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $portlist
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $portlist1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $portlist2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # uninstall_installed $portlist
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # sort_ports $portlist
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # recover_ports_state $portlist
</span>
# TODO: CLEAN PARTIAL BUILDS STEP HERE
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -71,7 +85,6 @@ namespace eval migrate {
</span> set portSearchResult [mportlookup $portName]
# TODO: error handling, if any?
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span> array set portInfo [lindex $portSearchResult 1]
set dependencyTypes { depends_fetch depends_extract depends_build depends_lib depends_run }
</pre><pre style='margin:0'>
</pre>