public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] releng r769 - trunk/tools
@ 2011-01-14  5:53 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; only message in thread
From: Robin H. Johnson (robbat2) @ 2011-01-14  5:53 UTC (permalink / raw
  To: gentoo-commits

Author: robbat2
Date: 2011-01-14 05:53:24 +0000 (Fri, 14 Jan 2011)
New Revision: 769

Modified:
   trunk/tools/catalyst-auto-amd64.conf
   trunk/tools/catalyst-auto-x86.conf
Log:
Create a symlink for -latest as seed stage

Create a symlink for the latest name from the available stages3 always,
that is then used as the seed for building the new stages. To ensure
creation, always copy instead of move the stages to the destination
afterwards. In addition to this, we need a cleanup script, as before
only the isos and stages3 were moved, leaving the stage[12] eating up
space behind.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Proposed-by: Jorge Manuel B. S. Vicetto <jmbsvicetto@gentoo.org>
Acked-by: Andrew Gaffney <agaffney@gentoo.org>

Modified: trunk/tools/catalyst-auto-amd64.conf
===================================================================
--- trunk/tools/catalyst-auto-amd64.conf	2010-12-14 18:21:43 UTC (rev 768)
+++ trunk/tools/catalyst-auto-amd64.conf	2011-01-14 05:53:24 UTC (rev 769)
@@ -20,19 +20,42 @@
 
 CATALYST_CONFIG=/etc/catalyst/amd64-auto.conf
 
+BUILD_SRCDIR_BASE=/release/buildroot/amd64-dev/builds/
+BUILD_DESTDIR_BASE=/home/buildsync/builds/amd64/
+
+give_latest_from_dates() {
+  sed 's,-20,~20,g' | \
+  sort -k +1 -n -t '~' |\
+  awk -F\~ \
+  'BEGIN{i=$1; o=$0}; 
+  { if($1 != i && i != "") { print o; }; i=$1; o=$0;  } 
+  END { print o; };' | \
+  tr '~' '-'
+}
+
 pre_build() {
   svn up /release/svn-releng/
+  # Symlink the latest stages3 to build from
+  for d in ${BUILD_SRCDIR_BASE}/{default,hardened} ; do
+    cd $d
+    for f in $(ls 'stage3*bz2' | give_latest_from_dates ) ; do
+      of=${f/20[0-9][0-9].[0-9]/latest} # for 20XX.Y stuff
+      of=${of/20[0-9][0-9][0-1][0-9][0-9][0-9]/latest} # for 20YYMMDD stuff
+      ln -sf $f $of
+    done
+  done
 }
 
 post_build() {
-  cd /release/buildroot/amd64-dev/builds/default
-  mv stage3-*${DATESTAMP}*bz2* /home/buildsync/builds/amd64/
+  cd ${BUILD_SRCDIR_BASE}/default
+  cp stage3-*${DATESTAMP}*bz2* ${BUILD_DESTDIR_BASE}/
   if [ -n "$(ls -1 *${DATESTAMP}*.iso* 2>/dev/null)" ]; then
-    mv *${DATESTAMP}*.iso* /home/buildsync/builds/amd64/
+    cp *${DATESTAMP}*.iso* ${BUILD_DESTDIR_BASE}/
   fi
-  cd /release/buildroot/amd64-dev/builds/hardened
+  cd ${BUILD_SRCDIR_BASE}/hardened
   if [ -n "$(ls -1 stage3-*${DATESTAMP}*.bz2.* 2>/dev/null)" ]; then
-    mv stage3-*${DATESTAMP}*.bz2* /home/buildsync/builds/amd64/hardened/
+    cp stage3-*${DATESTAMP}*.bz2* ${BUILD_DESTDIR_BASE}/hardened/
   fi
 }
 
+# vim:ft=sh:

Modified: trunk/tools/catalyst-auto-x86.conf
===================================================================
--- trunk/tools/catalyst-auto-x86.conf	2010-12-14 18:21:43 UTC (rev 768)
+++ trunk/tools/catalyst-auto-x86.conf	2011-01-14 05:53:24 UTC (rev 769)
@@ -20,18 +20,41 @@
 
 CATALYST_CONFIG=/etc/catalyst/x86-auto.conf
 
+BUILD_SRCDIR_BASE=/release/buildroot/x86-dev/builds/
+BUILD_DESTDIR_BASE=/home/buildsync/builds/x86/
+
+give_latest_from_dates() {
+  sed 's,-20,~20,g' | \
+  sort -k +1 -n -t '~' |\
+  awk -F\~ \
+  'BEGIN{i=$1; o=$0}; 
+  { if($1 != i && i != "") { print o; }; i=$1; o=$0;  } 
+  END { print o; };' | \
+  tr '~' '-'
+}
+
 pre_build() {
   svn up /release/svn-releng/
+  # Symlink the latest stages3 to build from
+  for d in ${BUILD_SRCDIR_BASE}/{default,hardened} ; do
+    cd $d
+    for f in $(ls 'stage3*bz2' | give_latest_from_dates ) ; do
+      of=${f/20[0-9][0-9].[0-9]/latest} # for 20XX.Y stuff
+      of=${of/20[0-9][0-9][0-1][0-9][0-9][0-9]/latest} # for 20YYMMDD stuff
+      ln -sf $f $of
+    done
+  done
 }
 
 post_build() {
-  cd /release/buildroot/x86-dev/builds/default
-  mv stage3-i[46]86-*${DATESTAMP}*.bz2* /home/buildsync/builds/x86/
+  cd ${BUILD_SRCDIR_BASE}/default
+  cp stage3-i[46]86-*${DATESTAMP}*.bz2* ${BUILD_DESTDIR_BASE}
   if [ -n "$(ls -1 *${DATESTAMP}*.iso* 2>/dev/null)" ]; then
-    mv *${DATESTAMP}*.iso* /home/buildsync/builds/x86/
+    cp *${DATESTAMP}*.iso* ${BUILD_DESTDIR_BASE}/
   fi
-  cd /release/buildroot/x86-dev/builds/hardened
+  cd ${BUILD_SRCDIR_BASE}/hardened
   if [ -n "$(ls -1 stage3-i686-*${DATESTAMP}*.bz2* 2>/dev/null)" ]; then
-    mv stage3-i686-*${DATESTAMP}*.bz2* /home/buildsync/builds/x86/hardened/
+    cp stage3-i686-*${DATESTAMP}*.bz2* ${BUILD_DESTDIR_BASE}/hardened/
   fi
 }
+# vim:ft=sh:




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-01-14  5:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-14  5:53 [gentoo-commits] releng r769 - trunk/tools Robin H. Johnson (robbat2)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox