From fa877a116c4b5b62eb7a192c69e2fdb51bef918e Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Fri, 10 Jan 2025 16:22:15 +0100 Subject: [PATCH 1/2] prun: Add whitespace --- prun/prun | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prun/prun b/prun/prun index b9b7bdf1..ccfa9782 100755 --- a/prun/prun +++ b/prun/prun @@ -3,8 +3,8 @@ if [ $# -lt 2 ]; then echo "usage: prun package command ..." >&2 exit 1 fi -arg1=$1;shift +arg1=$1; shift set -- $arg1 "$@" -pkg=$1;shift; +pkg=$1; shift; . /usr/local/package/lib/$pkg.profile exec "$@" From 2d361402b86ba3fe2d70f1d262c3d00830877d10 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Fri, 10 Jan 2025 16:22:30 +0100 Subject: [PATCH 2/2] prun: Allow profile filename as package name Allow the package profile filename to be specified directly. If the first parameter contains a "/" character, it is interpreted as a filename and not as a package name. Original usage example: prun python-3.9 New usage example: prun /project/mx/profile postsuper --- prun/prun | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/prun/prun b/prun/prun index ccfa9782..ca93244e 100755 --- a/prun/prun +++ b/prun/prun @@ -6,5 +6,9 @@ fi arg1=$1; shift set -- $arg1 "$@" pkg=$1; shift; -. /usr/local/package/lib/$pkg.profile +if [[ "$pkg" == */* ]]; then + . $pkg +else + . /usr/local/package/lib/$pkg.profile +fi exec "$@"