aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/linux_tools/package-client.sh
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/linux_tools/package-client.sh')
-rwxr-xr-xlinden/indra/newview/linux_tools/package-client.sh126
1 files changed, 126 insertions, 0 deletions
diff --git a/linden/indra/newview/linux_tools/package-client.sh b/linden/indra/newview/linux_tools/package-client.sh
new file mode 100755
index 0000000..1446e78
--- /dev/null
+++ b/linden/indra/newview/linux_tools/package-client.sh
@@ -0,0 +1,126 @@
1#!/bin/sh
2MANIFEST=$1
3PACKAGE_NAME=$2
4GRID=$3
5
6# Check that the entire client manifest is there.
7cd newview
8echo Checking manifest...
9
10# Strip out comment lines and empty lines
11# Replace anything with a source,dest pairs with just source filename
12if ! ls -d `cat "$MANIFEST" | \
13 grep -v ^# | grep -v ^$ | \
14 sed 's/,.*//'` 1>/dev/null
15then
16 echo Client manifest defined in newview/$MANIFEST is not complete.
17 exit 1
18fi
19echo "Done."
20
21# See if the package already exists.
22BUILD_PACKAGE=YES
23if [ -a $PACKAGE_NAME ]
24then
25 echo The directory "newview/$PACKAGE_NAME" already exists.
26 echo Checking for complete client manifest...
27
28 cd $PACKAGE_NAME
29
30 # Strip out comment lines and empty lines
31 # Replace source,dest pairs with just dest filename
32 if ls -d `cat "../$MANIFEST" | \
33 grep -v ^# | grep -v ^$ | \
34 sed 's/.*,\(.*\)/\1/'` 1>/dev/null
35 then
36 echo "Done."
37 echo Package at "newview/$PACKAGE_NAME" looks complete.
38 cd ..
39 BUILD_PACKAGE=NO
40 else
41 echo Incomplete package at "newview/$PACKAGE_NAME"!
42 echo Removing corrupt package...
43 cd ..
44 rm -rf $PACKAGE_NAME
45 echo Done.
46 fi
47fi
48
49echo Building newview/$PACKAGE_NAME directory...
50## First read all directories mentioned in the manifest, and create a package skeleton.
51
52# Strip out comment lines and empty lines
53# Replace source,dest pairs with just dest filename
54# Strip out and line that does not include a directory in its path (ie contains a '/')
55# Extract everything up to the last '/' and prefix with $PACKAGE_NAME
56# Print out just the unique directores, and make them.
57mkdir -p `cat $MANIFEST | \
58 grep -v ^# | \
59 grep -v ^$ | \
60 sed 's/.*,\(.*\)/\1/' | \
61 grep \/ | \
62 sed "s/\(^.*\)\/[^\/]*/$PACKAGE_NAME\/\1/" | \
63 sort | uniq`
64
65## Copy the manifest.
66
67# Strip out comment lines and empty lines
68# Strip out empty directories
69# Replace any line without a ',' with 'line,line'
70for pair in `cat $MANIFEST | \
71 grep -v ^# | \
72 grep -v ^$ | \
73 grep -v \/$ | \
74 sed 's/\(^[^,]*$\)/\1,\1/' `
75do
76 # $pair is 'source,dest' ... split it up
77 SOURCE=`echo "$pair" | awk -F, '{ print $1; }'`
78 DEST=`echo "$pair" | awk -F, '{ print $2; }'`
79 # If this is a wildcard copy (pair contains a '*'), then remove the wildcard from $DEST
80 # and make the copy recursive
81 RECURSE=""
82 if [ ! x == x`echo "$SOURCE" | grep \*$` ]
83 then
84 DEST=`echo "$DEST" | sed 's/\*$//'`
85 RECURSE="-R"
86 fi
87 # The -a makes us copy links as links, plus timestamps etc.
88 cp -a $RECURSE $SOURCE "$PACKAGE_NAME/$DEST"
89done
90
91echo Done.
92
93## Clean up any CVS directories that might have been recursively included.
94echo Pruning CVS directories from newview/$PACKAGE_NAME directory...
95find $PACKAGE_NAME -type d -name CVS -exec rm -rf {} \; 2>/dev/null
96echo "Done removing CVS directories."
97
98## Clean up any SVN directories that might have been recursively included.
99echo Pruning .svn directories from newview/$PACKAGE_NAME directory...
100find $PACKAGE_NAME -type d -name \.svn -exec rm -rf {} \; 2>/dev/null
101echo "Done removing .svn directories."
102
103# Create an appropriate gridargs.dat for this package, denoting required grid.
104if [ X$GRID == X'default' ]
105then
106 echo 'Default grid - creating empty gridargs.dat'
107 echo " " > $PACKAGE_NAME/gridargs.dat
108else
109 echo "Creating gridargs.dat for package, grid $GRID"
110 echo "--${GRID} -helperuri http://preview-${GRID}.secondlife.com/helpers/" > $PACKAGE_NAME/gridargs.dat
111fi
112
113TARBALL=$PACKAGE_NAME.tar.bz2
114
115# See if the tarball already exists.
116if [ -a $TARBALL ]
117then
118 echo Tarball "newview/$TARBALL" already exists. Skipping tarball creation.
119 exit 0
120fi
121
122echo Creating tarball "newview/$TARBALL"...
123# --numeric-owner hides the username of the builder for security etc.
124tar --numeric-owner -cjf $TARBALL $PACKAGE_NAME
125echo Done.
126