From b4e392fc2086e685c16c388c9736e95b8e749f4b Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 14 May 2019 13:51:27 +0200 Subject: archive: make shellcheck happy --- archive | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'archive') diff --git a/archive b/archive index e7db9f0..4b7aef4 100755 --- a/archive +++ b/archive @@ -28,7 +28,7 @@ find "${master_mirror_root}/archisos" \ t d ' \ - >> "${archive_root}/iso/${file##*/}" + | sponge -a "${archive_root}/iso/${file##*/}" fi [ -f "${archive_root}/iso/${file##*/}" ] && continue ln "${file}" "${archive_root}/iso/${file##*/}" @@ -39,12 +39,14 @@ find "${master_mirror_root}/pool" \ -mindepth 1 \ -maxdepth 1 \ -type f \ -| while read -r file; do - target="${file##*/}" - target="${archive_root}/packages/${target:0:1}/${target%-*-*-*}/${target}" +| sed ' + s,.*/\([^/]\)\([^/]*\)$,\0 \1 \1\2, +' \ +| while read -r path initial file; do + target="${archive_root}/packages/${initial}/${file%-*-*-*}/${file}" [ -f "${target}" ] && continue mkdir -p "${target%/*}" - ln "${file}" "${target}" + ln "${path}" "${target}" done # copy the repositories @@ -74,9 +76,12 @@ if [ ! -d "${todays_path}" ]; then -o -name '*.pkg.tar.xz.sig' \ \) \ -printf '%f\n' \ - | while read -r file; do + | sed ' + s/^./\0 \0/ + ' \ + | while read -r initial file; do ln -s \ - "../../../../../../packages/${file:0:1}/${file%-*-*-*}/${file}" \ + "../../../../../../packages/${initial}/${file%-*-*-*}/${file}" \ "${todays_path}/${arch}/${repo}/${file}" done done -- cgit v1.2.3