File: source.unpack

package info (click to toggle)
openldap-guide 19991007-3
  • links: PTS
  • area: main
  • in suites: potato
  • size: 128 kB
  • ctags: 13
  • sloc: makefile: 127; sh: 114; perl: 63
file content (30 lines) | stat: -rw-r--r-- 820 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
30
#!/bin/sh
. debian/scripts/vars
mkdir -p $STAMP_DIR/upstream/tarballs/ $SOURCE_DIR
for f in `find . -type f -maxdepth 1 -name \*.tgz -o -name \*.tar.gz -o -name \*.tar.bz \
    -o -name \*.tar.bz2|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=bzcat;;
			*)		cmd=cat;;
		esac
		echo -n "Extracting upstream tarball $f"
		if $cmd $f | (cd ${SOURCE_DIR:-.};tar xv) > $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