File: get-orig-source.sh

package info (click to toggle)
fonts-junction 20110525.18de841-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, jessie, jessie-kfreebsd, sid, stretch
  • size: 1,900 kB
  • sloc: sh: 13; makefile: 6
file content (21 lines) | stat: -rwxr-xr-x 453 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
#!/bin/sh

set -e

UPSTREAM_REPO=https://github.com/theleagueof/junction.git
PACKAGE=$(dpkg-parsechangelog | sed -n 's/^Source: //p')

rm -rf orig-source

git clone "$UPSTREAM_REPO" orig-source
cd orig-source

date=$(date --utc --date="$(git log -1 --pretty=format:%cD HEAD)" "+%Y%m%d")
rev=$(git log -1 --pretty=format:"%h")
upstream_version="$date.$rev"

git archive HEAD |
	xz -c >../$PACKAGE\_$upstream_version.orig.tar.xz

cd ..
rm -rf orig-source