File: get-orig-source.sh

package info (click to toggle)
s3d 0.2.2-16
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 6,660 kB
  • sloc: ansic: 20,869; python: 488; perl: 98; makefile: 34; sh: 29
file content (21 lines) | stat: -rwxr-xr-x 580 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /bin/sh
set -e

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

# try to download source package
if [ "$1" != "snapshot" ]; then
	uscan --verbose --force-download
else
	TMP="`mktemp -t -d`"
	git clone --bare "git://git.code.sf.net/p/${DIR}/code" "${TMP}"
	REV="$(git --git-dir "${TMP}" describe --long master | sed -e 's/^v*//' -e 's/-/+/g')"
	LONGREV="$(git --git-dir "${TMP}" rev-parse master)"
	TARNAME="${DIR}_${REV}.orig.tar"
	echo "${LONGREV}"
	git --git-dir "${TMP}" archive --format=tar --prefix="${DIR}-${REV}/" master -o "${TARNAME}"
	gzip -n -f "${TARNAME}"
	rm -rf "${TMP}"
fi