File: source.unpack

package info (click to toggle)
apache2 2.0.54-5sarge2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,260 kB
  • ctags: 176
  • sloc: sh: 533; makefile: 367; python: 209; perl: 127
file content (38 lines) | stat: -rw-r--r-- 1,115 bytes parent folder | download
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
#!/bin/bash
. debian/scripts/vars
mkdir -p $STAMP_DIR/upstream/tarballs/ $SOURCE_DIR
AP2_VERSION=`dpkg-parsechangelog | sed -n 's/^Version: //p;' | sed -e 's/-.*//;'`
for f in `find upstream/tarballs -type f -maxdepth 1|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 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
                        if [ ! -L $SOURCE_DIR/apache2 ]; then
			        if [ -d httpd-2.0 ]; then 
				        ln -s httpd-2.0 $SOURCE_DIR/apache2 ;
        			else 
	        			ln -s httpd-$AP2_VERSION $SOURCE_DIR/apache2;
		        	fi;
                        fi
				
			echo " successful."
			touch $stampfile
		else
			echo " failed!"
			exit 1
		fi
	else
		echo "upstream tarball $f already extracted!"
	fi
done