/[pkg-subversion]/trunk/svn-export
ViewVC logotype

Contents of /trunk/svn-export

Parent Directory Parent Directory | Revision Log Revision Log


Revision 376 - (hide annotations) (download)
Fri Sep 9 17:23:02 2005 UTC (7 years, 8 months ago) by peters-guest
Original Path: branches/unpacked-tar/svn-export
File size: 1595 byte(s)
No real need for the extra subdir {destdir}/svn-exported, since we're
already checking to see that the destination dir does not exist.
So now just unpack directly into {destdir}.

Also, remove this script from the exported directory.  We don't want
svn-export to end up in the package diff.gz!
1 peters-guest 375 #!/bin/sh -e
2 peters-guest 373 #
3     # svn-export-this: 'svn export' this tree and unpack the tarball so the
4     # package can be built.
5     #
6 peters-guest 376 # Requires a destination dir on the command line. Creates and
7     # populates this dir, where the actual dpkg-buildpackage can be run.
8 peters-guest 373
9     usage () {
10     exec >&2
11     echo "usage: ./$(basename $0) {destdir}"
12     echo ""
13 peters-guest 376 echo "Unpacks the package source into {destdir}"
14 peters-guest 373 echo "where you can run 'dpkg-buildpackage' or 'debuild'."
15     exit 1
16     }
17    
18     # must run this from the directory the script is in
19     if [ "$(dirname "$0")" != '.' ] ||
20     [ -z "$1" ]; then
21     usage
22     fi
23 peters-guest 376 destdir=$1;
24 peters-guest 375 case "$destdir" in
25 peters-guest 374 /* | ../*) ;;
26     *) echo >&2 "$0: export directory must be outside current directory"
27 peters-guest 375 exit 1
28 peters-guest 374 esac
29 peters-guest 375 if [ -d "$destdir" ]; then
30     echo >&2 "$0: export directory $destdir already exists"
31     exit 1
32     fi
33 peters-guest 373
34     chglog=$(dpkg-parsechangelog)
35    
36     pkg=$(echo "$chglog" | awk '/^Source: /{print $2}')
37     ver=$(echo "$chglog" | awk '/^Version: /{print $2}')
38     ver_upstream=${ver%-*}
39     tar_upstream_pattern=${pkg}_${ver_upstream}.orig.tar.*
40     tar_upstream=$(ls $tar_upstream_pattern)
41    
42     if [ ! -f "$tar_upstream" ]; then
43     echo >&2 "cannot find upstream tarball $tar_upstream_pattern"
44     exit 1
45     fi
46    
47 peters-guest 375 mkdir -p "$destdir"
48     svn export --force . "$destdir"
49     cd "$destdir"
50 peters-guest 376 for f in *; do
51     case "$f" in
52     debian | $tar_upstream) ;;
53     *) rm "$f" ;;
54     esac
55     done
56 peters-guest 373 case $tar_upstream in
57     *.gz) z=z ;;
58     *.bz2) z=j ;;
59     *) echo >&2 "unrecognised tar format, $tar_upstream"; exit 1 ;;
60     esac
61     tar x${z}f $tar_upstream --strip-components=1
62 peters-guest 374 mv $tar_upstream ../
63 peters-guest 373 echo "----------------------------------------------------------------------"
64 peters-guest 375 echo "exported to $destdir"

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5