[28226] trunk/base/src/port1.0/portutil.tcl

source_changes at macosforge.org source_changes at macosforge.org
Sat Aug 25 08:24:47 PDT 2007


Revision: 28226
          http://trac.macosforge.org/projects/macports/changeset/28226
Author:   mww at macports.org
Date:     2007-08-25 08:24:47 -0700 (Sat, 25 Aug 2007)

Log Message:
-----------
add a very simple wrapper for merge.rb

Modified Paths:
--------------
    trunk/base/src/port1.0/portutil.tcl

Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl	2007-08-25 10:09:06 UTC (rev 28225)
+++ trunk/base/src/port1.0/portutil.tcl	2007-08-25 15:24:47 UTC (rev 28226)
@@ -1939,3 +1939,37 @@
 	return -code error [format [msgcat::mc "Unsupported port archive type '%s': %s"] $type $errmsg]
 }
 
+
+# simple wrapper for calling merge.rb - for creating universal binaries (etc.)
+# this is intended to be called during destroot, e.g. 'merge i386 ppc'
+# this will merge the directories $destroot/i386 & $destroot/ppc into $destroot
+proc merge args {
+	global workpath prefix destroot
+	set all_args "-i ${destroot} -o ${destroot} -v debug"
+	set architectures ""
+
+	# check existance of given architectures in $destroot
+	foreach arg $args {
+		if [file exists ${destroot}/${arg}] {
+			ui_debug "found architecture '${arg}'"
+			set architectures "${architectures} $arg"
+		} else {
+			ui_error "could not find directory for architecture '${arg}'"
+		}
+	}
+	set all_args "${all_args} ${architectures}"
+
+	# call merge.rb
+	ui_debug "executing merge.rb with '${all_args}'"
+	set fullcmdstring "${prefix}/bin/merge.rb $all_args"
+	set code [catch {system $fullcmdstring} result]
+	ui_debug "merge returned: '${result}'"
+
+	foreach arg ${architectures} {
+		ui_debug "removing arch directory \"$arg\""
+		file delete -force ${destroot}/${arg}
+	}
+
+	return -code $code $result
+}
+

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070825/3e48fad2/attachment.html


More information about the macports-changes mailing list