Chris@315: #!/bin/bash Chris@315: app=EasyMercurial.app Chris@315: if [ ! -d "$app.carbon" ] || [ ! -d "$app.cocoa" ]; then Chris@315: echo Carbon or Cocoa bundle not found Chris@315: exit 1 Chris@315: fi Chris@315: (cd "$app.cocoa" ; find . -type f -print) | while read f; do Chris@315: d=$(dirname "$f") Chris@315: mkdir -p "$app.output/$d" Chris@315: case $(file "$app.cocoa/$f") in Chris@315: *x86_64*) Chris@315: lipo "$app.cocoa/$f" -extract x86_64 -output "/tmp/$$.x86_64" Chris@315: case $(file "$app.carbon/$f") in Chris@315: *x86_64*) Chris@315: lipo "$app.carbon/$f" -remove x86_64 -output "/tmp/$$.rest" Chris@315: ;; Chris@315: *) Chris@315: cp "$app.carbon/$f" "/tmp/$$.rest" Chris@315: ;; Chris@315: esac Chris@315: lipo "/tmp/$$.x86_64" "/tmp/$$.rest" -create -output "$app.output/$f" Chris@315: rm "/tmp/$$".* Chris@315: ;; Chris@315: *) Chris@315: cp "$app.cocoa/$f" "$app.output/$f" Chris@315: ;; Chris@315: esac Chris@315: done Chris@315: Chris@315: