diff options
author | Lyndon Brown <jnqnfe@gmail.com> | 2020-05-02 14:49:45 +0100 |
---|---|---|
committer | Lyndon Brown <jnqnfe@gmail.com> | 2020-05-02 14:49:45 +0100 |
commit | 2d7ff4934d721f38ac5274c866e44e20d3bda2e8 (patch) | |
tree | ceff49ad2a9dc8496207102412a0195aae867f3b /scripts | |
parent | b20979334cc28c345b2b72da30c3591fb5c85882 (diff) | |
download | vyos-live-build-2d7ff4934d721f38ac5274c866e44e20d3bda2e8.tar.gz vyos-live-build-2d7ff4934d721f38ac5274c866e44e20d3bda2e8.zip |
improve stagefiles encapsulation
- added and used Stagefiles_dir()
- added and used Stagefile_exists()
pretty self explanatory.
Gbp-Dch: Short
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build/chroot_prep | 2 | ||||
-rwxr-xr-x | scripts/build/clean | 12 | ||||
-rwxr-xr-x | scripts/build/config | 2 |
3 files changed, 9 insertions, 7 deletions
diff --git a/scripts/build/chroot_prep b/scripts/build/chroot_prep index f9ebdea5f..b62bbb0fa 100755 --- a/scripts/build/chroot_prep +++ b/scripts/build/chroot_prep @@ -94,7 +94,7 @@ if In_list "archives" ${HELPERS} && [ -z "${ARCHIVES_PASS}" ]; then exit 1 fi -if In_list "archives" ${HELPERS} && [ ! -e .build/bootstrap ]; then +if In_list "archives" ${HELPERS} && ! Stagefile_exists bootstrap; then Echo_warning "The 'archives' helper is selected, but the bootstrap stage has not completed." fi diff --git a/scripts/build/clean b/scripts/build/clean index b8e613f7f..32a198399 100755 --- a/scripts/build/clean +++ b/scripts/build/clean @@ -46,6 +46,8 @@ else ARGUMENTS="${@}" fi +STAGEFILES_DIR="$(Stagefiles_dir)" + for ARGUMENT in ${ARGUMENTS} do case "${ARGUMENT}" in @@ -85,7 +87,7 @@ do rm -f chroot.packages.live chroot.packages.install rm -f chroot.files - rm -f .build/chroot* + rm -f "${STAGEFILES_DIR}"/chroot* ;; --binary) @@ -104,7 +106,7 @@ do rm -rf binary rm -rf tftpboot - rm -f .build/binary* + rm -f "${STAGEFILES_DIR}"/binary* ;; --remove) @@ -118,12 +120,12 @@ do if [ -e auto/config ] then - rm -f .build/config + Remove_stagefile config fi ;; --stage) - rm -rf .build/* + rm -rf "${STAGEFILES_DIR}"/* ;; --source) @@ -136,7 +138,7 @@ do rm -rf source - rm -f .build/source* + rm -f "${STAGEFILES_DIR}"/source* ;; -h|--help) diff --git a/scripts/build/config b/scripts/build/config index dc79d08f9..3a79c9f88 100755 --- a/scripts/build/config +++ b/scripts/build/config @@ -871,7 +871,7 @@ fi # Ignoring --config if CWD already has a config # Only print warning from direct execution, not when run from auto script redirection, to avoid repetition -if [ -e .build/config ] && [ -n "${_CONFIG}" ] +if Stagefile_exists && [ -n "${_CONFIG}" ] then if [ "${1}" != "noauto" ] then |