make, scripts: Fix CentOS 7 build

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2018-10-13 10:46:02 +00:00
commit 20f675c280
5 changed files with 38 additions and 7 deletions

View file

@ -50,9 +50,15 @@ cmd_name_version()
echo suse-tumbleweed
exit 0
fi
if [ "$ID" != ubuntu ]; then
[ "$ID_LIKE" ] && ID=$ID_LIKE
fi
case "$ID" in
ubuntu|centos)
;;
*)
[ "$ID_LIKE" ] && ID=$ID_LIKE
;;
esac
case "$ID" in
debian)
VERSION_NAME=`echo $PRETTY_NAME | awk 'NF>1{print $NF}' | sed 's%/.*%%' | tr '[A-Z]' '[a-z]'`
@ -73,6 +79,8 @@ cmd_name_version()
;;
esac
;;
centos)
;;
ubuntu)
;;
suse|opensuse)

View file

@ -45,6 +45,15 @@ config()
run_git()
{
marker git "$@"
# sadly, CentOS 7 has git 1.8.3.1, which doesn't support -C
if [ "$1" = -C ]; then
(
cd $2
shift 2
git "$@"
)
return $?
fi
git "$@"
}

View file

@ -67,6 +67,9 @@ cmd_install()
}
eval run sudo $env -S pacman $global_opts -S --needed "$@"
;;
centos)
eval run sudo $env -S yum $global_opts install -y "$@"
;;
*)
fatal "Tried to install on unsupported platform \"$ID\""
;;
@ -99,6 +102,10 @@ cmd_refresh()
debian|ubuntu)
eval run sudo $env -S apt-get $global_opts update "$@"
;;
centos)
eval run sudo $env -S yum $global_opts clean expire-cache "$@"
eval run sudo $env -S yum $global_opts makecache "$@"
;;
*)
fatal "Tried to update unsupported platform \"$ID\""
;;