[yast-commit] r55196 - /trunk/yast2/scripts/yast2
Author: mvidner Date: Tue Feb 3 09:26:15 2009 New Revision: 55196 URL: http://svn.opensuse.org/viewcvs/yast?rev=55196&view=rev Log: Fixed prefix detection if called "bash -x yast2" (bnc#458385 c12). Modified: trunk/yast2/scripts/yast2 Modified: trunk/yast2/scripts/yast2 URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/scripts/yast2?rev=55196&r1=55195&r2=55196&view=diff ============================================================================== --- trunk/yast2/scripts/yast2 (original) +++ trunk/yast2/scripts/yast2 Tue Feb 3 09:26:15 2009 @@ -16,8 +16,11 @@ export PATH=/sbin:/usr/sbin:$PATH # allow for a different prefix -mydir=${0%/[YyZz]a[Ss][Tt]*} -if [[ -z "$mydir" || "$mydir" =~ ^/sbin/* ]]; then +# strip the basename off $0, which can be: (bnc#382216, bnc#458385) +# /sbin/yast2, /sbin/yast, yast2 (sh -x yast2 ...), /sbin//yast2 (PATH=/sbin/:...) +shopt -s extglob +mydir=${0%%*(/)[YyZz]a[Ss][Tt]?(2)} +if [[ -z "$mydir" || "$mydir" = /sbin ]]; then YAST_PREFIX=/usr else YAST_PREFIX=${mydir%/sbin} -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
mvidner@svn.opensuse.org