Created
March 27, 2016 04:52
-
-
Save shuhaowu/6eeda480f6c6b3cb920b to your computer and use it in GitHub Desktop.
For releasing packages to PPA.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
PROJECT=$1 | |
PPA_ID=$2 | |
if [ -z $PROJECT ] || [ -z $PPA_ID ]; then | |
>&2 echo "usage: ./release.sh directory ppa_id" | |
exit 1 | |
fi | |
if [ ! -d $PROJECT ]; then | |
>&2 echo "ERROR: $PROJECT does not exist" | |
exit 1 | |
fi | |
VERSION=`head -n1 $PROJECT/debian/changelog | cut -f 2 -d " " | cut -f 2 -d ":" | cut -f 1 -d "-"` | |
PROJECT_VERSION="${PROJECT}_${VERSION}" | |
echo "doing release of $PROJECT_VERSION" | |
set -x | |
rm -rf _build/$PROJECT | |
mkdir -p _build/$PROJECT/$PROJECT_VERSION | |
pushd $PROJECT >/dev/null | |
git checkout-index -a -f --prefix="../_build/$PROJECT/$PROJECT_VERSION/" | |
popd >/dev/null | |
pushd _build/$PROJECT >/dev/null | |
tar czf ${PROJECT_VERSION}.orig.tar.gz $PROJECT_VERSION | |
pushd $PROJECT_VERSION >/dev/null | |
debuild -S -sa | |
popd >/dev/null | |
dput ppa:$PPA_ID ${PROJECT}*.changes | |
popd >/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment