aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdebian/debian_get-git-source.sh25
-rw-r--r--debian/get-vcs-snapshot.sh33
-rwxr-xr-xdebian/rules3
3 files changed, 36 insertions, 25 deletions
diff --git a/debian/debian_get-git-source.sh b/debian/debian_get-git-source.sh
deleted file mode 100755
index 0f3cf16..0000000
--- a/debian/debian_get-git-source.sh
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-
-BASE_REL=$(dpkg-parsechangelog 2>/dev/null | sed -ne 's/Version: \([0-9.]\+\)+\?.*/\1/p')
-OLDDIR=${PWD}
-GOS_DIR=${OLDDIR}/get-orig-source
-GIT_COMMIT='git log --no-color -1 --oneline | cut -d" " -f1'
-GIT_DATE='git log --no-color -1 --date=iso | sed -ne "s/Date:\s\+\(.*\).*/\1/p" | cut -d" " -f1 | tr -d "-"'
-
-if [ -z ${BASE_REL} ]; then
- echo 'Please run this script from the sources root directory.'
- exit 1
-fi
-
-
-rm -rf ${GOS_DIR}
-mkdir ${GOS_DIR} && cd ${GOS_DIR}
-git clone git://linuxtv.org/dtv-scan-tables.git
-cd dtv-scan-tables/
-dtvscantables_GIT_COMMIT=$(eval "${GIT_COMMIT}")
-dtvscantables_GIT_DATE=$(eval "${GIT_DATE}")
-cd .. && tar cf \
- ${OLDDIR}/dtv-scan-tables_${BASE_REL}+git${dtvscantables_GIT_DATE}.${dtvscantables_GIT_COMMIT}.orig.tar \
- dtv-scan-tables --exclude-vcs && gzip -9fn \
- ${OLDDIR}/dtv-scan-tables_${BASE_REL}+git${dtvscantables_GIT_DATE}.${dtvscantables_GIT_COMMIT}.orig.tar
-rm -rf ${GOS_DIR}
diff --git a/debian/get-vcs-snapshot.sh b/debian/get-vcs-snapshot.sh
new file mode 100644
index 0000000..b1309f5
--- /dev/null
+++ b/debian/get-vcs-snapshot.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+set -e
+
+GIT=git://linuxtv.org/dtv-scan-tables.git
+
+echo Downloading latest snapshot from git repository...
+
+DEB_SOURCE_PACKAGE=`egrep '^Source: ' debian/control | cut -f 2 -d ' '`
+VERSION_UPSTREAM=`dpkg-parsechangelog | grep ^Version: | sed -e 's/^Version:\s*//' -e s/-[^-]*$// -e s/\+git.*//`
+VERSION_DATE=`/bin/date --utc +%0Y%0m%0d`
+
+git clone --depth 1 ${GIT}
+
+GIT_SHA=`git --git-dir="${DEB_SOURCE_PACKAGE}/.git" show --pretty=format:"%h" --quiet | head -1 || true`
+
+VERSION_FULL="${VERSION_UPSTREAM}+git${VERSION_DATE}.${GIT_SHA}"
+TARBALL="../${DEB_SOURCE_PACKAGE}_${VERSION_FULL}.orig.tar.gz"
+
+tar --exclude-vcs -c ${DEB_SOURCE_PACKAGE} | gzip -9 >"${TARBALL}"
+
+rm -rf ${DEB_SOURCE_PACKAGE}
+
+if [ -d .git ]; then
+ read -p "Import '${TARBALL}' into Git (y/N)?" ANSWER
+ case ${ANSWER} in
+ [Yy] )
+ git-import-orig --pristine-tar "${TARBALL}"
+ dch -v "${VERSION_FULL}-1" "New Upstream Snapshot (commit ${GIT_SHA})"
+ break
+ ;;
+ esac
+fi
diff --git a/debian/rules b/debian/rules
index 2d33f6a..cb2ffaa 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,3 +2,6 @@
%:
dh $@
+
+get-vcs-snapshot:
+ sh debian/get-vcs-snapshot.sh