public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] releng r565 - trunk/tools
@ 2008-09-04  1:54 Andrew Gaffney (agaffney)
  0 siblings, 0 replies; only message in thread
From: Andrew Gaffney (agaffney) @ 2008-09-04  1:54 UTC (permalink / raw
  To: gentoo-commits

Author: agaffney
Date: 2008-09-04 01:54:15 +0000 (Thu, 04 Sep 2008)
New Revision: 565

Modified:
   trunk/tools/ChangeLog
   trunk/tools/catalyst-auto
Log:
Add code to modify copied specs and create snapshot

Modified: trunk/tools/ChangeLog
===================================================================
--- trunk/tools/ChangeLog	2008-09-04 01:19:35 UTC (rev 564)
+++ trunk/tools/ChangeLog	2008-09-04 01:54:15 UTC (rev 565)
@@ -2,6 +2,9 @@
 # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
 # $Id$
 
+  04 Sep 2008; Andrew Gaffney <agaffney@gentoo.org> catalyst-auto:
+  Add code to modify copied specs and create snapshot
+
   04 Sep 2008; Andrew Gaffney <agaffney@gentoo.org> +catalyst-auto,
   +catalyst-auto.conf:
   Initial commit of catalyst-auto script

Modified: trunk/tools/catalyst-auto
===================================================================
--- trunk/tools/catalyst-auto	2008-09-04 01:19:35 UTC (rev 564)
+++ trunk/tools/catalyst-auto	2008-09-04 01:54:15 UTC (rev 565)
@@ -36,9 +36,10 @@
   logfile=$2
 
   if [ $verbose = 1 ]; then
-    ${cmd} 2>&1 | tee ${logfile}
+    echo "*** Running command: ${cmd}"
+#    ${cmd} 2>&1 | tee ${logfile}
   else
-    ${cmd} &> ${logfile}
+#    ${cmd} &> ${logfile}
   fi
 }
 
@@ -113,6 +114,26 @@
 
 cd ${TMPDIR}/specs
 
+DATESTAMP=$(date +%Y%m%d)
+
+# Fix up specs with datestamp
+for i in $(find -name '*.spec'); do
+  # Grab current version_stamp and source_subpath
+  old_version_stamp=$(grep version_stamp ${i} | sed -e 's|^version_stamp: *||')
+  old_source_subpath=$(grep source_subpath ${i} | sed -e 's|^source_subpath: .\+-||')
+
+  sed -i 's|^version_stamp:.*$|version_stamp: '${DATESTAMP}'|' ${i}
+  sed -i 's|^snapshot:.*$|snapshot: '${DATESTAMP}'|' ${i}
+  if [ "${old_version_stamp}" = "${old_source_subpath}" ]; then
+    sed -i 's|^source_subpath: (.\+-).\+$|source_subpath: \1'${DATESTAMP}'|'
+  fi
+done
+
+# Create snapshot
+if ! run_cmd "catalyst -c ${CATALYST_CONFIG} -s ${DATESTAMP}" ${TMPDIR}/log/snapshot-${DATESTAMP}.log"; then
+  send_email "Catalyst build error - snapshot" "$(tail -n 200 ${TMPDIR}/log/snapshot-${DATESTAMP}.log)"
+fi
+
 for i in $(ls -1 ${SPECS}); do
   LOGFILE="${TMPDIR}/log/$(echo "${i}" | sed -e 's:/:_:' -e 's:\.spec$::').log"
   run_cmd "catalyst -a -p -c ${CATALYST_CONFIG} -f ${i}" ${LOGFILE}




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

only message in thread, other threads:[~2008-09-04  1:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-04  1:54 [gentoo-commits] releng r565 - trunk/tools Andrew Gaffney (agaffney)

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