changed installing podman-compose with pip to packagemanager

This commit is contained in:
Albert-LGTM 2024-10-10 14:37:29 +02:00
parent 6119920b1c
commit 95aed8127f

View File

@ -41,58 +41,17 @@ install_podman() {
esac esac
} }
check_python_pip() {
if ! command_exists python3; then
printf "%b\n" "${YELLOW}Pip not found. Installing pip...${RC}"
case "$PACKAGER" in
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y python3
;;
dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y python3
;;
zypper)
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install python3
;;
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm python
;;
*)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
fi
if ! command_exists pip3; then
printf "%b\n" "${YELLOW}Pip not found. Installing pip...${RC}"
case "$PACKAGER" in
apt-get|nala)
"$ESCALATION_TOOL" "$PACKAGER" install -y python3-pip
;;
dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y python3-pip
;;
zypper)
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install python3-pip
;;
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm python-pip
;;
*)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
;;
esac
fi
}
install_podman_compose() { install_podman_compose() {
printf "%b\n" "${YELLOW}Installing Podman Compose...${RC}" printf "%b\n" "${YELLOW}Installing Podman Compose...${RC}"
case "$PACKAGER" in case "$PACKAGER" in
apt-get|nala|zypper|pacman) apt-get|nala)
pip3 install --user podman-compose "$ESCALATION_TOOL" "$PACKAGER" install -y podman-compose
export PATH="$HOME/.local/bin:$PATH" ;;
zypper)
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install podman-compose
;;
pacman)
"$ESCALATION_TOOL" "$PACKAGER" -S --noconfirm podman-compose
;; ;;
dnf) dnf)
"$ESCALATION_TOOL" "$PACKAGER" install -y podman-compose "$ESCALATION_TOOL" "$PACKAGER" install -y podman-compose
@ -116,8 +75,7 @@ install_components() {
fi fi
if [ "$INSTALL_COMPOSE" -eq 1 ]; then if [ "$INSTALL_COMPOSE" -eq 1 ]; then
check_python_pip if ! command_exists podman-compose || ! command_exists podman compose version; then
if ! command_exists podman-compose; then
install_podman_compose install_podman_compose
else else
printf "%b\n" "${GREEN}Podman Compose is already installed.${RC}" printf "%b\n" "${GREEN}Podman Compose is already installed.${RC}"