lyst-auto-sparc64.conf: borrow new symlink logic from amd64

Signed-off-by: Ben Kohler <bkohler@gentoo.org>
This commit is contained in:
Ben Kohler 2019-01-09 11:18:48 -06:00
parent daa362cb19
commit d8a805cba3
No known key found for this signature in database
GPG key ID: 7A85BDA4D57605C7

View file

@ -32,15 +32,22 @@ give_latest_from_dates() {
tr '~' '-'
}
update_symlinks() {
# Symlink the latest stages3 to build from
for d in ${BUILD_SRCDIR_BASE}/default; do
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 $
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{6}/latest/g;' \
-e 's/20\d{2}\.\d{2}/latest/g;' \
<<<"$f")
ln -svf "$f" "$of"
done
popd >/dev/null
done