Skip to content

Commit ee00673

Browse files
committed
Revise prep-release.php handling
Allows version argument to contain "-stability" suffix, which we'd like for accurate version checking in userland and PHP extension info.
1 parent dedf515 commit ee00673

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

Makefile.frag

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ release-docs: docs
142142
mkdocs gh-deploy --clean
143143

144144
package.xml: RELEASE
145-
php bin/prep-release.php $(MONGODB_VERSION)-$(MONGODB_STABILITY)
145+
php bin/prep-release.php $(MONGODB_VERSION) $(MONGODB_STABILITY)
146146

147147
RELEASE:
148148
@echo "RELEASE $(MONGODB_VERSION)" >> RELEASE-$(MONGODB_VERSION)

bin/prep-release.php

+12-17
Original file line numberDiff line numberDiff line change
@@ -157,31 +157,26 @@ function usage() {
157157
global $argv;
158158

159159
echo "Usage:\n\t";
160-
echo $argv[0], " <version><-stability>\n";
160+
echo $argv[0], " <version> <stability>\n";
161161

162162
exit(1);
163163
}
164164

165-
if ($argc != 2) {
165+
if ($argc != 3) {
166166
usage();
167167
}
168168

169-
if (strpos($argv[1], "-")) {
170-
list($VERSION, $STABILITY) = explode("-", $argv[1], 2);
171-
} else {
172-
$VERSION = $argv[1];
169+
$VERSION = $argv[1];
170+
$STABILITY = $argv[2];
173171

174-
/* 0.x.y. are developmental releases and cannot be stable */
175-
if ((int)$VERSION < 1) {
176-
$STABILITY = "devel";
177-
}
178-
/* A release candidate is a "beta" stability in terms of PECL */
179-
$rc = substr($VERSION, -3, 2);
180-
if (strcasecmp($rc, "rc") == 0) {
181-
$STABILITY = "beta";
182-
} else {
183-
$STABILITY = "stable";
184-
}
172+
/* 0.x.y. are developmental releases and cannot be stable */
173+
if ((int)$VERSION < 1) {
174+
$STABILITY = "devel";
175+
}
176+
177+
/* A release candidate is a "beta" stability in terms of PECL */
178+
if (stristr($VERSION, '-rc') !== false) {
179+
$STABILITY = "beta";
185180
}
186181

187182
verify_stability($STABILITY);

0 commit comments

Comments
 (0)