Skip to content
Permalink
Browse files

add a very simple wrapper for merge.rb

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@28226 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
Markus W. Weißmann
Markus W. Weißmann committed Aug 25, 2007
1 parent 977e700 commit b88431f4b18a9e4cf60c446004782727e8485e1e
Showing with 34 additions and 0 deletions.
  1. +34 −0 src/port1.0/portutil.tcl
@@ -1939,3 +1939,37 @@ proc archiveTypeIsSupported {type} {
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
}

0 comments on commit b88431f

Please sign in to comment.
You can’t perform that action at this time.