giturl=$(git_url $gitpath)
gittag=$(git_tag $gitpath)
if [ -z "$filemode" ] ; then
- [ -d $dest ] || mkdir -p $dest
- pushd $dest
+ [ -d "$dest" ] || mkdir -p "$dest"
+ pushd "$dest" >& /dev/null
git archive --remote=${giturl} ${gittag} | tar -xf - ${path}
- popd
+ popd >& /dev/null
else
- destdir=$(dirname $dest)
- [ -d $destdir ] || mkdir -p $destdir
- git archive --remote=${giturl} ${gittag} | tar -xOf - ${path} > ${dest}
+ destdir=$(dirname "$dest")
+ [ -d "$destdir" ] || mkdir -p "$destdir"
+ git archive --remote=${giturl} ${gittag} | tar -xOf - ${path} > "${dest}"
fi
}
img_name=${sface_release}-${sfa_release}-${arch}
img_dmg=./${img_name}.dmg
img_raw_dmg=./${img_name}.raw.dmg
- img_mnt="/Volumes/${img_name}"
+ img_mnt_name="sface ($arch)"
+ img_mnt="/Volumes/${img_mnt_name}"
# check we're clear
[ -f $img_dmg ] && die "output dmg $img_dmg already exists"
[ -d "$img_mnt" ] && die "Image already mounted on $img_mnt"
echo "Initializing image ..."
- hdiutil create -quiet -size $DISK_SIZE -fs HFS -volname ${img_name} $img_raw_dmg
- hdiutil attach -readwrite -mount required $img_raw_dmg
-
+ hdiutil create -quiet -size $DISK_SIZE -fs HFS -volname "${img_mnt_name}" $img_raw_dmg
+ hdiutil attach -readwrite -mount required "$img_raw_dmg"
+
# copy skeleton as-is
- tar -C "$skel_mnt" --exclude .Trashes -cf - . | tar -C "$img_mnt" -xf -
+ echo "Populating from skeleton.."
+ ( cd "$skel_mnt" ; find . 2> /dev/null | cpio --quiet -c -o) | ( cd "$img_mnt" ; cpio -diu )
+
# places relative to mount point
app=sface.app
# xxx tmp
#
resource_path=$app/Contents/Resources
bin_path=$app/Contents/MacOS
- icon_path=$app/Contents/Resources/
- background_path=background
+
# retrieve sfa/sfa and sface/sface in the image
+ rm -rf "$img_mnt"/$resource_path/{sfa,sface}
git_retrieve $sfa_GITPATH sfa "$img_mnt"/$resource_path/
git_retrieve $sface_GITPATH sface "$img_mnt"/$resource_path/
# copy binaries from sface to the bin dir
# don't use the --file mode as this loses the executable bit
git_retrieve $sface_GITPATH $bin "$img_mnt"/$bin_path
done
- # install background and app icons
-# git_retrieve --file $sface_GITPATH macos/graphic-install-background.png "$img_mnt"/$background_path/background.png
- git_retrieve --file $sface_GITPATH macos/graphic-install-background.png "$img_mnt"/.background.png
- git_retrieve --file $sface_GITPATH macos/graphic-sfa.icns "$img_mnt"/$icon_path/appIcon.icns
- # the volume icons
- git_retrieve --file $sface_GITPATH macos/graphic-vol-sface.icns "$img_mnt"/.VolumeIcon.icns
+
+ ### install background and app icons
+ # clean up any 'background' dir if exists
+ rm -rf "$img_mnt"/{,.}background
+ git_retrieve --file $sface_GITPATH macos/graphic-install-background.png "$img_mnt"/.background/background.png
+ git_retrieve --file $sface_GITPATH macos/graphic-sfa.icns "$img_mnt"/$resource_path/appIcon.icns
+ # the volume icons won't work - who cares
+# git_retrieve --file $sface_GITPATH macos/graphic-vol-sface.icns "$img_mnt"/.background/volumeIcon.icns
+# git_retrieve --file $sface_GITPATH macos/graphic-vol-sface.png "$img_mnt"/.background/volumeIcon.png
# instantiate version
sed -e "s,@VERSIONTAG@,$sfa_release,g" -e "s,@SCMURL@,${sfa_GITPATH},g" \
"$img_mnt"/$resource_path/sfa/util/version.py.in > "$img_mnt"/$resource_path/sfa/util/version.py
- # this apparently requires xcode
- /Developer/Tools/SetFile -a V "$img_mnt"/$background_path
-
# clean up just in case
find "$img_mnt" -name '*pyc' | xargs rm -f
find "$img_mnt" -name '*~' | xargs rm -f
read _
fi
+ # this apparently requires xcode
+# /Developer/Tools/SetFile -a V "$img_mnt"/$background_path
+
hdiutil detach "$img_mnt"
rm -f $img_dmg
echo "Compressing..."