commit:     bddb1598ab7a6de741460dabf88bb2c86eeeda2d
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Thu Jan  8 15:55:49 2026 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Thu Jan  8 15:56:12 2026 +0000
URL:        https://gitweb.gentoo.org/proj/releng.git/commit/?id=bddb1598

Add sync logic for wsl files

Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 scripts/copy_buildsync.sh | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/scripts/copy_buildsync.sh b/scripts/copy_buildsync.sh
index 3cebb2c3..316cc327 100755
--- a/scripts/copy_buildsync.sh
+++ b/scripts/copy_buildsync.sh
@@ -43,6 +43,7 @@ EXTENSIONS=(
 OUT_STAGE3="latest-stage3.txt"
 OUT_ISO="latest-iso.txt"
 OUT_QCOW2="latest-qcow2.txt"
+OUT_WSL="latest-wsl.txt"
 
 # Nothing to edit beyond this point
 
@@ -146,20 +147,24 @@ process_arch() {
 
        iso_list="$(find 20* -name '*.iso' -printf '%h %f %h/%f\n' 2>/dev/null 
|grep -v hardened | sort -n)"
        qcow2_list="$(find 20* -name '*.qcow2' -printf '%h %f %h/%f\n' 
2>/dev/null |grep -v hardened | sort -n)"
+       wsl_list="$(find 20* -name '*.wsl' -printf '%h %f %h/%f\n' 2>/dev/null 
|grep -v hardened | sort -n)"
        stage3_list=$(find 20* -name "stage3*" -a "${EXTENSIONS[@]}" -printf 
'%h %f %h/%f\n' 2>/dev/null| grep -v hardened | sort -n)
        latest_iso_date="$(echo -e "${iso_list}" |awk '{print $1}' |cut -d/ -f1 
| tail -n1)"
        latest_qcow2_date="$(echo -e "${qcow2_list}" |awk '{print $1}' |cut -d/ 
-f1 | tail -n1)"
+       latest_wsl_date="$(echo -e "${wsl_list}" |awk '{print $1}' |cut -d/ -f1 
| tail -n1)"
        latest_stage3_date="$(echo -e "${stage3_list}" |awk '{print $1}' |cut 
-d/ -f1 | tail -n1)"
        header="$(echo -e "# Latest as of $(date -uR)\n# ts=$(date -u +%s)")"
 
        # Do not remove this
        [ -z "${latest_iso_date}" ] && latest_iso_date="NONE-FOUND"
        [ -z "${latest_qcow2_date}" ] && latest_qcow2_date="NONE-FOUND"
+       [ -z "${latest_wsl_date}" ] && latest_wsl_date="NONE-FOUND"
        [ -z "${latest_stage3_date}" ] && latest_stage3_date="NONE-FOUND"
 
 
        OUT_ISO_tmp=""
        OUT_QCOW2_tmp=""
+       OUT_WSL_tmp=""
        OUT_STAGE3_tmp=""
        if [ -n "${iso_list}" ]; then
                OUT_ISO_tmp=$(mktemp -p . -t ".${OUT_ISO}.XXXXXX")
@@ -177,6 +182,14 @@ process_arch() {
                # So let's not advertise a current one via a symlink in general.
                rm -f current-qcow2
        fi
+       if [ -n "${wsl_list}" ]; then
+               OUT_WSL_tmp=$(mktemp -p . -t ".${OUT_WSL}.XXXXXX")
+               chmod 644 "${OUT_WSL_tmp}"
+               echo -e "${header}" >"${OUT_WSL_tmp}"
+               # Some arches produce more than one type of wsl.
+               # So let's not advertise a current one via a symlink in general.
+               rm -f current-wsl
+       fi
        if [ -n "${stage3_list}" ]; then
                OUT_STAGE3_tmp=$(mktemp -p . -t ".${OUT_STAGE3}.XXXXXX")
                chmod 644 "${OUT_STAGE3_tmp}"
@@ -186,7 +199,7 @@ process_arch() {
        fi
 
        # New variant preserve code
-       find_variants=( '(' -iname '*.iso' -o -iname '*.qcow2' -o -name 
'netboot-*' -o "${EXTENSIONS[@]}" ')' )
+       find_variants=( '(' -iname '*.iso' -o -iname '*.qcow2' -o -iname 
'*.wsl' -o -name 'netboot-*' -o "${EXTENSIONS[@]}" ')' )
        variants=$(find 20* "${find_variants[@]}" -printf '%f\n' 2>/dev/null | 
sed -e 's,-20[012][0-9]\{5\}.*,,g' -r | sort -u)
        # This file specifies which variants are still in use.
        keepfile="${tmpdir}/.keep.${ARCH}.txt"
@@ -213,6 +226,7 @@ process_arch() {
                [[ ${variant_path} =~ tar.*$ ]] && echo -e "${variant_path} 
${size}" >>"${OUT_STAGE3_tmp}"
                [[ ${variant_path} =~ iso$ ]] && echo -e "${variant_path} 
${size}" >>"${OUT_ISO_tmp}"
                [[ ${variant_path} =~ qcow2$ ]] && echo -e "${variant_path} 
${size}" >>"${OUT_QCOW2_tmp}"
+               [[ ${variant_path} =~ wsl$ ]] && echo -e "${variant_path} 
${size}" >>"${OUT_WSL_tmp}"
 
                # Previously, current-${v}/ was a symlink to the timestamp 
directory.
                # This was apparently confusing to some users because it had 
way too many files.
@@ -278,6 +292,7 @@ process_arch() {
        # Atomic move these files if created.
        [[ -n "${OUT_ISO_tmp}" ]] && [[ -f "${OUT_ISO_tmp}" ]] && mv 
"${OUT_ISO_tmp}" "${OUT_ISO}"
        [[ -n "${OUT_QCOW2_tmp}" ]] && [[ -f "${OUT_QCOW2_tmp}" ]] && mv 
"${OUT_QCOW2_tmp}" "${OUT_QCOW2}"
+       [[ -n "${OUT_WSL_tmp}" ]] && [[ -f "${OUT_WSL_tmp}" ]] && mv 
"${OUT_WSL_tmp}" "${OUT_WSL}"
        [[ -n "${OUT_STAGE3_tmp}" ]] && [[ -f "${OUT_STAGE3_tmp}" ]] && mv 
"${OUT_STAGE3_tmp}" "${OUT_STAGE3}"
 
        # Refresh keepfile

Reply via email to