Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 35 additions & 13 deletions package/packages-signed-by
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,38 @@ parallel_common_command=(
"grep --quiet -- '${KEY_ID}'"
)

case $OUTPUT_FORMAT in
filename)
# shellcheck disable=SC2029
ssh "${SEARCH_HOST}" "parallel \"${parallel_common_command[*]} && echo {/.}\" ::: /srv/ftp/pool/packages/*.pkg.tar.*.sig"
;;
packagename)
# shellcheck disable=SC2016 # $3 is to be used by awk and not bash
awk_search='/pkgname/ { print \$3 }'

# shellcheck disable=SC2029
ssh "${SEARCH_HOST}" "parallel \"${parallel_common_command[*]} && bsdtar xfO {.} .BUILDINFO | awk '${awk_search}'\" ::: /srv/ftp/pool/packages/*.pkg.tar.*.sig"
;;
esac
REPOSITORIES=(
core
core-testing
core-staging
extra
extra-testing
extra-staging
multilib
multilib-testing
multilib-staging
gnome-unstable
kde-unstable
)
ARCHITECTURES=(
x86_64
)

for arch in "${ARCHITECTURES[@]}"; do
for repo in "${REPOSITORIES[@]}"; do
Comment on lines +112 to +113
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you enable extglob through bash -c you could have negative globs instead of the double for-loop. It might be faster as you would not be executing as many ssh connections?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think given how seldomly this command is used there is not much point in optimizing it 🤔 Could you point out how the extglob solution would roughly work ? 🤔

Copy link
Member

@Foxboron Foxboron Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I'm being silly. You don't need to make this more complicated I think?

"/srv/ftp/*/os/*/*.pkg.tar.*.sig"

Should avoid peaking into /srv/ftp/pool and you avoid the double for loop? Am I overlooking anything?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ye, debug packages are omitted from this search.

bash -O extglob -c 'file /srv/ftp/!(*-debug)/os/*/*.pkg.tar.*.sig'

Something like the above could work.

case $OUTPUT_FORMAT in
filename)
# shellcheck disable=SC2029
ssh "${SEARCH_HOST}" "parallel \"${parallel_common_command[*]} && echo {/.}\" ::: /srv/ftp/${repo}/os/${arch}/*.pkg.tar.*.sig"
;;
packagename)
# shellcheck disable=SC2016 # $3 is to be used by awk and not bash
awk_search='/pkgname/ { print \$3 }'

# shellcheck disable=SC2029
ssh "${SEARCH_HOST}" "parallel \"${parallel_common_command[*]} && bsdtar xfO {.} .BUILDINFO | awk '${awk_search}'\" ::: /srv/ftp/${repo}/os/${arch}/*.pkg.tar.*.sig"
;;
esac
done
done