~ubuntu-branches/ubuntu/raring/wxwidgets2.8/raring

« back to all changes in this revision

Viewing changes to debian/repack.sh

  • Committer: Bazaar Package Importer
  • Author(s): Devid Antonio Filoni
  • Date: 2010-07-20 01:55:41 UTC
  • Revision ID: james.westby@ubuntu.com-20100720015541-f4j0v8g28tdvp9xj
Tags: 2.8.11.0-0ubuntu2
* Merge *some* changes from Debian package (version 2.8.10.1-3). This should
  make merges easier. Also fixes LP: #559822. Also merged several patches.
* Remove debian/patches/editra_pixmaps.dpatch patch, we don't ship editra
  anymore.
* Remove files which broke update-alternatives (LP: #379573).
* Switch to format 3.0 (quilt).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# Repackage upstream source to exclude non-distributable files
 
3
# should be called as "repack.sh --upstream-source <ver> <downloaded file>
 
4
# (for example, via uscan)
 
5
 
 
6
set -e
 
7
set -u
 
8
 
 
9
VER="$2"
 
10
FILE="$3"
 
11
PKG=`dpkg-parsechangelog|grep ^Source:|sed 's/^Source: //'`
 
12
 
 
13
REPACK_DIR="$PKG-$VER.orig" # DevRef § 6.7.8.2
 
14
 
 
15
echo -e "\nRepackaging $FILE\n"
 
16
 
 
17
DIR=`mktemp -d ./tmpRepackXXXXXX`
 
18
trap "rm -rf \"$DIR\"" QUIT INT EXIT
 
19
 
 
20
# Create an extra directory to cope with rootless tarballs
 
21
UP_BASE="$DIR/unpack"
 
22
mkdir "$UP_BASE"
 
23
tar xjf "$FILE" -C "$UP_BASE"
 
24
 
 
25
if [ `ls -1 "$UP_BASE" | wc -l` -eq 1 ]; then
 
26
        # Tarball does contain a root directory
 
27
        UP_BASE="$UP_BASE/`ls -1 "$UP_BASE"`"
 
28
fi
 
29
 
 
30
## Remove stuff
 
31
mv $UP_BASE/debian $UP_BASE/debian-upstream
 
32
## End
 
33
 
 
34
mv "$UP_BASE" "$DIR/$REPACK_DIR"
 
35
 
 
36
# Using a pipe hides tar errors!
 
37
tar cfC "$DIR/repacked.tar" "$DIR" "$REPACK_DIR"
 
38
gzip -9 < "$DIR/repacked.tar" > "$DIR/repacked.tar.gz"
 
39
 
 
40
FILE=$(echo $FILE | sed 's/bz2/gz/')
 
41
mv "$DIR/repacked.tar.gz" "$FILE"
 
42
 
 
43
echo "*** $FILE repackaged"