Saner dmg code organization.

"dmg" is now the layout-enabled usual DMGs, since they will soon have
more functionality around them (signed applications).  "sdmg" is for the
simple (or "source") DMGs, which are just plain containers for a
directory.  Also use a flag to avoid the stupid dynamic scope hack.
(cherry picked from commit c8615a37b1)
This commit is contained in:
Eli Barzilay 2013-01-13 02:12:02 -05:00 committed by Ryan Culpepper
parent bcb7aae7c8
commit 64e388b181

View File

@ -323,13 +323,13 @@ platforms_of_dist_type() {
installer_of_dist_type_platform() { # input: dtype-dplatform installer_of_dist_type_platform() { # input: dtype-dplatform
case "$1" in case "$1" in
( "src-unix" ) echo "tgz" ;; ( "src-unix" ) echo "tgz" ;;
( "src-mac" ) echo "dmg" ;; ( "src-mac" ) echo "sdmg" ;;
( "src-win" ) echo "zip" ;; ( "src-win" ) echo "zip" ;;
( "bin-"*"-linux"* ) echo "sh" ;; ( "bin-"*"-linux"* ) echo "sh" ;;
( "bin-"*"-freebsd" ) echo "sh" ;; ( "bin-"*"-freebsd" ) echo "sh" ;;
( "bin-"*"-solaris" ) echo "sh" ;; ( "bin-"*"-solaris" ) echo "sh" ;;
( "bin-"*"-darwin" ) echo "sh" ;; ( "bin-"*"-darwin" ) echo "sh" ;;
( "bin-"*"-osx-mac" ) echo "ldmg" ;; ( "bin-"*"-osx-mac" ) echo "dmg" ;;
( "bin-"*"-win32" ) echo "exe" ;; ( "bin-"*"-win32" ) echo "exe" ;;
( * ) exit_error "Unknown dist type+platform for" \ ( * ) exit_error "Unknown dist type+platform for" \
"installer_of_dist_type_platform: \"$1\"" ;; "installer_of_dist_type_platform: \"$1\"" ;;
@ -339,9 +339,9 @@ explanation_of_installer_type() {
case "$1" in case "$1" in
( "tgz" ) echo "Unpack this file using" \ ( "tgz" ) echo "Unpack this file using" \
"\"gunzip <file> | tar xvf -\"." ;; "\"gunzip <file> | tar xvf -\"." ;;
( "sdmg" ) echo "Mount this disk image and copy the Racket source folder" \
"to your disk." ;;
( "dmg" ) echo "Mount this disk image and copy the Racket folder to" \ ( "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." ;; "the Applications folder on your disk." ;;
( "zip" ) echo "Use unzip to extract the Racket folder to your disk." ;; ( "zip" ) echo "Use unzip to extract the Racket folder to your disk." ;;
( "sh" ) echo "Execute this file with \"sh <file>\"," \ ( "sh" ) echo "Execute this file with \"sh <file>\"," \
@ -1809,26 +1809,25 @@ do_tgz_to_dmg() {
_cd "$savedpwd" _cd "$savedpwd"
_rm "$tmpdir/tgz-to-dmg-$$" _rm "$tmpdir/tgz-to-dmg-$$"
} }
do_layout_bg="-"
tgz_to_dmg() { tgz_to_dmg() {
local simpledmg="no"
if [[ "x$1" = "x--simpledmg" ]]; then shift; simpledmg="yes"; fi
local srctgz="$1" tgt="$2" pname="$3" ptype="$4" srcplatform="$5"; shift 5 local srctgz="$1" tgt="$2" pname="$3" ptype="$4" srcplatform="$5"; shift 5
local tmptgz="$tmpdir/tgz2dmg.tgz" local tmptgz="$tmpdir/tgz2dmg.tgz"
local tmpdmg="$tmpdir/tgz2dmg.dmg" local tmpdmg="$tmpdir/tgz2dmg.dmg"
local tmpbg="-"
_scp "$srctgz" "${dmgmachine}:$tmptgz" _scp "$srctgz" "${dmgmachine}:$tmptgz"
if [[ "x$do_layout_bg" != "x-" ]]; then local tmpbg="-"
_scp "$do_layout_bg" "${dmgmachine}:$tmpbg" if [[ "$simpledmg" = "no" ]]; then
tmpbg="$tmpdir/bg.png" tmpbg="$tmpdir/bg.png"
_scp "$PLTHOME/$dmgbackground" "${dmgmachine}:$tmpbg"
fi fi
run_part "$dmgmachine" "do_tgz_to_dmg" \ run_part "$dmgmachine" "do_tgz_to_dmg" \
"$tmptgz" "$tmpdmg" "$tmpbg" \ "$tmptgz" "$tmpdmg" "$tmpbg" \
"$version" "$pname" "$ptype" "$srcplatform" "$version" "$pname" "$ptype" "$srcplatform"
_scp "${dmgmachine}:$tmpdmg" "$tgt.dmg" _scp "${dmgmachine}:$tmpdmg" "$tgt.dmg"
} }
tgz_to_ldmg() { tgz_to_sdmg() {
do_layout_bg="$PLTHOME/$dmgbackground" tgz_to_dmg --simpledmg "$@"
tgz_to_dmg "$@"
do_layout_bg="-"
} }
#---------------------------------------- #----------------------------------------
do_tgz_to_exe() { do_tgz_to_exe() {