~ubuntu-branches/ubuntu/precise/openarena/precise

« back to all changes in this revision

Viewing changes to code/unix/MacSupport/SLA-dmg.sh

  • Committer: Bazaar Package Importer
  • Author(s): Bruno "Fuddl" Kleinert
  • Date: 2007-01-20 12:28:09 UTC
  • Revision ID: james.westby@ubuntu.com-20070120122809-2yza5ojt7nqiyiam
Tags: upstream-0.6.0
ImportĀ upstreamĀ versionĀ 0.6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# This script appends a SLA.r (Software License Agreement) resource to a .dmg
 
4
#
 
5
# usage is './SLA-dmg.sh SLA.r /path/to/ioquake3.dmg'
 
6
#
 
7
 
 
8
if [ "x$1" = "x" ] || [ "x$2" = "x"]; then
 
9
        echo "usage: ./SLA-dmg.sh SLAFILE DMGFILE"
 
10
        exit 1;
 
11
fi
 
12
 
 
13
if [ ! -r $1 ]; then
 
14
        echo "$1 is not a readable .r file"
 
15
        exit 1;
 
16
fi
 
17
if [ ! -w $2 ]; then
 
18
        echo "$2 is not writable .dmg file"
 
19
        exit 1;
 
20
fi
 
21
 
 
22
hdiutil convert -format UDCO -o tmp.dmg $2 || exit 1
 
23
hdiutil unflatten tmp.dmg || exit 1
 
24
/Developer/Tools/Rez /Developer/Headers/FlatCarbon/*.r $1 -a -o tmp.dmg \
 
25
        || exit 1
 
26
hdiutil flatten tmp.dmg || exit 1
 
27
hdiutil internet-enable -yes tmp.dmg || exit 1
 
28
mv tmp.dmg $2 || (echo "Could not copy tmp.dmg to $2" && exit 1)
 
29
rm tmp.dmg
 
30
echo "SLA $1 successfully added to $2"