Get the package version using configure.in, not grep+sed. Make sure we
authorGerald Combs <gerald@wireshark.org>
Sun, 19 Aug 2012 00:49:55 +0000 (00:49 -0000)
committerGerald Combs <gerald@wireshark.org>
Sun, 19 Aug 2012 00:49:55 +0000 (00:49 -0000)
exit with an error in a few places where it would be useful.

svn path=/trunk/; revision=44572

configure.in
packaging/macosx/Makefile.am
packaging/macosx/osx-dmg.sh.in [moved from packaging/macosx/osx-dmg.sh with 95% similarity]

index 508a3c4c606b427e87df6bbcabbf1b395448752f..b3ddc3af3e2971fe38ea52db5cc3e6910df6a15d 100644 (file)
@@ -2141,6 +2141,7 @@ AC_OUTPUT(
   packaging/Makefile
   packaging/macosx/Info.plist
   packaging/macosx/Makefile
+  packaging/macosx/osx-dmg.sh
   packaging/nsis/Makefile
   packaging/rpm/Makefile
   packaging/rpm/SPECS/Makefile
index d01e60f6d3c0c1375953b076b40b2cd78e656c19..0475d4085a5c9fc2c9f4e9c16055f9c5fa22ec8c 100644 (file)
@@ -26,7 +26,7 @@ EXTRA_DIST = \
        native-gtk/config.h     \
        native-gtk/glibconfig.h \
        osx-app.sh      \
-       osx-dmg.sh      \
+       osx-dmg.sh.in   \
        Read_me_first.rtf       \
        Resources/bin/getdisplay.sh     \
        Resources/bin/wireshark \
similarity index 95%
rename from packaging/macosx/osx-dmg.sh
rename to packaging/macosx/osx-dmg.sh.in
index f37879e73225c5f3e9851e04ee36873c047fb4db..30971fceba2cf6fa58dcb312cbe1329c85138f3f 100755 (executable)
@@ -122,9 +122,9 @@ case `file $ws_bin` in
 esac
 
 # Set the version
-version=`grep '^AC_INIT' ../../configure.in | sed -e 's/.*, //' -e 's/)//'`
+version="@VERSION@"
 if [ -z "$version" ] ; then
-       echo "Cannot find VERSION in ../../configure.in"
+       echo "VERSION not set"
        exit 1
 fi
 
@@ -142,19 +142,19 @@ img_name="$pkg_title.dmg"
 
 # Create temp directory with desired contents of the release volume.
 rm -rf "$tmp_dir"
-mkdir "$tmp_dir"
+mkdir "$tmp_dir" || exit 1
 
 echo -e "Copying files to temp directory"
 # Wireshark itself
 # Copy Wireshark.app
-cp -rf "$pkg_file" "$tmp_dir"/
+cp -rf "$pkg_file" "$tmp_dir"/ || exit 1
 # Link to Applications in order to drag and drop wireshark onto it
 #ln -sf /Applications "$tmp_dir"/
 # Copy the utilites
 #cp -rf "$utilities" "$tmp_dir"/
 #ln -sf /Library/StartupItems "$tmp_dir/$utilities"/
 # Copy the readme
-cp -rf  Read_me_first.rtf "$tmp_dir"/"Read me first.rtf"
+cp -rf  Read_me_first.rtf "$tmp_dir"/"Read me first.rtf" || exit 1
 
 # If the appearance settings are not to be modified we just copy them
 if [ ${set_ds_store} = "false" ]; then
@@ -162,14 +162,14 @@ if [ ${set_ds_store} = "false" ]; then
        # window size, appearance, etc.  Most of this can be set
        # with Apple script but involves user intervention so we
        # just keep a copy of the correct settings and use that instead.
-       cp $ds_store_root "$tmp_dir/.DS_Store"
+       cp $ds_store_root "$tmp_dir/.DS_Store" || exit 1
        auto_open_opt=-noautoopen
 fi
 
 # Create a new RW image from the temp directory.
 echo -e "Creating a temporary disk image"
 rm -f "$rw_name"
-/usr/bin/hdiutil create -srcfolder "$tmp_dir" -volname "$volume_name" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW "$rw_name"
+/usr/bin/hdiutil create -srcfolder "$tmp_dir" -volname "$volume_name" -fs HFS+ -fsargs "-c c=64,a=16,e=16" -format UDRW "$rw_name" || exit 1
 
 # We're finished with the temp directory, remove it.
 rm -rf "$tmp_dir"
@@ -224,7 +224,7 @@ if [ -e "$img_name" ]; then
        echo "$img_name already exists."
        rm -i "$img_name"
 fi
-/usr/bin/hdiutil convert "$rw_name" -format UDZO -imagekey zlib-level=9 -o "$img_name"
+/usr/bin/hdiutil convert "$rw_name" -format UDZO -imagekey zlib-level=9 -o "$img_name" || exit 1
 rm -f "$rw_name"
 
 exit 0