File: repack-upstream.sh

package info (click to toggle)
w-scan 20170107-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,684 kB
  • sloc: ansic: 12,756; sh: 1,051; xml: 33; makefile: 17
file content (36 lines) | stat: -rw-r--r-- 748 bytes parent folder | download | duplicates (6)
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
#
# This script will be called by uscan and will remove the precompiled
# binary from the upstream tarball
#

# Parse parameters passed by uscan;
while [ $# -ge 1 ]; do
    case $1 in
      --upstream-version)
          shift
          UPSTREAM_VERSION="$1"
          ;;
      --)
          shift
          ;;
      *)
          TARBALL="$1"
          ;;
    esac
    shift
done

echo "Extracting tarball..."
tar -xjf "$TARBALL"

echo "Stripping precompiled binary..."
rm w_scan-$UPSTREAM_VERSION/w_scan

echo "Fixing file modes..."
chmod a-x w_scan-$UPSTREAM_VERSION/doc/*

echo "Repacking tarball..."
tar -czf "`dirname $TARBALL`/w-scan_$UPSTREAM_VERSION.orig.tar.gz" "w_scan-$UPSTREAM_VERSION"

echo "Cleanup..."
rm -rf w_scan-$UPSTREAM_VERSION