[SCM] rtmpdump/master: git-orig-source: simplifications
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Wed May 1 09:57:55 UTC 2013
The following commit has been merged in the master branch:
commit a50be3fd7ef11d70a2daa2d1160613efb763a30b
Author: Reinhard Tartler <siretart at tauware.de>
Date: Wed May 1 11:57:27 2013 +0200
git-orig-source: simplifications
This variant does no longer require an extra clone of the upstream
VCS. Instead, the upstream code is fetched into the current packaging
git, and can thus be reused for git-import-orig.
As a regression, this commit now requires the script to be executed in
the packaging git.
diff --git a/debian/get-git-source.sh b/debian/get-git-source.sh
index 3c5214b..2bc37b3 100755
--- a/debian/get-git-source.sh
+++ b/debian/get-git-source.sh
@@ -1,25 +1,25 @@
#!/bin/sh
+set -e
+
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 "-"'
+UPSTREAM_GIT="git://git.ffmpeg.org/rtmpdump"
if [ -z ${BASE_REL} ]; then
echo 'Please run this script from the sources root directory.'
exit 1
fi
+echo "Fetching latest upstream code into FETCH_HEAD"
+git fetch $UPSTREAM_GIT
+
+RTMPDUMP_GIT_COMMIT=`git describe --always FETCH_HEAD`
+RTMPDUMP_GIT_DATE=`git --no-pager log -1 --pretty=format:%cd --date=short FETCH_HEAD | sed s/-//g`
+TARBALL="../rtmpdump_${BASE_REL}+${RTMPDUMP_GIT_DATE}.git${RTMPDUMP_GIT_COMMIT}.orig.tar.gz"
+
+git archive --format=tar --prefix=rtmpdump-"${RTMPDUMP_GIT_DATE}/" HEAD | \
+ gzip -9fn > "$TARBALL"
+
+echo "Suchessfully created $TARBALL"
+
-rm -rf ${GOS_DIR}
-mkdir ${GOS_DIR} && cd ${GOS_DIR}
-git clone git://git.ffmpeg.org/rtmpdump rtmpdump
-cd rtmpdump/
-RTMPDUMP_GIT_COMMIT=$(eval "${GIT_COMMIT}")
-RTMPDUMP_GIT_DATE=$(eval "${GIT_DATE}")
-cd .. && tar cf \
- ${OLDDIR}/rtmpdump_${BASE_REL}+${RTMPDUMP_GIT_DATE}.git${RTMPDUMP_GIT_COMMIT}.orig.tar \
- rtmpdump --exclude-vcs && gzip -9fn \
- ${OLDDIR}/rtmpdump_${BASE_REL}+${RTMPDUMP_GIT_DATE}.git${RTMPDUMP_GIT_COMMIT}.orig.tar
-rm -rf ${GOS_DIR}
--
rtmpdump packaging
More information about the pkg-multimedia-commits
mailing list