File: get-orig-source

package info (click to toggle)
dumpasn1 20150808-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 604 kB
  • ctags: 527
  • sloc: ansic: 7,387; xml: 162; makefile: 19; sh: 16
file content (20 lines) | stat: -rwxr-xr-x 696 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
#!/bin/sh

VER_FULL=`dpkg-parsechangelog | grep '^Version' | cut -d' ' -f2 | cut -f1 -d-`
DEBIAN_SRC_DIR=dumpasn1-${VER_FULL}
DEBIAN_SRC_TAR=dumpasn1_${VER_FULL}.orig.tar.gz

mkdir $DEBIAN_SRC_DIR
cd $DEBIAN_SRC_DIR
wget -c http://www.cs.auckland.ac.nz/~pgut001/dumpasn1.c
wget -c http://www.cs.auckland.ac.nz/~pgut001/dumpasn1.cfg
cd ..
VERSION_STRING=`grep "if you prefer it that way" $DEBIAN_SRC_DIR/dumpasn1.c`
VERSION=`echo $VERSION_STRING | sed -e 's/^.*\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\).*$/\1/'`
GZIP="--best --no-name" tar czf $DEBIAN_SRC_TAR $DEBIAN_SRC_DIR
rm -rf $DEBIAN_SRC_DIR

if [ "$VERSION" != "$VER_FULL" ]; then
  echo "$VERSION vs $VER_FULL"
  rm $DEBIAN_SRC_TAR
fi