Create import script.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 22 Jan 2007 12:17:17 +0000 (12:17 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 22 Jan 2007 12:34:53 +0000 (12:34 +0000)
import [new file with mode: 0755]
make-deb-source [new file with mode: 0755]

diff --git a/import b/import
new file mode 100755 (executable)
index 0000000..dead84e
--- /dev/null
+++ b/import
@@ -0,0 +1,37 @@
+#! /bin/sh
+
+set -e
+tarball=${1?tarball}
+case $tarball in /*);; *) tarball=`pwd`/$tarball;; esac
+tmp=${TMPDIR-/tmp}/mup-$$
+mkdir $tmp
+: ${GIT_DIR=`git rev-parse --git-dir`}
+case $GIT_DIR in /*);; *) GIT_DIR=`pwd`/$GIT_DIR;; esac
+export GIT_DIR
+trap 'cd /; rm -rf $tmp' 0
+cd $tmp
+GIT_INDEX_FILE=$tmp/index
+export GIT_INDEX_FILE
+
+mkdir unpack; cd unpack
+tar xfz $tarball
+mupdir=`ls -d mup-*`
+version=${mupdir#mup-}
+cp $tarball mup_$version.orig.tar.gz
+mv $mupdir mup
+echo $version
+
+find . -type f -print0 | git update-index --add -z --stdin
+tree=$(git write-tree)
+if [ -f $GIT_DIR/refs/heads/arkkra ]; then
+  pp="-p $(cat $GIT_DIR/refs/heads/arkkra)"
+else
+  pp=""
+fi
+commit=$(
+  echo "Import upstream version $version." |
+  git commit-tree $tree $pp
+)
+git update-ref refs/heads/arkkra $commit
+git update-ref refs/tags/$version $commit
+echo "Imported Mup $version: $commit"
diff --git a/make-deb-source b/make-deb-source
new file mode 100755 (executable)
index 0000000..5a4d24d
--- /dev/null
@@ -0,0 +1,6 @@
+#! /bin/sh
+
+set -e
+fakeroot debian/rules clean
+cd ..
+dpkg-source -b mup mup_*.orig.tar.gz