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>

svn path=/trunk/; revision=769
This commit is contained in:
Robin H. Johnson 2011-01-14 05:53:24 +00:00
parent 08cd227d97
commit f24ecd86d0
2 changed files with 56 additions and 10 deletions

View file

@ -20,19 +20,42 @@ EMAIL_SUBJECT_PREPEND="[amd64-auto]"
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:

View file

@ -20,18 +20,41 @@ EMAIL_SUBJECT_PREPEND="[x86-auto]"
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: