X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fcore%2Ffunctions.sh;h=aa9c512a918cfa91703226c4f77a1efe413b85d4;hb=c041a073fe44baafa4ebcb516c7d377d52fff054;hp=1cb2a2e4007ea9c308d8e041696d6d60c97172ba;hpb=b51411a29f1a751a09e69f5676afeea24a94ac83;p=feisty_meow.git diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index 1cb2a2e4..aa9c512a 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -172,15 +172,25 @@ if [ -z "$skip_all" ]; then # we always remove dos slashes in favor of forward slashes. echo "$1" | sed -e 's/\\/\//g' | sed -e 's/\([a-zA-Z]\):\/\(.*\)/\/\1\/\2/' } - - # su function: makes su perform a login. - # for some OSes, this transfers the X authority information to the new login. - function su() { + + # returns a successful value (0) if this system is debian or ubuntu. + function debian_like() { # decide if we think this is debian or ubuntu or a variant. DEBIAN_LIKE=$(if [ ! -z "$(grep -i debian /etc/issue)" \ -o ! -z "$(grep -i ubuntu /etc/issue)" ]; then echo 1; else echo 0; fi) - if [ $DEBIAN_LIKE -eq 1 ]; then + # success; this is debianish. + return 0 + else + # this seems like some other OS. + return 1 + fi + } + + # su function: makes su perform a login. + # for some OSes, this transfers the X authority information to the new login. + function su() { + if debian_like; then # debian currently requires the full version which imports X authority # information for su. @@ -230,7 +240,7 @@ if [ -z "$skip_all" ]; then if [ -z "$wheres_nechung" ]; then echo "The nechung oracle program cannot be found. You may want to consider" echo "rebuilding the feisty meow applications with this command:" - echo " bash $FEISTY_MEOW_DIR/scripts/generator/bootstrap_build.sh" + echo " bash $FEISTY_MEOW_SCRIPTS/generator/bootstrap_build.sh" else $wheres_nechung fi