28 | 28 |
git merge-base --is-ancestor origin/master HEAD || \
|
29 | 29 |
abort 1 "You are not synced with origin/master, please do so before running this script."
|
30 | 30 |
|
|
31 |
if [ "$RERELEASE" = 1 -o "$NOUPDATE" = 1 ]; then
|
|
32 |
REALVER="$(get_existing_version "$PKGDIR")"
|
|
33 |
fi
|
|
34 |
|
31 | 35 |
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
|
33 | 53 |
fi
|
34 | 54 |
|
35 | 55 |
if [ -e "$PKGDIR/debian/BLOCK" ]; then
|
|
82 | 102 |
|
83 | 103 |
if ! git diff --exit-code -- "$PKGDIR_REL"; then
|
84 | 104 |
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."
|
86 | 108 |
fi
|
87 | 109 |
|
88 | 110 |
if ! ( cd build && SOURCEONLY=1 ./build.sh "$CRATE" $VER ); then
|
|
97 | 119 |
DEBVER=$(dpkg-parsechangelog -l $BUILDDIR/debian/changelog -SVersion)
|
98 | 120 |
DEBSRC=$(dpkg-parsechangelog -l $BUILDDIR/debian/changelog -SSource)
|
99 | 121 |
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:
|
103 | 122 |
|
|
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
|
104 | 136 |
Build the package if necessary, and upload
|
105 | 137 |
==========================================
|
106 | 138 |
|
|
109 | 141 |
|
110 | 142 |
cd build && dput ${DEBSRC}_${DEBVER}_source.changes
|
111 | 143 |
|
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' ',')
|
113 | 146 |
|
114 | 147 |
If this is a NEW source package or introduces NEW binary packages not already
|
115 | 148 |
in the Debian archive, you will need to build a binary package out of it. The
|
|
122 | 155 |
|
123 | 156 |
If the build fails e.g. due to missing Build-Dependencies you should revert
|
124 | 157 |
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)
|
125 | 167 |
|
126 | 168 |
Push this pending-release branch
|
127 | 169 |
================================
|
|
132 | 174 |
|
133 | 175 |
git push origin $RELBRANCH && git checkout master
|
134 | 176 |
|
135 | |
Merge the pending-release branch when ACCEPTED
|
136 | |
==============================================
|
|
177 |
Merge the pending-release branch if/when ACCEPTED
|
|
178 |
=================================================
|
137 | 179 |
|
138 | 180 |
When it's ACCEPTED by the Debian FTP masters, you may then merge this branch
|
139 | 181 |
back into the master branch, delete it, and push these updates to origin.
|
|
141 | 183 |
git checkout master && git merge $RELBRANCH && git branch -d $RELBRANCH
|
142 | 184 |
git push origin master :$RELBRANCH
|
143 | 185 |
|
144 | |
----
|
|
186 |
Delete this branch without merging if/when REJECTED
|
|
187 |
===================================================
|
145 | 188 |
|
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:
|
148 | 192 |
|
149 | 193 |
git checkout master && git branch -D $RELBRANCH
|
150 | 194 |
|
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.
|
153 | 197 |
eof
|