summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-09-22 22:03:45 +0200
committerGitHub <noreply@github.com>2022-09-22 22:03:45 +0200
commit0d65c2481973a956bb90e393814a18ceb6389450 (patch)
treec15cd54ece80fb2fc7a87953a9d0bfc45a91f631
parent08993516a939576fa009db6e7ed32524026a822d (diff)
parent23195646dc3d9685be75a063434b38b6a14cdcd3 (diff)
downloadpodman-0d65c2481973a956bb90e393814a18ceb6389450.tar.gz
podman-0d65c2481973a956bb90e393814a18ceb6389450.tar.bz2
podman-0d65c2481973a956bb90e393814a18ceb6389450.zip
Merge pull request #15854 from anjannath/issue_15831
pkginstaller: use path_helper to add podman and helpers to path
-rwxr-xr-xcontrib/pkginstaller/scripts/postinstall21
-rwxr-xr-xcontrib/pkginstaller/scripts/preinstall4
2 files changed, 5 insertions, 20 deletions
diff --git a/contrib/pkginstaller/scripts/postinstall b/contrib/pkginstaller/scripts/postinstall
index db17eede8..c62971a14 100755
--- a/contrib/pkginstaller/scripts/postinstall
+++ b/contrib/pkginstaller/scripts/postinstall
@@ -2,26 +2,7 @@
set -e
-BZSH_PODMAN_PATH_EXP='PATH="/opt/podman/bin:$PATH"'
-FISH_PODMAN_PATH_EXP='set PATH "/opt/podman/bin $PATH"'
-BASHRC_PATH="$HOME/.bash_profile"
-ZSHENV_PATH="$HOME/.zshenv"
-ZSHRC_PATH="$HOME/.zshrc"
-FSHCFG_PATH="$HOME/.config/fish/config.fish"
-
-# append /Applications/podman/bin to $PATH
-if [ -f "$BASHRC_PATH" ]; then
- grep -Fxq "$BZSH_PODMAN_PATH_EXP" "$BASHRC_PATH" || echo "$BZSH_PODMAN_PATH_EXP" >> "$BASHRC_PATH"
-fi
-if [ -f "$ZSHENV_PATH" ]; then
- grep -Fxq "$BZSH_PODMAN_PATH_EXP" "$ZSHENV_PATH" || echo "$BZSH_PODMAN_PATH_EXP" >> "$ZSHENV_PATH"
-fi
-if [ -f "$ZSHRC_PATH" ]; then
- grep -Fxq "$BZSH_PODMAN_PATH_EXP" "$ZSHRC_PATH" || echo "$BZSH_PODMAN_PATH_EXP" >> "$ZSHRC_PATH"
-fi
-if [ -f "$FSHCFG_PATH" ]; then
- grep -Fxq "$FISH_PODMAN_PATH_EXP" "$FSHCFG_PATH" || echo "$FISH_PODMAN_PATH_EXP" >> "$FSHCFG_PATH"
-fi
+echo "/opt/podman/bin" > /etc/paths.d/podman-pkg
ln -s /opt/podman/bin/podman-mac-helper /opt/podman/qemu/bin/podman-mac-helper
ln -s /opt/podman/bin/gvproxy /opt/podman/qemu/bin/gvproxy
diff --git a/contrib/pkginstaller/scripts/preinstall b/contrib/pkginstaller/scripts/preinstall
index a381868fc..22336222f 100755
--- a/contrib/pkginstaller/scripts/preinstall
+++ b/contrib/pkginstaller/scripts/preinstall
@@ -3,3 +3,7 @@
set -e
rm -rf /opt/podman
+
+if [ ! -d "/etc/paths.d" ]; then
+ mkdir -p /etc/paths.d
+fi