diff --git a/bin/make-package b/bin/make-package index 2bca1ad..867642c 100755 --- a/bin/make-package +++ b/bin/make-package @@ -1,96 +1,96 @@ #!/bin/bash usage() { echo "Usage: $0 [-b|--build] [-u|--upload] SWH_PACKAGE" echo "E.g.: make-package -b swh-core" exit 1 } # command line parsing build="no" upload="no" package="" while (( "$#" )); do case "$1" in -b|--build) build="yes" ;; -u|--upload) upload="yes" ;; *) package="$1";; esac shift done if [ "$build,$upload" = "no,no" -o -z "$package" ] ; then usage fi set -e CURDIR=$(readlink -f "$package") PACKAGEDIR=$(readlink -f "packages") BASENAME="$(basename "$CURDIR")" MODULE="${BASENAME//-/.}" REPOSITORY=http://debian.internal.softwareheritage.org/ DESTINATION=pergamon.internal.softwareheritage.org DESTDIR=/srv/softwareheritage/repository TEMP=$(mktemp -d) trap "{ rm -rf $TEMP; }" EXIT cd "$CURDIR" VERSION=$(python3 -c 'import vcversioner; print(vcversioner.find_version().version)') SID_CHANGES_FILE=${BASENAME}_${VERSION}-1_amd64.changes BPO_CHANGES_FILE=${BASENAME}_${VERSION}-1~bpo8~swh+1_amd64.changes if [ "$build" = "yes" ] ; then # Generate source tarball and put it in the right place python3 setup.py sdist -d $TEMP mv $TEMP/$MODULE-$VERSION.tar.gz $TEMP/${BASENAME}_${VERSION}.orig.tar.gz # Extract source tarball and overlay Debian packaging cd $TEMP tar xf ${BASENAME}_${VERSION}.orig.tar.gz mv $MODULE-$VERSION $BASENAME-$VERSION cd $BASENAME-$VERSION cp -r $CURDIR/debian . # Generate changelog for unstable dch -v "${VERSION}-1" "Deploy ${VERSION}" dch --force-distribution --distribution unstable-swh -r "" # Build unstable package with original source - sbuild -As --force-orig-source --extra-repository="deb [trusted=yes] ${REPOSITORY} unstable main" + sbuild -As --force-orig-source --build-failed-commands '%SBUILD_SHELL' --extra-repository="deb [trusted=yes] ${REPOSITORY} unstable main" # Copy package to staging directory dcmd cp ../${SID_CHANGES_FILE} ${PACKAGEDIR} # Generate changelog for backports dch -l ~bpo8~swh+ "Rebuild for jessie-backports-swh" dch -r --distribution jessie-backports-swh --force-distribution "" # Build backport package - sbuild -As --extra-repository="deb [trusted=yes] ${REPOSITORY} jessie main" + sbuild -As --build-failed-commands '%SBUILD_SHELL' --extra-repository="deb [trusted=yes] ${REPOSITORY} jessie main" # Copy package to staging directory dcmd cp ../${BPO_CHANGES_FILE} ${PACKAGEDIR} fi if [ "$upload" = "yes" ] ; then if [[ ${VERSION} = *dev* ]]; then echo "Uploading a dev version is not allowed! Please tag and rebuild." exit 2 fi # Sign and send unstable package for changefile in ${PACKAGEDIR}/${SID_CHANGES_FILE} ${PACKAGEDIR}/${BPO_CHANGES_FILE}; do debsign ${changefile} dcmd scp ${changefile} ${DESTINATION}:${DESTDIR}/incoming ssh ${DESTINATION} reprepro -vb ${DESTDIR} processincoming incoming done git push --tags fi