Browse Source

Make saturnin subcommand more portable

Alois Mahdal 9 years ago
parent
commit
8a5dd0f421
2 changed files with 5 additions and 2 deletions
  1. 1
    0
      src/bin/saturnin.skel
  2. 4
    2
      src/ffoo/saturnin_meta.sh

+ 1
- 0
src/bin/saturnin.skel View File

@@ -22,6 +22,7 @@ FFOO_PATH="__SATURNIN_FFOO_DIR__"
22 22
 FFOO_PRETTY_USAGE="subcommand"
23 23
 SATURNIN_CACHE_HOME="__SATURNIN_CACHE_HOME__"
24 24
 SATURNIN_LIBEXEC="__SATURNIN_LIBEXEC__"
25
+SATURNIN_LIBEXEC_PREFIX="saturnin-"
25 26
 SATURNIN_VERSION="__VERSION__"
26 27
 
27 28
 #

+ 4
- 2
src/ffoo/saturnin_meta.sh View File

@@ -22,7 +22,7 @@ saturnin_lssc() {
22 22
         -mindepth 1 \
23 23
         -maxdepth 1 \
24 24
         -executable \
25
-      | sed -e 's/.*saturnin-//' \
25
+      | sed -e "s|^.*/||; s|^$SATURNIN_LIBEXEC_PREFIX||" \
26 26
       | sort
27 27
 }
28 28
 
@@ -46,7 +46,9 @@ saturnin_runhook() {
46 46
 }
47 47
 
48 48
 saturnin_runsc() {
49
-    local lexpath="$SATURNIN_LIBEXEC/saturnin-$SATURNIN_SUBCOMMAND"
49
+    local lexpath
50
+    lexpath+="$SATURNIN_LIBEXEC/"
51
+    lexpath+="$SATURNIN_LIBEXEC_PREFIX$SATURNIN_SUBCOMMAND"
50 52
     debug -v lexpath
51 53
     debug "\$*='$*'"
52 54
     test -x "$lexpath" || {