get latest config: exit with clean and disable getting rc by default
This commit is contained in:
parent
f841402153
commit
366e681a9d
@ -9,10 +9,18 @@ fi
|
|||||||
|
|
||||||
localdir="$(dirname "$(readlink -f "$0")")"
|
localdir="$(dirname "$(readlink -f "$0")")"
|
||||||
releasever="$1"
|
releasever="$1"
|
||||||
|
# Set to 1 to include rc srpm
|
||||||
|
rc="$2"
|
||||||
|
|
||||||
kernelver="$(cat "$localdir/version")"
|
kernelver="$(cat "$localdir/version")"
|
||||||
kernelsrc="linux-$kernelver"
|
kernelsrc="linux-$kernelver"
|
||||||
|
|
||||||
|
exit_clean() {
|
||||||
|
local exit_code=$?
|
||||||
|
rm -rf "$tmpdir"
|
||||||
|
exit "${exit_code}"
|
||||||
|
}
|
||||||
|
|
||||||
errecho() {
|
errecho() {
|
||||||
>&2 echo "$@"
|
>&2 echo "$@"
|
||||||
}
|
}
|
||||||
@ -33,7 +41,11 @@ elif [ "x$releasever" == "x" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# get the latest kernel rpm
|
# get the latest kernel rpm
|
||||||
latestver=$(dnf -q repoquery kernel-core --disablerepo=* --enablerepo=fedora --enablerepo=updates --releasever="$releasever" | sort -V | tail -1 | cut -d ':' -f2)
|
latestver=$(dnf -q repoquery kernel-core --disablerepo=* --enablerepo=fedora --enablerepo=updates --releasever="$releasever")
|
||||||
|
if [ "$rc" != "1" ]; then
|
||||||
|
latestver=$(echo "$latestver" | grep -v "rc[0-9]*")
|
||||||
|
fi
|
||||||
|
latestver=$(echo "$latestver" | sort -V | tail -1 | cut -d ':' -f2)
|
||||||
latestrpm="kernel-core-$latestver.rpm"
|
latestrpm="kernel-core-$latestver.rpm"
|
||||||
|
|
||||||
if [ "$releasever" == 'rawhide' ]; then
|
if [ "$releasever" == 'rawhide' ]; then
|
||||||
@ -43,6 +55,7 @@ fi
|
|||||||
if [ "x$latestrpm" != "x" ] && [ "x$releasever" != "x" ]; then
|
if [ "x$latestrpm" != "x" ] && [ "x$releasever" != "x" ]; then
|
||||||
key="$localdir/keys/RPM-GPG-KEY-fedora-$releasever-primary"
|
key="$localdir/keys/RPM-GPG-KEY-fedora-$releasever-primary"
|
||||||
|
|
||||||
|
trap 'exit_clean' 0 1 2 3 6 15
|
||||||
tmpdir="$(mktemp -d -p "$localdir")"
|
tmpdir="$(mktemp -d -p "$localdir")"
|
||||||
# download latest kernel rpm
|
# download latest kernel rpm
|
||||||
dnf -q download kernel-core --disablerepo=* --enablerepo=fedora --enablerepo=updates --releasever="$releasever"
|
dnf -q download kernel-core --disablerepo=* --enablerepo=fedora --enablerepo=updates --releasever="$releasever"
|
||||||
|
Loading…
Reference in New Issue
Block a user