File: get-orig-source

package info (click to toggle)
vcftools 0.1.9-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,396 kB
  • sloc: perl: 10,233; cpp: 7,950; pascal: 751; makefile: 60; php: 43; sh: 12
file content (25 lines) | stat: -rwxr-xr-x 771 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
#/bin/bash

#set -x
PKG=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`
if ! echo $@ | grep -q upstream-version ; then
    DVERSION=`dpkg-parsechangelog | awk '/^Version:/ { print $2 }' | cut -d- -f1`
else
    DVERSION=`echo $@ | sed "s?^.*--upstream-version \([0-9.]\+\) .*${PKG}.*?\1?"`
    if echo "$DVERSION" | grep -q "upstream-version" ; then
        echo "Unable to parse version number"
        exit
    fi
fi

cd ../tarballs
tar -xzf ${PKG}_${DVERSION}.tar.gz
cd ${PKG}_${DVERSION}
find . -name CVS -type d | xargs rm -rf
find . -name '.svn' -type d | xargs rm -rf 
find . -name "*.pdf" | xargs rm -f
cd ..

GZIP="--best --no-name" tar --owner=root --group=root --mode=a+rX -czf "$PKG"_"$DVERSION".orig.tar.gz ${PKG}_${DVERSION}
rm -rf  ${PKG}_${DVERSION}