commit:     e0189f9b76508e61844cffa11a2ac89adfae28e5
Author:     Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo 
<DOT> org>
AuthorDate: Fri Feb  6 20:11:54 2015 +0000
Commit:     Jorge Manuel B. S. Vicetto <jmbsvicetto <AT> gentoo <DOT> org>
CommitDate: Fri Feb  6 20:11:54 2015 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/releng.git;a=commit;h=e0189f9b

Update the script to improve the readbility of the latest-{iso,stage3} for 
amd64/x86.

Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> 
gentoo.org>

---
 scripts/copy_buildsync.sh | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/scripts/copy_buildsync.sh b/scripts/copy_buildsync.sh
index b0b2b61..30b25a6 100755
--- a/scripts/copy_buildsync.sh
+++ b/scripts/copy_buildsync.sh
@@ -69,9 +69,11 @@ for ARCH in $ARCHES; do
 
        if [ -n "${iso_list}" ]; then
                echo -e "${header}" >"${OUT_ISO}"
-               echo -e "${iso_list}" |awk '{print $3}' | grep 
"$latest_iso_date" >>${OUT_ISO}
-               rm -f current-iso
-               ln -sf "$latest_iso_date" current-iso
+               if [[ ! $(echo ${iso_list} | egrep "amd64|x86") ]]; then
+                       echo -e "${iso_list}" |awk '{print $3}' | grep 
"$latest_iso_date" >>${OUT_ISO}
+                       rm -f current-iso
+                       ln -sf "$latest_iso_date" current-iso
+               fi
        fi
        if [ -n "${stage3_list}" ]; then
                echo -e "${header}" >"${OUT_STAGE3}"
@@ -91,10 +93,12 @@ for ARCH in $ARCHES; do
        echo -n '' >"${tmpdir}"/.keep.${ARCH}.txt
        for v in $variants ; do
                variant_path=$(find 20* -iname "${v}-20*" \( -name '*.tar.bz2' 
-o -iname '*.iso' \) -print | sed -e "s,.*/$a/autobuilds/,,g" | sort -k1,1 -t/ 
| tail -n1 )
+               size=$(stat --format=%s ${variant_path})
                f="latest-${v}.txt"
                echo -e "${header}" >"${f}"
-               echo -e "${variant_path}" >>${f}
-               echo -e "${variant_path}" >>${OUT_STAGE3}
+               echo -e "${variant_path} ${size}" >>${f}
+               [[ ${variant_path} =~ tar.*$ ]] && echo -e "${variant_path} 
${size}" >>${OUT_STAGE3}
+               [[ ${variant_path} =~ iso$ ]] && echo -e "${variant_path} 
${size}" >>${OUT_ISO}
                rm -f "current-$v"
                ln -sf "${variant_path%/*}" "current-$v"
                echo "${variant_path}" | sed -e 's,/.*,,g' -e 's,^,/,g' -e 
's,$,$,g' >>"${tmpdir}"/.keep.${ARCH}.txt

Reply via email to