File: get-orig-source.sh

package info (click to toggle)
mupen64plus-rsp-z64 2.5.9-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 392 kB
  • sloc: cpp: 4,957; makefile: 270; sh: 21
file content (25 lines) | stat: -rwxr-xr-x 698 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
#! /bin/sh
set -e

if [ -z "$DIR" ]; then
	DIR=mupen64plus-rsp-z64
fi
if [ -z "$OWNER" ]; then
	OWNER=mupen64plus
fi

# try to download source package
if [ "$1" != "snapshot" ]; then
	uscan --verbose --force-download
else
	MODULE=$(echo "${OWNER}/${DIR}" | sed 's/^\/*//')
	TMP="`mktemp -t -d`"
	git clone --bare "https://github.com/${MODULE}.git" "${TMP}"
	REV="$(git --git-dir "${TMP}" describe --tags --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