Support Linux versions without patch versions in update

This commit is contained in:
Fabian Mastenbroek 2021-02-18 13:51:07 +01:00
parent 3f2686df8a
commit d8b33b61aa
No known key found for this signature in database
GPG key ID: 405FC6F81F0A7B85
2 changed files with 14 additions and 10 deletions

View file

@ -7,4 +7,8 @@ MAJOR=$(echo $1 | sed -e "s/^v//" -e "s/\.[^.]*$//")
CURRENT=$(scripts/version.sh -L)
NEW=$(curl -s https://www.kernel.org/releases.json | jq -r ".releases[]|select(.version | startswith(\"$MAJOR\")) | .version")
if [[ "$(scripts/version.sh -p)" = "0" ]]; then
[[ "$(scripts/version.sh -n)" = "$NEW" ]] || echo $NEW
else
[[ "$CURRENT" = "$NEW" ]] || echo $NEW
fi

View file

@ -12,17 +12,20 @@ LINUX_VERSION=$LINUX_VERSION_MAJOR.$LINUX_VERSION_MINOR.$LINUX_VERSION_PATCHLEVE
LINUX_PACKAGE_RELEASE=$(sed -n "s/^PKGREL=\(.*\)$/\1/p" < Makefile | xargs)
LINUX_FLAVOR=$(sed -n "s/^PVE_BUILD_TYPE ?=\(.*\)$/\1/p" < Makefile | xargs)
while getopts "MmprfdLBh" OPTION; do
while getopts "MmnprfdLBh" OPTION; do
case $OPTION in
M)
echo $LINUX_VERSION_MAJOR
exit 0
;;
m)
echo $LINUX_VERSION_MINOR
exit 0
;;
n)
echo $LINUX_VERSION_MAJOR.$LINUX_VERSION_MINOR
exit 0
;;
p)
echo $LINUX_VERSION_PATCHLEVEL
exit 0
@ -35,10 +38,6 @@ while getopts "MmprfdLBh" OPTION; do
echo $LINUX_FLAVOR
exit 0
;;
f)
echo $LINUX_FLAVOR
exit 0
;;
L)
echo $LINUX_VERSION
exit 0
@ -48,9 +47,10 @@ while getopts "MmprfdLBh" OPTION; do
exit 0
;;
h)
echo "commit.sh [-Mmprfh]]"
echo "version.sh [-Mmnprfh]]"
echo " -M major version"
echo " -m minor version"
echo " -n major minor version"
echo " -p patch version"
echo " -r package release"
echo " -f flavor name"