tools/catalyst-auto: change datestamp->timestamp

Prepare for doing multiple automated runs in a single day on
newer/faster build systems.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
This commit is contained in:
Robin H. Johnson 2017-12-07 23:40:09 -08:00
parent 10953c3a11
commit ed258c751b
No known key found for this signature in database
GPG key ID: 19395F23C58826C4
3 changed files with 26 additions and 12 deletions

View file

@ -60,9 +60,16 @@ update_symlinks() {
for d in ${BUILD_SRCDIR_BASE}/{default,hardened} ; do
pushd $d >/dev/null
for f in $(ls stage3*${EXTENSIONS} | grep -v latest | 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
# 20yymmddThhmmssZ
# 20yymmddhhmmss
# 20yymmdd
# 20yy.n
of=$(perl -p \
-e 's/20\d{6}T\d{6}Z/latest/g;' \
-e 's/20\d{6}\d{6}/latest/g;' \
-e 's/20\d{2}\.\d{2}/latest/g;' \
<<<"$f")
ln -sf "$f" "$of"
done
popd >/dev/null
done
@ -78,25 +85,29 @@ pre_build() {
post_build() {
pushd ${BUILD_SRCDIR_BASE}/default >/dev/null
mkdir -p ${BUILD_DESTDIR_BASE}
for file in $(ls stage{3,4}*${DATESTAMP}*${EXTENSIONS} ); do
for file in $(ls stage{3,4}*${DATESTAMP}*${EXTENSIONS} stage{3,4}*${TIMESTAMP}*${EXTENSIONS} ); do
if [ -f $file ]; then
cp $file* ${BUILD_DESTDIR_BASE}
fi
done
if [ -f *${DATESTAMP}*.iso ]; then
cp *${DATESTAMP}*.iso* ${BUILD_DESTDIR_BASE}
elif [ -f *${TIMESTAMP}*.iso ]; then
cp *${TIMESTAMP}*.iso* ${BUILD_DESTDIR_BASE}
fi
popd >/dev/null
pushd ${BUILD_SRCDIR_BASE}/hardened >/dev/null
mkdir -p ${BUILD_DESTDIR_BASE}/hardened
for file in $(ls stage{3,4}*${DATESTAMP}*${EXTENSIONS} ); do
for file in $(ls stage{3,4}*${DATESTAMP}*${EXTENSIONS} stage{3,4}*${TIMESTAMP}*${EXTENSIONS} ); do
if [ -f $file ]; then
cp $file* ${BUILD_DESTDIR_BASE}/hardened
fi
done
if [ -f *${DATESTAMP}*.iso ]; then
cp *${DATESTAMP}*.iso* ${BUILD_DESTDIR_BASE}/hardened
elif [ -f *${TIMESTAMP}*.iso ]; then
cp *${TIMESTAMP}*.iso* ${BUILD_DESTDIR_BASE}/hardened
fi
}