Skip to content

Instantly share code, notes, and snippets.

@arjan
Created June 8, 2011 19:54
Show Gist options
  • Save arjan/1015228 to your computer and use it in GitHub Desktop.
Save arjan/1015228 to your computer and use it in GitHub Desktop.
Quickly import a python package with git-buildpackage
#!/bin/sh
set -e
SRCPKG=`python -B setup.py --name`
PKG=`basename $PWD`
DISTDIR="../../$PKG/dist"
RELEASE=`ls $DISTDIR -t|head -n 1|sed 's/\.tar\.gz//'|sed s/${SRCPKG}-//`
if [ "`git tag|grep upstream/$RELEASE`" != "" ]; then
echo "Release $RELEASE has already been imported."
exit 1
fi
echo "Importing $SRCPKG release $RELEASE from $DISTDIR."
echo "Press <enter> to continue."
read x
git-import-orig --pristine-tar "$DISTDIR/$SRCPKG-$RELEASE.tar.gz"
git-dch --release -N $RELEASE-1
git add debian/changelog
git ci -a -m "Added changelog entry for $RELEASE"
git-buildpackage --git-export-dir=../build-area -b --git-tag
echo "../build-area/$PKG_$RELEASE-1_amd64.changes"
#dput personal ../build-area/$PKG_$RELEASE-1_amd64.changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment