mim: run scripts from a specification file
No binary (build failed)
—
(log yok)
| @@ -0,0 +1,39 @@ | |
| + | #!/bin/sh |
| + | MIMFILE="Mimfile" |
| + | if [ $# -ge 2 ] && [ "$1" = "-f" ] |
| + | then |
| + | MIMFILE="$2" |
| + | shift 2 |
| + | fi |
| + | exec <"$MIMFILE" || exit 1 |
| + | { |
| + | INCASE=false |
| + | while read -r REPLY |
| + | do |
| + | case $REPLY in |
| + | *:) |
| + | if ! $INCASE |
| + | then |
| + | printf '[ $# -eq 0 ] && set -- "%s" |
| + | TARGET="$1" |
| + | shift |
| + | case "$TARGET" in |
| + | ' "${REPLY%:}" |
| + | else |
| + | printf ';;\n' |
| + | fi |
| + | printf '%s)\n' "${REPLY%:}" |
| + | INCASE=true |
| + | ;; |
| + | "") ;; |
| + | *) printf '%s\n' "${REPLY##[ ]}";; |
| + | esac |
| + | done |
| + | $INCASE && printf ';;\n' |
| + | printf '*) |
| + | echo "Unknown command $TARGET" |
| + | exit 1 |
| + | ;; |
| + | esac |
| + | ' |
| + | } | sh -s "$@" |
| @@ -0,0 +1,15 @@ | |
| + | //config:config MIM |
| + | //config: bool "mim (0.5 kb)" |
| + | //config: default y |
| + | //config: depends on FEATURE_SH_EMBEDDED_SCRIPTS |
| + | //config: help |
| + | //config: Run a script from a Makefile-like specification file. |
| + | //config: Unlike 'make' dependencies aren't supported. |
| + | |
| + | //applet:IF_MIM(APPLET_SCRIPTED(mim, scripted, BB_DIR_USR_SBIN, BB_SUID_DROP, mim)) |
| + | |
| + | //usage:#define mim_trivial_usage |
| + | //usage: "[-f FILE] [SHELL_OPTIONS] [TARGET] ..." |
| + | //usage:#define mim_full_usage "\n\n" |
| + | //usage: "Run a script from a Makefile-like specification file\n" |
| + | //usage: "\n -f FILE Spec file (default Mimfile)" |