Could the verbose option be streamlined in build.sh? Currently we have: # Packages (airootfs) make_packages() { if [[ "${gpg_key}" ]]; then gpg --export "${gpg_key}" > "${work_dir}/gpgkey" exec 17<>"${work_dir}/gpgkey" fi if [ -n "${verbose}" ]; then ARCHISO_GNUPG_FD="${gpg_key:+17}" mkarchiso -v -w "${work_dir}/x86_64" -C "${work_dir}/pacman.conf" -D "${install_dir}" \ -p "$(grep -h -v '^#' "${script_path}/packages.x86_64"| sed ':a;N;$!ba;s/\n/ /g')" install else ARCHISO_GNUPG_FD="${gpg_key:+17}" mkarchiso -w "${work_dir}/x86_64" -C "${work_dir}/pacman.conf" -D "${install_dir}" \ -p "$(grep -h -v '^#' "${script_path}/packages.x86_64"| sed ':a;N;$!ba;s/\n/ /g')" install fi if [[ "${gpg_key}" ]]; then exec 17<&- fi } In place of the -v could you not just have ${verbose} this would remove 5 lines of code (if statement) plus many other statements in script? MrG
On 2020-08-01 08:05:31 (+0100), Mr Green wrote:
Could the verbose option be streamlined in build.sh?
Currently we have:
# Packages (airootfs) make_packages() { if [[ "${gpg_key}" ]]; then gpg --export "${gpg_key}" > "${work_dir}/gpgkey" exec 17<>"${work_dir}/gpgkey" fi if [ -n "${verbose}" ]; then ARCHISO_GNUPG_FD="${gpg_key:+17}" mkarchiso -v -w "${work_dir}/x86_64" -C "${work_dir}/pacman.conf" -D "${install_dir}" \ -p "$(grep -h -v '^#' "${script_path}/packages.x86_64"| sed ':a;N;$!ba;s/\n/ /g')" install else ARCHISO_GNUPG_FD="${gpg_key:+17}" mkarchiso -w "${work_dir}/x86_64" -C "${work_dir}/pacman.conf" -D "${install_dir}" \ -p "$(grep -h -v '^#' "${script_path}/packages.x86_64"| sed ':a;N;$!ba;s/\n/ /g')" install fi if [[ "${gpg_key}" ]]; then exec 17<&- fi }
In place of the -v could you not just have ${verbose} this would remove 5 lines of code (if statement) plus many other statements in script?
MrG
FWIW, we have just (v47.1) deprecated the build.sh scripts in favor of profiles. They will be removed with v49. While in the past few months nl6720 and I have started to refactor and streamline large portions of the code base we also strive to have full shellcheck linting support. This was the main reason for a few instances of code duplication before those were made obsolete by refactoring. Anyways, I hope that the profiles will allow a much more straight forward customization experience to the user. It's not fully fleshed out yet, but I hope that the two standard profiles already stand for themselves and are able to showcase the possibilities. Best, David -- https://sleepmap.de
participants (2)
-
David Runge
-
Mr Green