diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2022-01-17 13:19:23 +0330 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-01-17 11:17:15 +0100 |
commit | 63b02859bc0e7595c8f6b10453bb1e5394223d3f (patch) | |
tree | a64697ed5d5048fa0a52a94db130980b11c5c584 /Ports | |
parent | 7a26f6523a2fa7abe2fe410550112fe5ebd4151c (diff) | |
download | serenity-63b02859bc0e7595c8f6b10453bb1e5394223d3f.zip |
Meta+Ports: Make 'package.sh showproperty' report multiple properties
And use that to avoid shelling out multiple times for checking
properties in lint-ports.py.
Diffstat (limited to 'Ports')
-rwxr-xr-x | Ports/.port_include.sh | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh index 2545272c49..1a2cf1f151 100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -543,18 +543,22 @@ do_uninstall() { uninstall } do_showproperty() { - if ! declare -p "${1}" > /dev/null 2>&1; then - echo "Property '$1' is not set." >&2 - exit 1 - fi - property_declaration="$(declare -p "${1}")" - if [[ "$property_declaration" =~ "declare -a" ]]; then - prop_array="${1}[@]" - # Some magic to avoid empty arrays being considered unset. - echo "${!prop_array+"${!prop_array}"}" - else - echo ${!1} - fi + while [ $# -gt 0 ]; do + if ! declare -p "${1}" > /dev/null 2>&1; then + echo "Property '$1' is not set." >&2 + exit 1 + fi + property_declaration="$(declare -p "${1}")" + if [[ "$property_declaration" =~ "declare -a" ]]; then + prop_array="${1}[@]" + # Some magic to avoid empty arrays being considered unset. + echo "${!prop_array+"${!prop_array}"}" + else + echo ${!1} + fi + printf '\n' + shift + done } do_all() { do_installdepends |