adjust action arg consumption order

did not properly consider all usage cases properly in deciding placement.

this captured `--usage` in `$PROGRAM --usage` as the action for instance.

Gbp-Dch: Ignore
This commit is contained in:
Lyndon Brown 2020-05-03 00:58:18 +01:00
parent 372a8fd91a
commit 43b4f9cdf6
15 changed files with 45 additions and 45 deletions

View File

@ -18,12 +18,12 @@ set -e
DESCRIPTION="Cache bootstrap stage" DESCRIPTION="Cache bootstrap stage"
USAGE="${PROGRAM} {restore|save} [--force]" USAGE="${PROGRAM} {restore|save} [--force]"
_ACTION="${1}"
shift
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
_ACTION="${1}"
shift
# Check architecture # Check architecture
Check_crossarchitectures Check_crossarchitectures

View File

@ -18,12 +18,12 @@ set -e
DESCRIPTION="Manage /etc/apt/apt.conf" DESCRIPTION="Manage /etc/apt/apt.conf"
USAGE="${PROGRAM} {install|install-binary|remove} [--force]" USAGE="${PROGRAM} {install|install-binary|remove} [--force]"
_ACTION="${1}"
shift
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
_ACTION="${1}"
shift
# Requiring stage file # Requiring stage file
Require_stagefiles config bootstrap Require_stagefiles config bootstrap

View File

@ -18,6 +18,9 @@ set -e
DESCRIPTION="Manage /etc/apt/sources.list" DESCRIPTION="Manage /etc/apt/sources.list"
USAGE="${PROGRAM} {source|binary|chroot} {install|remove} [--force]" USAGE="${PROGRAM} {source|binary|chroot} {install|remove} [--force]"
# Processing arguments and configuration files
Init_config_data "${@}"
_PASS="${1}" _PASS="${1}"
_ACTION="${2}" _ACTION="${2}"
shift 2 shift 2
@ -26,9 +29,6 @@ if ! In_list "${_PASS}" "binary" "chroot" "source"; then
Usage --fail Usage --fail
fi fi
# Processing arguments and configuration files
Init_config_data "${@}"
# Requiring stage file # Requiring stage file
Require_stagefiles config bootstrap Require_stagefiles config bootstrap

View File

@ -18,12 +18,12 @@ set -e
DESCRIPTION="Cache chroot stage" DESCRIPTION="Cache chroot stage"
USAGE="${PROGRAM} {restore|save} [--force]" USAGE="${PROGRAM} {restore|save} [--force]"
_ACTION="${1}"
shift
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
_ACTION="${1}"
shift
if ! In_list "chroot" ${LB_CACHE_STAGES} if ! In_list "chroot" ${LB_CACHE_STAGES}
then then
exit 0 exit 0

View File

@ -18,12 +18,12 @@ set -e
DESCRIPTION="Manage /etc/debian_chroot" DESCRIPTION="Manage /etc/debian_chroot"
USAGE="${PROGRAM} {install|remove} [--force]" USAGE="${PROGRAM} {install|remove} [--force]"
_ACTION="${1}"
shift
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
_ACTION="${1}"
shift
# Requiring stage file # Requiring stage file
Require_stagefiles config bootstrap Require_stagefiles config bootstrap

View File

@ -18,12 +18,12 @@ set -e
DESCRIPTION="Mount /dev/pts" DESCRIPTION="Mount /dev/pts"
USAGE="${PROGRAM} {install|remove} [--force]" USAGE="${PROGRAM} {install|remove} [--force]"
_ACTION="${1}"
shift
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
_ACTION="${1}"
shift
# Requiring stage file # Requiring stage file
Require_stagefiles config bootstrap Require_stagefiles config bootstrap

View File

@ -18,12 +18,12 @@ set -e
DESCRIPTION="Manage /sbin/dpkg" DESCRIPTION="Manage /sbin/dpkg"
USAGE="${PROGRAM} {install|remove} [--force]" USAGE="${PROGRAM} {install|remove} [--force]"
_ACTION="${1}"
shift
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
_ACTION="${1}"
shift
# Requiring stage file # Requiring stage file
Require_stagefiles config bootstrap Require_stagefiles config bootstrap

View File

@ -18,12 +18,12 @@ set -e
DESCRIPTION="Manage /bin/hostname" DESCRIPTION="Manage /bin/hostname"
USAGE="${PROGRAM} {install|remove} [--force]" USAGE="${PROGRAM} {install|remove} [--force]"
_ACTION="${1}"
shift
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
_ACTION="${1}"
shift
# Requiring stage file # Requiring stage file
Require_stagefiles config bootstrap Require_stagefiles config bootstrap

View File

@ -18,12 +18,12 @@ set -e
DESCRIPTION="Manage /etc/hosts" DESCRIPTION="Manage /etc/hosts"
USAGE="${PROGRAM} {install|remove} [--force]" USAGE="${PROGRAM} {install|remove} [--force]"
_ACTION="${1}"
shift
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
_ACTION="${1}"
shift
# Requiring stage file # Requiring stage file
Require_stagefiles config bootstrap Require_stagefiles config bootstrap

View File

@ -18,12 +18,12 @@ set -e
DESCRIPTION="Mount /proc" DESCRIPTION="Mount /proc"
USAGE="${PROGRAM} {install|remove} [--force]" USAGE="${PROGRAM} {install|remove} [--force]"
_ACTION="${1}"
shift
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
_ACTION="${1}"
shift
# Requiring stage file # Requiring stage file
Require_stagefiles config bootstrap Require_stagefiles config bootstrap

View File

@ -18,12 +18,12 @@ set -e
DESCRIPTION="Manage /etc/resolv.conf" DESCRIPTION="Manage /etc/resolv.conf"
USAGE="${PROGRAM} {install|remove} [--force]" USAGE="${PROGRAM} {install|remove} [--force]"
_ACTION="${1}"
shift
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
_ACTION="${1}"
shift
# Requiring stage file # Requiring stage file
Require_stagefiles config bootstrap Require_stagefiles config bootstrap

View File

@ -18,12 +18,12 @@ set -e
DESCRIPTION="Mount /sys/fs/selinux" DESCRIPTION="Mount /sys/fs/selinux"
USAGE="${PROGRAM} {install|remove} [--force]" USAGE="${PROGRAM} {install|remove} [--force]"
_ACTION="${1}"
shift
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
_ACTION="${1}"
shift
# Requiring stage file # Requiring stage file
Require_stagefiles config bootstrap Require_stagefiles config bootstrap

View File

@ -18,12 +18,12 @@ set -e
DESCRIPTION="Mount /sys" DESCRIPTION="Mount /sys"
USAGE="${PROGRAM} {install|remove} [--force]" USAGE="${PROGRAM} {install|remove} [--force]"
_ACTION="${1}"
shift
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
_ACTION="${1}"
shift
# Requiring stage file # Requiring stage file
Require_stagefiles config bootstrap Require_stagefiles config bootstrap

View File

@ -18,12 +18,12 @@ set -e
DESCRIPTION="Manage /usr/sbin/policy-rc.d" DESCRIPTION="Manage /usr/sbin/policy-rc.d"
USAGE="${PROGRAM} {install|remove} [--force]" USAGE="${PROGRAM} {install|remove} [--force]"
_ACTION="${1}"
shift
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
_ACTION="${1}"
shift
# Requiring stage file # Requiring stage file
Require_stagefiles config bootstrap Require_stagefiles config bootstrap

View File

@ -18,12 +18,12 @@ set -e
DESCRIPTION="Use tmpfs to speedup the build" DESCRIPTION="Use tmpfs to speedup the build"
USAGE="${PROGRAM} {install|remove} [--force]" USAGE="${PROGRAM} {install|remove} [--force]"
_ACTION="${1}"
shift
# Processing arguments and configuration files # Processing arguments and configuration files
Init_config_data "${@}" Init_config_data "${@}"
_ACTION="${1}"
shift
if [ "${LB_BUILD_WITH_TMPFS}" != "true" ] if [ "${LB_BUILD_WITH_TMPFS}" != "true" ]
then then
exit 0 exit 0