File: get-orig-source

package info (click to toggle)
libapache2-mod-tile 0.5-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,288 kB
  • sloc: ansic: 7,809; cpp: 6,692; sh: 853; python: 412; makefile: 69
file content (20 lines) | stat: -rwxr-xr-x 676 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

REMOTE=upstream
BRANCH=${REMOTE}/master

if [ $(git remote show ${REMOTE} | wc -l) -eq 0 ]; then
    git remote add ${REMOTE} https://github.com/openstreetmap/mod_tile.git
fi

git fetch ${REMOTE} --no-tags

PACKAGE=$(dpkg-parsechangelog -S Source)
VERSION=$(dpkg-parsechangelog -S Version | sed -e 's/-[^-]*$//' | sed -e 's/^[0-9]*://' | sed -e 's/^[0-9]*://' | sed -e 's/\+.*//')

COMMIT=$(git log -n1 --format=format:%h ${BRANCH})
DATE=$(date +%Y%m%d --date="@$(git log -n1 --format=format:%ct ${BRANCH})")

VERSION="${VERSION}+git${DATE}-${COMMIT}"

git archive --format=tar.gz --prefix=${PACKAGE}-${VERSION}/ -o ../${PACKAGE}_${VERSION}.orig.tar.gz ${BRANCH}