File: get-orig-source.sh

package info (click to toggle)
exactimage 1.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,040 kB
  • sloc: cpp: 35,940; ansic: 1,952; xml: 1,447; makefile: 338; perl: 138; sh: 110; python: 45; php: 37; ruby: 12
file content (28 lines) | stat: -rwxr-xr-x 862 bytes parent folder | download | duplicates (5)
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
#! /bin/sh
set -e

if [ -z "$DIR" ]; then
	DIR=exactimage
fi

# try to download source package
if [ "$1" != "snapshot" ]; then
	uscan --verbose --force-download
else
	umask 000
	TMP="`mktemp -t -d`"
	MANIFEST="`mktemp -t`"
	R="$(svn info "https://svn.exactcode.de/exact-image/trunk"|grep '^Revision'| sed 's/^Revision: //')"
	VERSION=$(dpkg-parsechangelog | sed -ne 's/^Version: \(\([0-9]\+\):\)\?\(.*\)-.*/\3/p' | sed -e 's/[\+~]svn.*$//')
	REV="${VERSION}+svn${R}"
	svn export -r"${R}" "https://svn.exactcode.de/exact-image/trunk" "${TMP}/${DIR}-${REV}/"
	TARNAME="${DIR}_${REV}.orig.tar"
	(
		cd "${TMP}"
		find "${DIR}-${REV}/" -type f |sed 's/^\.*\/*//'|sort > "$MANIFEST"
		tar cf "${TARNAME}" --owner 0 --group 0 --numeric-owner --no-recursion --files-from "$MANIFEST"
	)
	mv "${TMP}/${TARNAME}" .
	gzip -n -f "${TARNAME}"
	rm -rf "${TMP}" "$MANIFEST"
fi