forked from darlinghq/darling-cups
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakedarwinup
executable file
·119 lines (105 loc) · 3.27 KB
/
makedarwinup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/sh
#
# Script to make a CUPS root compatible with the darwinup command. Standard
# instructions for people getting these roots are:
#
# sudo darwinup install ~/Desktop/cups-LABEL
# sudo killall cupsd
# cupsctl --debug-logging
#
# Usage:
#
# makedarwinup [-build build] [-project project] [-train train] radar-number-or-label
#
build=""
train=""
label=""
project="cups"
buildall="-buildAllAliases"
while test $# -gt 0; do
opt="$1"
shift
case "$opt" in
-build)
build="$1"
shift
;;
-project)
project="$1"
if test $project != cups; then
buildall="-noBuildAllAliases"
fi
shift
;;
-train)
train="$1"
shift
;;
-*)
echo "Usage: makedarwinup [-build build] [-project project] [-train name] radar-number-or-label"
exit 1
;;
*)
label="$opt"
;;
esac
done
if test "x$label" = x; then
echo "Usage: makedarwinup [-build build] [-project project] [-train name] radar-number-or-label"
exit 1
fi
if test "x$train" = x; then
case $project in
cups_ios*)
if test "x$build" = x; then
build=`xcodebuild -sdk iphoneos -version ProductBuildVersion`
fi
train=`xbs getTrainForBuild --embedded $build --quiet`
;;
*)
if test "x$build" = x; then
build=`xcodebuild -sdk macosx -version ProductBuildVersion`
fi
train=`xbs getTrainForBuild $build --quiet`
;;
esac
fi
# See whether we are running at Apple or remotely...
address="`ifconfig en0 | grep 'inet 17.' | awk '{print $2}'`"
if test "x$address" = x; then
tprefix="Stashed"
else
tprefix="Prevailing"
fi
echo Building $project for $train...
echo sudo xbs buildit -update $tprefix$train -project $project -useSharedSDKContentRoot -sharedSDKContentRoot /private/tmp/printing.$train -archive -archiveName $project-$label -archiveOutputDir ~/Desktop -dsymsInDstroot $buildall -noverify -codesign .
sudo xbs buildit -update $tprefix$train -project $project -useSharedSDKContentRoot -sharedSDKContentRoot /private/tmp/printing.$train -archive -archiveName $project-$label -archiveOutputDir ~/Desktop -dsymsInDstroot $buildall -noverify -codesign .
if test $? = 0; then
say "Darwin up build successful."
else
say "Darwin up build failed."
exit 1
fi
if test $project = cups; then
rm -f ~/Desktop/Shared_$project-${label}_HDRDSTROOT_*.tar.gz
mv -f ~/Desktop/Shared_$project-${label}_SDKContentRoot_*.tar.gz ~/Desktop/$project-sdk-$label.tar.gz
mv -f ~/Desktop/Shared_$project-${label}_DSTROOT_*.tar.gz ~/Desktop/$project-$label.tar.gz
else
rm -f ~/Desktop/$project-${label}_APIDSTROOT*.tar.gz
mv -f ~/Desktop/$project-${label}_SDKContentRoot*.tar.gz ~/Desktop/$project-sdk-$label.tar.gz
mv -f ~/Desktop/$project-${label}_DSTROOT*.tar.gz ~/Desktop/$project-$label.tar.gz
fi
echo "Send ~/Desktop/$project-$label.tar.gz to tester."
if test $project = cups; then
echo ""
echo "Use the following commands to install the root:"
echo ""
echo " sudo darwinup install ~/Desktop/$project-$label.tar.gz"
echo " sudo killall cupsd"
echo " cupsctl --debug-logging"
echo ""
echo "Use the following commands to remove the root:"
echo ""
echo " sudo darwinup uninstall $project-$label.tar.gz"
echo " sudo killall cupsd"
fi