From baae6f7cabd3da052f195629984af8075c823ca2 Mon Sep 17 00:00:00 2001 From: Ximin Luo Date: Mon, 27 Jan 2020 22:10:47 +0000 Subject: [PATCH] release.sh: add a convenience option for doing a no-op source-only upload --- RELEASE.rst | 19 ++++++++++++++ release.sh | 70 ++++++++++++++++++++++++++++++++++++++++++---------- repackage.sh | 2 +- vars.sh.frag | 4 +++ 4 files changed, 81 insertions(+), 14 deletions(-) diff --git a/RELEASE.rst b/RELEASE.rst index ed8c13ed8..75d854a4b 100644 --- a/RELEASE.rst +++ b/RELEASE.rst @@ -42,6 +42,25 @@ the one in Debian Testing not Debian Unstable. To view a summary of this, run:: It will also give you some follow-up instructions to fix the problem. + +Source-only re-upload +===================== + +Two aspects of Debian infrastructure policy, run by two different teams, +interact badly when it comes to the Debian Rust Team: + +1. Uploads with new binary packages have to be done as binary (not source-only) + uploads, into the FTP team's NEW queue. +2. Uploads that are valid candidates for Debian Testing have to be source-only + uploads, to be considered by the Release team's migration script. + +For your convenience, ``./release.sh`` can do these quickly. After a +binary-upload is accepted from the NEW queue, and you merge the relevant +pending branch, do a source-only re-upload by simply running:: + + RERELEASE=1 ./release.sh [] + + Remove an obsolete package ========================== diff --git a/release.sh b/release.sh index 00588b7f6..7e3513b1a 100755 --- a/release.sh +++ b/release.sh @@ -29,8 +29,28 @@ git fetch origin --prune git merge-base --is-ancestor origin/master HEAD || \ abort 1 "You are not synced with origin/master, please do so before running this script." +if [ "$RERELEASE" = 1 -o "$NOUPDATE" = 1 ]; then + REALVER="$(get_existing_version "$PKGDIR")" +fi + if head -n1 "$PKGDIR/debian/changelog" | grep -qv UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; then - abort 0 "Package already released." + if [ "$RERELEASE" = 1 ]; then + run_debcargo + ( cd "$PKGDIR" && dch -a "No-op source-only re-upload for Debian Testing Migration." ) + # sometimes the copyright years need to be updated, try to do this automatically + if git diff -- "$PKGDIR_REL/debian/copyright.debcargo.hint" | patch --no-backup-if-mismatch "$PKGDIR_REL/debian/copyright"; then + git add "$PKGDIR_REL/debian/copyright.debcargo.hint" "$PKGDIR_REL/debian/copyright" + else + git diff -- "$PKGDIR_REL/debian/copyright.debcargo.hint" + abort 1 \ + "copyright file needs updating; apply the above diff to $PKGDIR_REL/debian/copyright" \ + "then commit your changes, and run me again." + fi + else + abort 0 \ + "Package already released. If you want to do a source-only re-upload e.g. to" \ + "hoop-jump through the Debian Testing migration requirements, set RERELEASE=1." + fi fi if [ -e "$PKGDIR/debian/BLOCK" ]; then @@ -83,7 +103,9 @@ fi if ! git diff --exit-code -- "$PKGDIR_REL"; then revert_git_changes - abort 1 "Release attempt resulted in git diffs to $PKGDIR_REL, probably the package needs updating (./update.sh $*)" + abort 1 \ + "Release attempt resulted in git diffs to $PKGDIR_REL, probably you need to update the package (./update.sh $*)." \ + "Alternatively, set NOUPDATE=1 to override this requirement, but please have a good reason." fi if ! ( cd build && SOURCEONLY=1 ./build.sh "$CRATE" $VER ); then @@ -98,10 +120,20 @@ git commit -m "Release package $PKGNAME" DEBVER=$(dpkg-parsechangelog -l $BUILDDIR/debian/changelog -SVersion) DEBSRC=$(dpkg-parsechangelog -l $BUILDDIR/debian/changelog -SSource) DEB_HOST_ARCH=$(dpkg-architecture -q DEB_HOST_ARCH) -cat >&2 <&2 <