/[pkg-subversion]/src/karmic/svn-export
ViewVC logotype

Contents of /src/karmic/svn-export

Parent Directory Parent Directory | Revision Log Revision Log


Revision 994 - (show annotations) (download)
Wed May 6 13:21:30 2009 UTC (4 years, 1 month ago) by mdiers-guest
File size: 1532 byte(s)
Branch to collect Ubuntu karmic releases.
Starting out with subversion_1.5.4dfsg1-1ubuntu2 as per jaunty.
1 #!/bin/sh -e
2 #
3 # svn-export-this: 'svn export' this tree and unpack the tarball so the
4 # package can be built.
5 #
6 # Requires a destination dir on the command line. Creates and
7 # populates this dir, where the actual dpkg-buildpackage can be run.
8
9 usage () {
10 exec >&2
11 echo "usage: ./$(basename $0) [-k] {destdir}"
12 echo ""
13 echo "Unpacks the package source into {destdir}"
14 echo "where you can run 'dpkg-buildpackage' or 'debuild'."
15 echo " -k Keep .svn/ in {destdir}/debian/"
16 exit 1
17 }
18
19 if [ "$1" = "-k" ]; then
20 keep=1
21 shift
22 fi
23
24 # must run this from the directory the script is in
25 if [ "$(dirname "$0")" != '.' ] ||
26 [ -z "$1" ]; then
27 usage
28 fi
29
30 chglog=$(dpkg-parsechangelog)
31
32 pkg=$(echo "$chglog" | awk '/^Source: /{print $2}')
33 ver=$(echo "$chglog" | awk '/^Version: /{print $2}')
34 ver_upstream=${ver%-*}
35 tar_upstream_pattern=${pkg}_${ver_upstream}.orig.tar.*
36
37 for f in $tar_upstream_pattern; do
38 case $f in
39 *.gz) tar_upstream=$f; tar_z=z ;;
40 *.bz2) tar_upstream=$f; tar_z=j ;;
41 *) ;;
42 esac
43 done
44
45 destdir=$1/$pkg-$ver_upstream;
46
47 if [ -d "$destdir" ]; then
48 echo >&2 "$0: export directory $destdir already exists"
49 exit 1
50 fi
51
52 if [ ! -f "$tar_upstream" ]; then
53 echo >&2 "cannot find upstream tarball $tar_upstream_pattern"
54 exit 1
55 fi
56
57 mkdir -p "$destdir"
58 svn export --force $tar_upstream "$destdir/../$tar_upstream"
59 if [ -n "$keep" ]; then
60 cp -a debian "$destdir/debian"
61 else
62 svn export --force debian "$destdir/debian"
63 fi
64 cd "$destdir"
65 tar x${tar_z}f ../$tar_upstream --strip-components=1
66 echo "exported to $destdir"

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5