catalyst-auto: Update sparc64 conf based on ppc

Signed-off-by: Matt Turner <mattst88@gentoo.org>
This commit is contained in:
Matt Turner 2019-08-29 10:38:11 -07:00
parent 1932302432
commit 2779b4af6a

View file

@ -1,80 +1,71 @@
# This is the config file for the catalyst-auto script. It should be pretty # This is the config file for the catalyst-auto script. It should be pretty
# self-explanatory. # self-explanatory.
ARCH="sparc" SPECS_DIR=${REPO_DIR}/releases/weekly/specs/sparc
TYPE="auto"
host="$(hostname)"
EMAIL_TO="bkohler@gentoo.org" SPECS="sparc/stage1.spec sparc/stage3.spec sparc64/stage1.spec sparc64/stage3.spec"
OPTIONAL_SPECS="sparc64/installcd-stage1.spec sparc64/installcd-stage2-minimal.spec"
source /etc/catalyst/release/build.env KCONFIG_DIR=${REPO_DIR}/releases/weekly/kconfig/powerpc
SPECS_DIR=${REPO_DIR}/releases/weekly/specs/sparc/sparc64 EMAIL_SUBJECT_PREPEND="[sparc-auto]"
SETS="default"
SET_default_SPECS="stage1.spec stage2.spec stage3.spec"
SET_default_OPTIONAL_SPECS="installcd-stage1.spec installcd-stage2-minimal.spec"
#SET_multilib_SPECS="multilib/stage1.spec multilib/stage2.spec multilib/stage3.spec"
KCONFIG_DIR=${REPO_DIR}/releases/weekly/kconfig/sparc
EXTENSIONS="[.tar.xz,.tar.bz2,.tar.gz,.tar,.sfs]"
give_latest_from_dates() { give_latest_from_dates() {
sed 's,-20,~20,g' | \ sed 's,-20,~20,g' | \
sort -k +1 -n -t '~' | \ sort -k +1 -n -t '~' |\
awk -F\~ \ awk -F\~ \
'BEGIN{i=$1; o=$0}; 'BEGIN{i=$1; o=$0};
{ if($1 != i && i != "") { print o; }; i=$1; o=$0; } { if($1 != i && i != "") { print o; }; i=$1; o=$0; }
END { print o; };' | \ END { print o; };' | \
tr '~' '-' tr '~' '-'
}
# Replace the date/time stamp in the filename to "latest".
# Forms we handle:
# stage3-xxx-2018.0.tar.xz
# stage3-xxx-20180116.tar.xz
# stage3-xxx-20180116T015819Z.tar.xz
convert_filename() {
sed -E 's:-20[0-9]+(\.[0-9]+|T[0-9]+Z)?:-latest:g'
} }
update_symlinks() { update_symlinks() {
# Symlink the latest stages3 to build from # Symlink the latest stages3 to build from
for d in ${BUILD_SRCDIR_BASE}/default; do local d f
pushd $d >/dev/null for d in "${BUILD_SRCDIR_BASE}/builds/default" ; do
for f in $(ls stage3*${EXTENSIONS} | grep -v latest | give_latest_from_dates ) ; do pushd "${d}" >/dev/null
# 20yymmddThhmmssZ for f in $(ls stage3-sparc-*xz | grep -v latest | give_latest_from_dates) ; do
# 20yymmddhhmmss local of=$(echo "${f}" | convert_filename)
# 20yymmdd ln -sf "${f}" "${of}"
# 20yy.n done
of=$(perl -p \ for f in $(ls stage3-sparc64-*xz | grep -v latest | give_latest_from_dates) ; do
-e 's/20\d{6}T\d{6}Z/latest/g;' \ local of=$(echo "${f}" | convert_filename)
-e 's/20\d{6}\d{6}/latest/g;' \ ln -sf "${f}" "${of}"
-e 's/20\d{6}/latest/g;' \
-e 's/20\d{2}\.\d{2}/latest/g;' \
<<<"$f")
ln -svf "$f" "$of"
done done
popd >/dev/null popd >/dev/null
done done
} }
upload() { upload() {
rsync -e 'ssh -i /root/.ssh/id_rsa' \ rsync -e 'ssh -i /root/.ssh/id_rsa' "$@" sparc@nightheron.gentoo.org:
-a \
--omit-dir-times \
--delay-updates \
"$@" \
sparc@nightheron.gentoo.org:
} }
post_build() { post_build() {
local set=$1 spec=$2 local set=$1 spec=$2
pushd "${BUILD_SRCDIR_BASE}/default/" > /dev/null pushd "${BUILD_SRCDIR_BASE}/builds/default" >/dev/null
case ${spec} in case ${spec} in
stage3.spec) sparc64/installcd-stage2-minimal.spec)
upload stage3-*${DATESTAMP}*${EXTENSIONS}* upload *${TIMESTAMP}*.iso*
;; ;;
installcd-stage2-minimal.spec) sparc/stage3.spec)
upload *${DATESTAMP}*.iso* upload stage3-sparc-*${TIMESTAMP}*.xz*
;;
sparc64/stage3.spec)
upload stage3-sparc64-*${TIMESTAMP}*.xz*
;; ;;
esac esac
popd > /dev/null popd >/dev/null
} }