[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r1496: When building our Vidalia-only dmg, copy files to a temporar (trunk/pkg/osx)
Author: edmanm
Date: 2006-12-04 01:48:22 -0500 (Mon, 04 Dec 2006)
New Revision: 1496
Modified:
trunk/pkg/osx/builddmg.sh.in
Log:
When building our Vidalia-only dmg, copy files to a temporary directory and
then build the dmg from the temp directory (like we do for the mpkg), instead
of creating the disk image and copying files into the image. This way we don't have
to guess how much space we'll need ahead of time.
Modified: trunk/pkg/osx/builddmg.sh.in
===================================================================
--- trunk/pkg/osx/builddmg.sh.in 2006-12-04 05:33:21 UTC (rev 1495)
+++ trunk/pkg/osx/builddmg.sh.in 2006-12-04 06:48:22 UTC (rev 1496)
@@ -57,6 +57,8 @@
OS="unknown"
fi
+# Set the location of the temporary files
+BUILD_DIR=/tmp/vidalia-osx-$$
# Set the Vidalia version
VERSION="@VERSION@"
# Set the name of the output .dmg file
@@ -65,30 +67,21 @@
# Get the rest of the command-line arguments
filelist=$2
echo "Files to copy: $filelist"
-echo "Destination Disk Image: $DMGg"
+echo "Destination Disk Image: $DMG"
volname=`echo "$DMG" | sed -e "s/.*\///" | sed -e "s/.dmg//"`
echo "Volume Name: $volname"
-# Create the disk image
-hdiutil create $DMG -size 20m -fs HFS+ -volname "$volname"
+# Create the temporary directory
+mkdir $BUILD_DIR || exit 1
-# Mount the image and get the device name
-mntdir="dist.mnt"
-hdiutil attach "$DMG" -noautoopen -quiet -mountpoint "$mntdir"
-dev_handle=`hdiutil info | grep "$mntdir" | grep "Apple_HFS" | awk '{print $1}'`
-
# Copy over the specified files into the disk image
for file in $filelist
do
- echo "Copying $srcdir/$file to $mntdir/$file"
- ditto -rsrc "$srcdir/$file" "$mntdir/$file"
+ echo "Copying $srcdir/$file to $BUILD_DIR/$file"
+ cp -r "$srcdir/$file" "$BUILD_DIR/$file"
done
-# Unmount the volumen
-hdiutil detach $dev_handle
+# Create the disk image
+hdiutil create -format UDZO -srcfolder "$BUILD_DIR" -volname "$volname" "$DMG"
+rm -rf "$BUILD_DIR"
-# Replace the image with a compressed image
-hdiutil convert $DMG -format UDZO -o $DMG.udzo.dmg
-rm -f $DMG
-mv $DMG.udzo.dmg $DMG
-