~gotmax23/fedrq

b4b7ec3b353c087bbd47d31c296726765c474a69 — Maxwell G 2 months ago 8591e65
lint: fix shellcheck errors in tests/test_data/build.sh
1 files changed, 8 insertions(+), 5 deletions(-)

M tests/test_data/build.sh
M tests/test_data/build.sh => tests/test_data/build.sh +8 -5
@@ 1,9 1,11 @@
#!/usr/bin/bash

# SPDX-FileCopyrightText: 2022 Maxwell G <gotmax@e.email>
# SPDX-License-Identifier: GPL-2.0-or-later

#!/usr/bin/bash
set -euo pipefail
cd "$(readlink -f $(dirname ${0}))"
HERE="$(readlink -f "$(dirname "${0}")")"
cd "${HERE}"

# Return 1 if the repodata is up to date
# Return 0 if the repodata needs to be regenerated


@@ 12,8 14,9 @@ regenerate() {

    { [ -f "built" ] && [ -d "repo/repodata" ]; } || return 0

    local built_files="$(awk '{print $2}' built | sort)"
    local fs_files="$(find specs/ -name '*.spec' | sort)"
    local built_files fs_files
    built_files="$(awk '{print $2}' built | sort)"
    fs_files="$(find specs/ -name '*.spec' | sort)"
    [ "${built_files}" = "${fs_files}" ] || return 0

    sha256sum -c built &> /dev/null || return 0


@@ 26,7 29,7 @@ for repo in repos/*; do
    specs="$(find specs -name '*.spec')"
    if regenerate "$@"; then
        rm -rf repo
        printf "${specs}\n"
        echo "${specs}"
        while read -r spec; do
            specdir="$(dirname "${spec}")"
            base_specdir="$(basename "${specdir}")"