[25610] branches/dp2mp-move/base/src/package1.0/portunarchive.tcl

source_changes at macosforge.org source_changes at macosforge.org
Fri May 25 23:28:59 PDT 2007


Revision: 25610
          http://trac.macosforge.org/projects/macports/changeset/25610
Author:   jmpp at macports.org
Date:     2007-05-25 23:28:59 -0700 (Fri, 25 May 2007)

Log Message:
-----------

Binary archives have a +STATE file in them with strings for each completed stage upon archive creation time.
For "old" archives, these strings expand to 'com.apple.<stage>', which this branch does not recognize and therefore
ignores the result of the archive expansion (the created destroot), proceeding to install the port from scratch.
Provide a hack to update these strings to the 'org.macports.<stage>' namespace in the created statefile so that
the unpacked destroot is not ignored and archivemode keeps on working its happy way toward quick port installation.

Modified Paths:
--------------
    branches/dp2mp-move/base/src/package1.0/portunarchive.tcl

Modified: branches/dp2mp-move/base/src/package1.0/portunarchive.tcl
===================================================================
--- branches/dp2mp-move/base/src/package1.0/portunarchive.tcl	2007-05-26 05:24:09 UTC (rev 25609)
+++ branches/dp2mp-move/base/src/package1.0/portunarchive.tcl	2007-05-26 06:28:59 UTC (rev 25610)
@@ -287,6 +287,18 @@
 	file copy -force [file join $destpath "+STATE"] $statefile
 	exec touch $statefile
 
+# Hack to temporarily move com.apple.* strings in statefiles extracted from old archives
+# to the org.macports.* namespace. "temporarily" because old archives will still have a
+# +STATE file with the old strings in it, as we only update them on the unpacked statefile.
+    set fd_new_sf [open $statefile r]
+    set fd_tmp [open ${statefile}.tmp w+]
+    while {[gets $fd_new_sf line] >= 0} {
+	puts $fd_tmp "[regsub com.apple $line org.macports]"
+    }
+    close $fd_new_sf
+    close $fd_tmp
+    file rename -force ${statefile}.tmp $statefile
+
     # Update the state from unpacked archive version
     set target_state_fd [open_statefile]
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070525/91ed261c/attachment.html


More information about the macports-changes mailing list