mirror of
https://github.com/dynup/kpatch
synced 2025-04-27 05:27:57 +00:00
kpatch-build: check distro in /etc/os-release
/etc/issue isn't valid in RHEL 7 RC. The official way to query the distro seems to be /etc/os-release.
This commit is contained in:
parent
5ea376a47a
commit
e1305886c7
@ -180,7 +180,8 @@ elif [[ -d "$SRCDIR" ]]; then
|
|||||||
echo "Using cache at $SRCDIR"
|
echo "Using cache at $SRCDIR"
|
||||||
|
|
||||||
else
|
else
|
||||||
if grep -q "Fedora" "/etc/issue" || grep -q "Red Hat" "/etc/issue"; then
|
source /etc/os-release
|
||||||
|
if [[ $ID = fedora ]] || [[ $ID = rhel ]]; then
|
||||||
|
|
||||||
echo "Fedora/Red Hat distribution detected"
|
echo "Fedora/Red Hat distribution detected"
|
||||||
rpm -q --quiet rpmdevtools || die "rpmdevtools not installed"
|
rpm -q --quiet rpmdevtools || die "rpmdevtools not installed"
|
||||||
@ -205,7 +206,7 @@ else
|
|||||||
cp "$SRCDIR/.config" "$OBJDIR" || die
|
cp "$SRCDIR/.config" "$OBJDIR" || die
|
||||||
echo "-${ARCHVERSION##*-}" > "$SRCDIR/localversion" || die
|
echo "-${ARCHVERSION##*-}" > "$SRCDIR/localversion" || die
|
||||||
|
|
||||||
elif grep -q "Ubuntu" "/etc/issue"; then
|
elif [[ $ID = ubuntu ]]; then
|
||||||
|
|
||||||
echo "Debian/Ubuntu distribution detected"
|
echo "Debian/Ubuntu distribution detected"
|
||||||
cd $TEMPDIR
|
cd $TEMPDIR
|
||||||
|
Loading…
Reference in New Issue
Block a user