pm/install
This commit is contained in:
parent
0af77deec9
commit
4db5c7ce08
1 changed files with 10 additions and 11 deletions
|
@ -618,7 +618,6 @@ ${SPCD_PROJECT_ROOT}$(basename "${GITHUB_SERVER_URL}")"
|
|||
spcd_os_printenv "SPCD_PM"
|
||||
case "${SPCD_PM}" in
|
||||
"${SPCD_PM_DNF}")
|
||||
SPCD_PM_INSTALL="dnf install --assumeyes"
|
||||
SPCD_PM_QUERY="rpm --query"
|
||||
SPCD_PM_CONF_PATH="/etc/dnf/dnf.conf"
|
||||
SPCD_PM_CONF_TEXT="\
|
||||
|
@ -635,7 +634,6 @@ sslverify=False
|
|||
"
|
||||
;;
|
||||
"${SPCD_PM_APK}")
|
||||
SPCD_PM_INSTALL="apk add"
|
||||
SPCD_PM_QUERY="apk info"
|
||||
SPCD_PM_CONF_PATH=""
|
||||
SPCD_PM_CONF_TEXT=""
|
||||
|
@ -645,7 +643,6 @@ sslverify=False
|
|||
"
|
||||
;;
|
||||
"${SPCD_PM_PACMAN}")
|
||||
SPCD_PM_INSTALL="pacman --sync --noconfirm"
|
||||
SPCD_PM_QUERY="pacman --query"
|
||||
SPCD_PM_CONF_PATH=""
|
||||
SPCD_PM_CONF_TEXT=""
|
||||
|
@ -655,7 +652,6 @@ SSLVerify = No
|
|||
"
|
||||
;;
|
||||
"${SPCD_PM_APT}")
|
||||
SPCD_PM_INSTALL="apt-get install --assume-yes"
|
||||
SPCD_PM_QUERY="dpkg-query --show"
|
||||
SPCD_PM_CONF_PATH="/etc/apt/apt.conf.d/apt.conf"
|
||||
SPCD_PM_CONF_TEXT="\
|
||||
|
@ -671,7 +667,6 @@ Acquire::https::Verify-Peer False;
|
|||
"
|
||||
;;
|
||||
"${SPCD_PM_ZYPPER}")
|
||||
SPCD_PM_INSTALL="zypper --non-interactive install"
|
||||
SPCD_PM_QUERY="rpm --query"
|
||||
SPCD_PM_CONF_PATH=""
|
||||
SPCD_PM_CONF_TEXT="\
|
||||
|
@ -683,7 +678,7 @@ Acquire::https::Verify-Peer False;
|
|||
*) ;;
|
||||
esac
|
||||
spcd_split
|
||||
spcd_os_printenv "SPCD_PM_INSTALL" "SPCD_PM_QUERY"
|
||||
spcd_os_printenv "SPCD_PM_QUERY"
|
||||
spcd_split
|
||||
spcd_os_printenv "SPCD_PM_CONF_PATH" "SPCD_PM_HTTPS_PATH"
|
||||
# specific
|
||||
|
@ -851,11 +846,15 @@ spcd_clean_cache() {
|
|||
}
|
||||
|
||||
spcd_install_package() {
|
||||
spcd_install_package__name="${1}"
|
||||
if [ -n "${spcd_install_package__name}" ]; then
|
||||
${SPCD_PM_INSTALL} "${spcd_install_package__name}"
|
||||
spcd_clean_cache
|
||||
fi
|
||||
case "${SPCD_PM}" in
|
||||
"${SPCD_PM_APK}") apk add "${1}" ;;
|
||||
"${SPCD_PM_APT}") apt-get install --assume-yes "${1}" ;;
|
||||
"${SPCD_PM_DNF}") dnf install --assumeyes "${1}" ;;
|
||||
"${SPCD_PM_PACMAN}") pacman --sync --noconfirm "${1}" ;;
|
||||
"${SPCD_PM_ZYPPER}") zypper --non-interactive install "${1}" ;;
|
||||
*) ;;
|
||||
esac
|
||||
spcd_clean_cache
|
||||
}
|
||||
|
||||
# ╭───────┬─────╮
|
||||
|
|
Loading…
Reference in a new issue