Skip to content

Commit 042ad2d

Browse files
committed
fix filelist using find
1 parent f579a87 commit 042ad2d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/publish-rpm-packages.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ aws s3 sync s3://${RPM_BUCKET_NAME}/${RPM_REPO_PATH}/ rpm-repo/ --endpoint-url "
5454
# Create repository metadata for each architecture
5555
printf "\n>>> Creating repository metadata \n"
5656
for arch in x86_64 i386 aarch64; do
57-
if [ -d "rpm-repo/${arch}" ] && [ "$(ls -A rpm-repo/${arch})" ]; then
57+
if [ -d "rpm-repo/${arch}" ] && [ -n "$(find "rpm-repo/${arch}" -mindepth 1 -maxdepth 1 -print -quit)" ]; then
5858
printf "Creating metadata for %s...\n" "$arch"
5959

6060
# List what we're working with
61-
printf "Files in %s: %s\n" "$arch" "$(ls "rpm-repo/${arch}/" | tr '\n' ' ')"
61+
file_list=$(find "rpm-repo/${arch}" -maxdepth 1 -type f -exec basename {} \; | tr '\n' ' ')
62+
printf "Files in %s: %s\n" "$arch" "${file_list% }"
6263

6364
# Create repository metadata
6465
createrepo_c --update rpm-repo/${arch}

0 commit comments

Comments
 (0)