diff --git a/README.md b/README.md index cf38b43..9b31f14 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,9 @@ Replace `bash -c ...` with `sudo bash -c ...` to install system-wide. You can also paste this directly into a Dockerfile `RUN` command, no escaping needed. ``` -wget -qO- https://raw.githubusercontent.com/orbit-online/upkg/v0.11.0/upkg.sh | (\ +wget -qO- https://raw.githubusercontent.com/orbit-online/upkg/v0.11.1/upkg.sh | (\ set +e; IFS='' read -r -d $'\0' src; set -e;\ - printf '%s' "$src" | shasum -a 256 -c <(printf '30f5315b882bb2577ff783042ee75f9ed005d04a8b52ec4adc851205874e8db9 -');\ + printf '%s' "$src" | shasum -a 256 -c <(printf '43298eaec88ae0d116e2f49934de266b7a93f72c52929a8bd0edb4a3b4aacd36 -');\ bash -c "set - install -g orbit-online/upkg@v0.11.0; $src") ``` diff --git a/upkg.sh b/upkg.sh index 3897cf1..a70d069 100755 --- a/upkg.sh +++ b/upkg.sh @@ -138,7 +138,7 @@ upkg_install() { fatal "Error on command '%s' in package %s@%s. The command may not contain spaces or slashes" \ "$command" "$pkgname" "$pkgversion" cmdpath="$binpath/$command" - if [[ -e $cmdpath || -L $cmdpath ]] && [[ $(realpath "$cmdpath" 2>/dev/null || true) != $pkgpath/* ]]; then + if [[ -e $cmdpath || -L $cmdpath ]] && [[ $(realpath -m "$cmdpath") != $pkgpath/* ]]; then fatal "Error on command '%s' in package %s@%s. The 'bin/' file/symlink exists \ and does not point to the package" "$command" "$pkgname" "$pkgversion" fi @@ -200,7 +200,7 @@ upkg_uninstall() { while [[ -n $commands ]] && read -r -d $'\n' command; do read -r -d $'\n' asset cmdpath="$binpath/$command" - [[ ! -e $cmdpath || $(realpath "$cmdpath") != $pkgpath/* ]] || rm "$cmdpath" + [[ ! -e $cmdpath || $(realpath -m "$cmdpath") != $pkgpath/* ]] || rm "$cmdpath" done <<<"$commands" if [[ -n $deps_to_remove ]]; then find "$pkgpath" -mindepth 1 -maxdepth 1 -path "$pkgpath/.upkg" -prune -o -exec rm -rf \{\} \; @@ -229,7 +229,7 @@ upkg_list() { upkg_root() ( local sourcing_file=$1 - [[ -z $sourcing_file ]] || cd "$(dirname "$(realpath "${sourcing_file}")")" + [[ -z $sourcing_file ]] || cd "$(dirname "$(realpath -m "${sourcing_file}")")" until [[ -e $PWD/upkg.json ]]; do [[ $PWD != '/' ]] || fatal 'Unable to find package root (no upkg.json found in this or any parent directory)' cd ..