Skip to content

Commit 9812e84

Browse files
Pick CoreOS version from version.txt to handle "current"
1 parent f299ba7 commit 9812e84

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

scripts/build-probe-binaries

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function build_sysdigcloud {
118118

119119
function coreos_build_old {
120120
VERSION_URL=$1
121-
VERSION_NUMBER=$(echo $VERSION_URL | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
121+
VERSION_NUMBER=$2
122122
COREOS_DIR="coreos-"$VERSION_NUMBER
123123

124124
if [ ! -d $COREOS_DIR ]; then
@@ -175,7 +175,7 @@ function coreos_build_old {
175175

176176
function coreos_build_new {
177177
VERSION_URL=$1
178-
VERSION_NUMBER=$(echo $VERSION_URL | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+')
178+
VERSION_NUMBER=$2
179179
COREOS_DIR="coreos-"$VERSION_NUMBER
180180

181181
if [ ! -d $COREOS_DIR ]; then
@@ -409,12 +409,11 @@ URLS="$($DIR/kernel-crawler.py CoreOS)"
409409

410410
for URL in $URLS
411411
do
412-
FULL_VERSION=$(echo $URL|cut -d/ -f5)
413-
MAJOR_VERSION=$(echo $FULL_VERSION|cut -d. -f1)
414-
if [ $MAJOR_VERSION -gt 890 ]; then
415-
coreos_build_new $URL
412+
eval $(curl -s ${URL}version.txt)
413+
if [ $COREOS_BUILD -gt 890 ]; then
414+
coreos_build_new $URL $COREOS_VERSION
416415
else
417-
coreos_build_old $URL
416+
coreos_build_old $URL $COREOS_VERSION
418417
fi
419418
done
420419

0 commit comments

Comments
 (0)