File: get-orig-source

package info (click to toggle)
gmemusage 0.2-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 260 kB
  • sloc: ansic: 3,227; perl: 67; makefile: 59; sh: 22
file content (37 lines) | stat: -rwxr-xr-x 1,438 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
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
# get source for gmemusage from SVN because there is no source tarball distribution
#
# unfortunately this does not work:
# LC_ALL=C svn export https://svn.tliquest.net/viewvc/trunk/?root=Gmemusage
# svn: E170013: Unable to connect to a repository at URL 'https://svn.tliquest.net/viewvc/trunk/%3Froot=Gmemusage'
# svn: E175003: The server at 'https://svn.tliquest.net/viewvc/trunk/%3Froot=Gmemusage' does not support the HTTP/DAV protocol

set -e
NAME=`dpkg-parsechangelog | awk '/^Source/ { print $2 }'`

set -x

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

SVNURI="https://svn.tliquest.net/viewvc/trunk/?root=Gmemusage"
revision=`LANG=C svn info ${SVNURI} | grep "^Last Changed Rev:" | sed 's/Last Changed Rev: *//'`
VERSION=`echo ${VERSION}| sed "s/+[0-9]\+$//"`+${revision}

TARDIR=${NAME}-${VERSION}

mkdir -p ../tarballs
cd ../tarballs
# svn export conserves time stamps of the files, checkout does not
LC_ALL=C svn export ${SVNURI} ${TARDIR} >/dev/null 2>/dev/null

cd ${TARDIR}
tar --owner=root --group=root --mode=a+rX -caf "$NAME"_"$VERSION".orig.tar.xz "${TARDIR}"
rm -rf "${NAME}"-"$VERSION"