From 72ea99a29a4a8ed5772767c9ca6fbe54d6efcbfd Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sat, 12 Jan 2013 04:11:32 -0500 Subject: [PATCH] Make only binary distributions use laid-out DMGs. This is done by adding an "ldmg" type for laid-out DMGs, and "dmg" produces a plain container image as before. (cherry picked from commit a2207e6f33ad2e388554e7879fe096253a7e9678) --- collects/meta/build/build | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/collects/meta/build/build b/collects/meta/build/build index 5117deabbe..39fc707663 100755 --- a/collects/meta/build/build +++ b/collects/meta/build/build @@ -322,15 +322,15 @@ platforms_of_dist_type() { } installer_of_dist_type_platform() { # input: dtype-dplatform case "$1" in - ( "src-unix" ) echo "tgz" ;; - ( "src-mac" ) echo "dmg" ;; - ( "src-win" ) echo "zip" ;; - ( "bin-"*"-linux"* ) echo "sh" ;; - ( "bin-"*"-freebsd" ) echo "sh" ;; - ( "bin-"*"-solaris" ) echo "sh" ;; - ( "bin-"*"-darwin" ) echo "sh" ;; - ( "bin-"*"-osx-mac" ) echo "dmg" ;; - ( "bin-"*"-win32" ) echo "exe" ;; + ( "src-unix" ) echo "tgz" ;; + ( "src-mac" ) echo "dmg" ;; + ( "src-win" ) echo "zip" ;; + ( "bin-"*"-linux"* ) echo "sh" ;; + ( "bin-"*"-freebsd" ) echo "sh" ;; + ( "bin-"*"-solaris" ) echo "sh" ;; + ( "bin-"*"-darwin" ) echo "sh" ;; + ( "bin-"*"-osx-mac" ) echo "ldmg" ;; + ( "bin-"*"-win32" ) echo "exe" ;; ( * ) exit_error "Unknown dist type+platform for" \ "installer_of_dist_type_platform: \"$1\"" ;; esac @@ -341,6 +341,8 @@ explanation_of_installer_type() { "\"gunzip | tar xvf -\"." ;; ( "dmg" ) echo "Mount this disk image and copy the Racket folder to" \ "your disk." ;; + ( "ldmg" ) echo "Mount this disk image and copy the Racket folder to" \ + "the Applications folder on your disk." ;; ( "zip" ) echo "Use unzip to extract the Racket folder to your disk." ;; ( "sh" ) echo "Execute this file with \"sh \"," \ "and follow the instructions." ;; @@ -1721,7 +1723,7 @@ make_dmg() { # inputs: dir, dmg, bg-image local src="$(basename "$srcdir")" local myself="$(id -nu):$(id -ng)" show "Making \"$tgtdmg\" from \"$srcdir\"" - _cp "$tmpbg" "$srcdir" + if [[ "x$tmpbg" != "x-" ]]; then _cp "$tmpbg" "$srcdir"; fi _cd "$(dirname "$srcdir")" _run sudo rm -f "$tgtdmg" "$tmpdmg" # It should be possible to create dmgs normally, but they'd be created with @@ -1739,7 +1741,9 @@ make_dmg() { # inputs: dir, dmg, bg-image # [2] remove the source tree _run sudo rm -rf "$src" # [3] do the expected dmg layout (see below) - easy_dmg_layout "$tmpdmg" "$src" "$(basename "$tmpbg")" + if [[ "x$tmpbg" != "x-" ]]; then + easy_dmg_layout "$tmpdmg" "$src" "$(basename "$tmpbg")" + fi # [4] create the compressed image from the uncompressed image _run sudo hdiutil convert -format UDZO -imagekey zlib-level=9 -ov \ "$tmpdmg" -o "$tgtdmg" @@ -1805,18 +1809,27 @@ do_tgz_to_dmg() { _cd "$savedpwd" _rm "$tmpdir/tgz-to-dmg-$$" } +do_layout_bg="-" tgz_to_dmg() { local srctgz="$1" tgt="$2" pname="$3" ptype="$4" srcplatform="$5"; shift 5 local tmptgz="$tmpdir/tgz2dmg.tgz" local tmpdmg="$tmpdir/tgz2dmg.dmg" - local tmpbg="$tmpdir/bg.png" + local tmpbg="-" _scp "$srctgz" "${dmgmachine}:$tmptgz" - _scp "$PLTHOME/$dmgbackground" "${dmgmachine}:$tmpbg" + if [[ "x$do_layout_bg" != "x-" ]]; then + _scp "$do_layout_bg" "${dmgmachine}:$tmpbg" + tmpbg="$tmpdir/bg.png" + fi run_part "$dmgmachine" "do_tgz_to_dmg" \ "$tmptgz" "$tmpdmg" "$tmpbg" \ "$version" "$pname" "$ptype" "$srcplatform" _scp "${dmgmachine}:$tmpdmg" "$tgt.dmg" } +tgz_to_ldmg() { + do_layout_bg="$PLTHOME/$dmgbackground" + tgz_to_dmg "$@" + do_layout_bg="-" +} #---------------------------------------- do_tgz_to_exe() { local tmptgz="$1" tmpexe="$2" nsistgz="$3"