File: package.sh

package info (click to toggle)
grok 1.20110708.1-4.3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,460 kB
  • sloc: ansic: 3,469; ruby: 987; makefile: 276; sh: 124; yacc: 106
file content (31 lines) | stat: -rw-r--r-- 654 bytes parent folder | download | duplicates (5)
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
#!/bin/sh

if [ $# -ne 1 ] ; then 
  set -- $(date "+%Y%m%d")
  echo "No version specified, using $1"
fi

if [ -z "$PACKAGE" ] ; then
  echo "Must specify package name in environment."
  echo "PACKAGE= ???"
  exit 1
fi

if [ ! -f "FILES" ] ; then
  echo "Missing FILES file which should contain the list of things to put in this package"
  exit 1
fi

TMP="/tmp"
PACKAGE="$PACKAGE-$1"
DIR="${TMP}/${PACKAGE}"
rm -rf "$DIR"
mkdir "$DIR"
rsync -rvt --filter '. FILES' . "$DIR"

# gnu tar sucks, tar -C /tmp doesn't actually change directories for tar
# creation?
find $DIR -name '*.o' -delete
tar -C /tmp/ -zcf "${PACKAGE}.tar.gz" "$PACKAGE"
rm -rf "$DIR"