]> git.sesse.net Git - vlc/commitdiff
* extras/MacOSX/macosx-dmg: rewrote the package script.
authorDerk-Jan Hartman <hartman@videolan.org>
Sat, 15 May 2004 02:36:05 +0000 (02:36 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Sat, 15 May 2004 02:36:05 +0000 (02:36 +0000)
  - will now determine desired image size by itself
  - the hdid mount command mounted the image as root if no user is logged in via GUI.
    this is very undesirable for nightly builds.
    now uses the mount command and a local mountpoint.

Makefile.am
extras/MacOSX/macosx-dmg

index a4c6c077d19d1b80c8126b5055dea8f9295a1e37..7515cbae5a1963d6c270f3920b647997ffcd212b 100644 (file)
@@ -720,7 +720,7 @@ package-macosx:
        cd "$(srcdir)" && cp AUTHORS COPYING ChangeLog README README.MacOSX.rtf THANKS NEWS $(top_builddir)/tmp/
 
 # Create disk image 
-       $(srcdir)/extras/MacOSX/macosx-dmg 25 "vlc-${VERSION}" $(top_builddir)/tmp/* 
+       $(srcdir)/extras/MacOSX/macosx-dmg "vlc-${VERSION}" $(top_builddir)/tmp
 
 # Clean up
        rm -Rf $(top_builddir)/tmp
index 03245752f7b606bd22a69919fda56f3364e978cf..47dc7b8cbc3ecf204f5462e46e73b08dc61f2ce0 100755 (executable)
@@ -7,16 +7,19 @@
 set -e
 
 # Requires at least three args
-if [ $# -lt 3 ] ; then
-    echo "usage: $0 size name file ..." 1>&2
+if [ $# -lt 2 ] ; then
+    echo "usage: $0 imgName dirName ..." 1>&2
     exit 1
 fi
 
 # Grab size and name
-imgSize=$1
-shift
 imgName=$1
 shift
+dirName=$1
+shift
+
+imgSize=`du -sk ${dirName} | cut -f1`
+imgSize=$((${imgSize} / 1024 + 2))
 
 if [ $((${imgSize} < 5)) != 0 ] ; then
     imgSize=5;
@@ -28,18 +31,19 @@ echo; echo "Creating ${imgSize} MB disk image named ${imgName}"
 hdiutil create "${imgName}.dmg" -megabytes "${imgSize}" -layout NONE -quiet
 dev=`hdid -nomount "${imgName}.dmg" | grep '/dev/disk[0-9]*' | cut -d " " -f 1`
 /sbin/newfs_hfs -w -v "${imgName}" -b 4096 "${dev}" > /dev/null
-hdiutil eject "${dev}" -quiet
 
 # Mount the image and copy stuff
-dev=`hdid "${imgName}.dmg" | grep '/dev/disk[0-9]*' | cut -d " " -f 1`
+mkdir ./mountpoint
+mount -t hfs ${dev} ./mountpoint
 
 echo "Copying contents to ${imgName}:"
-while [ $# -gt 0 ] ; do
-    echo "  ${1}"
-    /Developer/Tools/CpMac -r "${1}" "/Volumes/${imgName}"
-    shift
+for i in ${dirName}/* ; do
+    echo "  ${i}"
+    /Developer/Tools/CpMac -r "${i}" ./mountpoint
 done
 
+umount ./mountpoint
+rmdir ./mountpoint
 hdiutil eject "${dev}" -quiet
 
 # Compress the image