| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
REMOTE=upstream |
| 4 |
BRANCH=${REMOTE}/master |
| 5 |
|
| 6 |
if [ $(git remote show ${REMOTE} | wc -l) -eq 0 ]; then |
| 7 |
git remote add ${REMOTE} https://github.com/openstreetmap/mod_tile.git |
| 8 |
fi |
| 9 |
|
| 10 |
git fetch ${REMOTE} --no-tags |
| 11 |
|
| 12 |
PACKAGE=$(dpkg-parsechangelog -S Source) |
| 13 |
VERSION=$(dpkg-parsechangelog -S Version | sed -e 's/-[^-]*$//' | sed -e 's/^[0-9]*://' | sed -e 's/^[0-9]*://' | sed -e 's/\+.*//') |
| 14 |
|
| 15 |
COMMIT=$(git log -n1 --format=format:%h ${BRANCH}) |
| 16 |
DATE=$(date +%Y%m%d --date="@$(git log -n1 --format=format:%ct ${BRANCH})") |
| 17 |
|
| 18 |
VERSION="${VERSION}+git${DATE}-${COMMIT}" |
| 19 |
|
| 20 |
git archive --format=tar.gz --prefix=${PACKAGE}-${VERSION}/ -o ../${PACKAGE}_${VERSION}.orig.tar.gz ${BRANCH} |