aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2023-10-08 16:07:20 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2023-10-08 16:07:20 -0700
commit9c04ea27acdff25c41efd343713268b8dbf6b091 (patch)
treed1796db91eade8557baba42fee9a2f517de90985 /scripts
parentcopy_buildsync: fix tempfile for OUT_ISO & OUT_STAGE, plus comments (diff)
downloadreleng-9c04ea27acdff25c41efd343713268b8dbf6b091.tar.gz
releng-9c04ea27acdff25c41efd343713268b8dbf6b091.tar.bz2
releng-9c04ea27acdff25c41efd343713268b8dbf6b091.zip
copy_buildsync: convert current-* to directory instead of symlink
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/copy_buildsync.sh25
1 files changed, 23 insertions, 2 deletions
diff --git a/scripts/copy_buildsync.sh b/scripts/copy_buildsync.sh
index 851ccb57..9a13872a 100755
--- a/scripts/copy_buildsync.sh
+++ b/scripts/copy_buildsync.sh
@@ -200,8 +200,24 @@ process_arch() {
echo -e "${variant_path} ${size}" >>"${f_tmp}"
[[ ${variant_path} =~ tar.*$ ]] && echo -e "${variant_path} ${size}" >>"${OUT_STAGE3_tmp}"
[[ ${variant_path} =~ iso$ ]] && echo -e "${variant_path} ${size}" >>"${OUT_ISO_tmp}"
- rm -f "current-$v"
- ln -sf "${variant_path%/*}" "current-$v"
+
+ # Previously, current-${v}/ was a symlink to the timestamp directory.
+ # This was apparently confusing to some users because it had way too many files.
+ # So instead make current-${v}/ a directory, containing just symlinks to
+ # the selected build.
+ #
+ # Link the files for a given variant into a current-${v}/ directory.
+ # If it's an old link, remove to convert to directory.
+ if test -l "current-$v" ; then rm "current-$v" ; fi
+ mkdir -p "current-$v"
+
+ # Remove old links in the directory.
+ find "current-$v" -type l ! -name "$f" ! -name "${variant_date}*"
+
+ # install new links
+ # do NOT use -f here, we do not want to override the existing files.
+ # this will ensure the mtime of the links does not change in most cases.
+ ln -s --target-directory="current-$v"/ "../${variant_path}"*
# Update keepfile
echo "${variant_path}" | sed -e 's,/.*,,g' -e 's,^,/,g' -e 's,$,$,g' >>"${keepfile_tmp}"
@@ -209,6 +225,11 @@ process_arch() {
# Place latest-*txt into place in the base arch dir.
mv -f "${f_tmp}" "${f}"
+ # current-${variant}/latest-${variant}.txt contains the RELATIVE filename
+ # So we have to strip the leading directory on the path.
+ # reuse the tmpfile from $f
+ sed "s,^${variant_date}/,,g" <"${f}" >"${f_tmp}" && mv -f "${f_tmp}" "current-$v"/"${f}"
+
done
# Atomic move these files if created.