Avoid needlessly breaking old initscripts that set EXTRA_COMMANDS. This
will aid in debugging (as it simplifies reverting to an older version of
a package) and unbreaks third-party feeds (and packages that maintain
their OpenWrt initscripts as part of the software's repo instead of the
OpenWrt feed like fastd).
Without this, initscripts that set EXTRA_COMMANDS become completely
unusable, as all default commands like start/stop cease working.
Fixes: 1a69f50dc627 ("base-files: fix rc.common help alignment")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
include $(INCLUDE_DIR)/feeds.mk
PKG_NAME:=base-files
-PKG_RELEASE:=236
+PKG_RELEASE:=237
PKG_FLAGS:=nonshared
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
return 0
}
-EXTRA_HELP=""
-EXTRA_COMMANDS="boot shutdown depends"
+ALL_HELP=""
+ALL_COMMANDS="boot shutdown depends"
extra_command() {
local cmd="$1"
local help="$2"
local extra="$(printf "%-16s%s" "${cmd}" "${help}")"
- EXTRA_HELP="${EXTRA_HELP}\t${extra}\n"
- EXTRA_COMMANDS="${EXTRA_COMMANDS} ${cmd}"
+ ALL_HELP="${ALL_HELP}\t${extra}\n"
+ ALL_COMMANDS="${ALL_COMMANDS} ${cmd}"
}
help() {
Available commands:
EOF
- echo -e "$EXTRA_HELP"
+ echo -e "$ALL_HELP"
}
# for procd
}
}
-ALL_COMMANDS="${EXTRA_COMMANDS}"
+ALL_COMMANDS="${ALL_COMMANDS} ${EXTRA_COMMANDS}"
+ALL_HELP="${ALL_HELP}${EXTRA_HELP}"
list_contains ALL_COMMANDS "$action" || action=help
$action "$@"