File: get-orig-source

package info (click to toggle)
libapache2-mod-tile 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,872 kB
  • sloc: cpp: 18,151; ansic: 7,574; sh: 980; makefile: 163; xml: 27
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}