File: source.unpack

package info (click to toggle)
apache 1.3.34-4.1%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 4,824 kB
  • ctags: 90
  • sloc: sh: 1,273; makefile: 686; perl: 215
file content (29 lines) | stat: -rw-r--r-- 760 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
. debian/scripts/vars
mkdir -p $STAMP_DIR/upstream/tarballs/ $SOURCE_DIR
for f in `find upstream/tarballs -maxdepth 1 -type f|sort`;do
	stampfile=$STAMP_DIR/upstream/tarballs/`basename $f`
	if [ ! -e $stampfile ];then
		case $f in
			*.gz|*.tgz|*.Z)	cmd=zcat;;
			*.bz)		cmd=bzcat;;
			*.bz2)		cmd=bz2cat;;
			*)		cmd=cat;;
		esac
		echo -n "Extracting upstream tarball $f"
		if $cmd $f|(cd ${SOURCE_DIR:-.};tar xvf -) >$stampfile.log;then
			if [ x$SOURCE_DIR = x ];then
				mkdir -p $STAMP_DIR/upstream/files/tarballs
				cp $stampfile.log $STAMP_DIR/upstream/files/tarballs/`basename $f`.list
			fi
			echo " successful."
			touch $stampfile
		else
			echo " failed!"
			exit 1
		fi
	else
		echo "upstream tarball $f already extracted!"
	fi
done