Codebase list rust-libslirp / baae6f7
release.sh: add a convenience option for doing a no-op source-only upload Ximin Luo 4 years ago
4 changed file(s) with 81 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
4141
4242 It will also give you some follow-up instructions to fix the problem.
4343
44
45 Source-only re-upload
46 =====================
47
48 Two aspects of Debian infrastructure policy, run by two different teams,
49 interact badly when it comes to the Debian Rust Team:
50
51 1. Uploads with new binary packages have to be done as binary (not source-only)
52 uploads, into the FTP team's NEW queue.
53 2. Uploads that are valid candidates for Debian Testing have to be source-only
54 uploads, to be considered by the Release team's migration script.
55
56 For your convenience, ``./release.sh`` can do these quickly. After a
57 binary-upload is accepted from the NEW queue, and you merge the relevant
58 pending branch, do a source-only re-upload by simply running::
59
60 RERELEASE=1 ./release.sh <rust-crate-name> [<old-version>]
61
62
4463 Remove an obsolete package
4564 ==========================
4665
2828 git merge-base --is-ancestor origin/master HEAD || \
2929 abort 1 "You are not synced with origin/master, please do so before running this script."
3030
31 if [ "$RERELEASE" = 1 -o "$NOUPDATE" = 1 ]; then
32 REALVER="$(get_existing_version "$PKGDIR")"
33 fi
34
3135 if head -n1 "$PKGDIR/debian/changelog" | grep -qv UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; then
32 abort 0 "Package already released."
36 if [ "$RERELEASE" = 1 ]; then
37 run_debcargo
38 ( cd "$PKGDIR" && dch -a "No-op source-only re-upload for Debian Testing Migration." )
39 # sometimes the copyright years need to be updated, try to do this automatically
40 if git diff -- "$PKGDIR_REL/debian/copyright.debcargo.hint" | patch --no-backup-if-mismatch "$PKGDIR_REL/debian/copyright"; then
41 git add "$PKGDIR_REL/debian/copyright.debcargo.hint" "$PKGDIR_REL/debian/copyright"
42 else
43 git diff -- "$PKGDIR_REL/debian/copyright.debcargo.hint"
44 abort 1 \
45 "copyright file needs updating; apply the above diff to $PKGDIR_REL/debian/copyright" \
46 "then commit your changes, and run me again."
47 fi
48 else
49 abort 0 \
50 "Package already released. If you want to do a source-only re-upload e.g. to" \
51 "hoop-jump through the Debian Testing migration requirements, set RERELEASE=1."
52 fi
3353 fi
3454
3555 if [ -e "$PKGDIR/debian/BLOCK" ]; then
82102
83103 if ! git diff --exit-code -- "$PKGDIR_REL"; then
84104 revert_git_changes
85 abort 1 "Release attempt resulted in git diffs to $PKGDIR_REL, probably the package needs updating (./update.sh $*)"
105 abort 1 \
106 "Release attempt resulted in git diffs to $PKGDIR_REL, probably you need to update the package (./update.sh $*)." \
107 "Alternatively, set NOUPDATE=1 to override this requirement, but please have a good reason."
86108 fi
87109
88110 if ! ( cd build && SOURCEONLY=1 ./build.sh "$CRATE" $VER ); then
97119 DEBVER=$(dpkg-parsechangelog -l $BUILDDIR/debian/changelog -SVersion)
98120 DEBSRC=$(dpkg-parsechangelog -l $BUILDDIR/debian/changelog -SSource)
99121 DEB_HOST_ARCH=$(dpkg-architecture -q DEB_HOST_ARCH)
100 cat >&2 <<eof
101 Release of $CRATE ready as a source package in ${BUILDDIR#$PWD/}. You need to
102 perform the following steps:
103122
123 print_upload_instructions() {
124 if [ "$RERELEASE" = 1 ]; then
125 cat <<eof
126 Upload the source package
127 =========================
128
129 Since you set RERELEASE=1, this package is presumably already in Debian. Go
130 ahead and directly dput the source package.
131
132 cd build && dput ${DEBSRC}_${DEBVER}_source.changes
133 eof
134 else
135 cat <<eof
104136 Build the package if necessary, and upload
105137 ==========================================
106138
109141
110142 cd build && dput ${DEBSRC}_${DEBVER}_source.changes
111143
112 For your reference, this source package builds $(grep ^Package build/${CRATE//_/-}/debian/control | wc -l) binary package(s).
144 For your reference, this source package builds $(grep ^Package build/${CRATE//_/-}/debian/control | wc -l) binary package(s):
145 $(sed -ne 's/^Package: //pg' build/hmac/debian/control | tr '\n' ',')
113146
114147 If this is a NEW source package or introduces NEW binary packages not already
115148 in the Debian archive, you will need to build a binary package out of it. The
122155
123156 If the build fails e.g. due to missing Build-Dependencies you should revert
124157 what I did (see below) and package those missing Build-Dependencies first.
158 eof
159 fi
160 }
161
162 cat >&2 <<eof
163 Release of $CRATE ready as a source package in ${BUILDDIR#$PWD/}. You need to
164 perform the following steps:
165
166 $(print_upload_instructions)
125167
126168 Push this pending-release branch
127169 ================================
132174
133175 git push origin $RELBRANCH && git checkout master
134176
135 Merge the pending-release branch when ACCEPTED
136 ==============================================
177 Merge the pending-release branch if/when ACCEPTED
178 =================================================
137179
138180 When it's ACCEPTED by the Debian FTP masters, you may then merge this branch
139181 back into the master branch, delete it, and push these updates to origin.
141183 git checkout master && git merge $RELBRANCH && git branch -d $RELBRANCH
142184 git push origin master :$RELBRANCH
143185
144 ----
186 Delete this branch without merging if/when REJECTED
187 ===================================================
145188
146 The above assumes you are a Debian Developer with upload rights. If not, you
147 should revert what I just did. To do that, run:
189 If your upload is REJECTED, or if you cannot perform an upload in the first
190 place e.g. because you are not a Debian Developer, you should revert what I
191 just did. To do that, run:
148192
149193 git checkout master && git branch -D $RELBRANCH
150194
151 Then ask a Debian Developer to re-run me ($0 $*) on your behalf. Also touch
152 and commit ${PKGDIR_REL}/debian/RFS so it's easy to track.
195 Then ask a Debian Developer to re-run me ($0 $*) on your behalf. Also, touch
196 and commit ${PKGDIR_REL}/debian/RFS so we can track these easier.
153197 eof
66 exit 0
77 fi
88
9 REALVER="$(sed -nre "s/.*Package .* (.*) from crates.io.*/\1/gp" "$PKGDIR/debian/changelog" | head -n1)"
9 REALVER="$(get_existing_version "$PKGDIR")"
1010 run_debcargo --no-overlay-write-back --changelog-ready
7474 local src="$2"
7575 test ! -e "$dst" -o "$src" -nt "$dst"
7676 }
77
78 get_existing_version() {
79 sed -nre "s/.*Package .* (.*) from crates.io.*/\1/gp" "$1/debian/changelog" | head -n1
80 }