Skip to content

Commit 02a9bf3

Browse files
committed
Fix version-id bug, drop unused code, check that URL exists before allowing "versions.sh" to continue
1 parent c257144 commit 02a9bf3

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

version-id.jq

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
def version_id:
22
# https://www.php.net/phpversion
33
# $version_id = $major_version * 10000 + $minor_version * 100 + $release_version;
4-
sub("[a-z].*$"; "")
4+
sub("[a-zA-Z].*$"; "")
55
| split(".")
66
| (
77
(.[0] // 0 | tonumber) * 10000

versions.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ declare -A gpgKeys=(
2323
# https://www.php.net/downloads.php#gpg-7.2
2424
# https://www.php.net/gpg-keys.php#gpg-7.2
2525
[7.2]='1729F83938DA44E27BA0F4D3DBDB397470D12172 B1B44D8F021E4E2D6021E995DC9FF8D3EE5AF27F'
26-
27-
[7.1]='foo'
2826
)
2927
# see https://www.php.net/downloads.php
3028

@@ -104,6 +102,11 @@ for version in "${versions[@]}"; do
104102
exit 1
105103
fi
106104

105+
if ! wget -q --spider "$url"; then
106+
echo >&2 "error: '$url' appears to be missing"
107+
exit 1
108+
fi
109+
107110
# if we don't have a .asc URL, let's see if we can figure one out :)
108111
if [ -z "$ascUrl" ] && wget -q --spider "$url.asc"; then
109112
ascUrl="$url.asc"

0 commit comments

Comments
 (0)