From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1108205-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id C1437138335
	for <garchives@archives.gentoo.org>; Thu, 29 Aug 2019 17:39:37 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 7E173E0878;
	Thu, 29 Aug 2019 17:39:35 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 476BFE0878
	for <gentoo-commits@lists.gentoo.org>; Thu, 29 Aug 2019 17:39:35 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id E6D0F34A633
	for <gentoo-commits@lists.gentoo.org>; Thu, 29 Aug 2019 17:39:33 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id CF93F77B
	for <gentoo-commits@lists.gentoo.org>; Thu, 29 Aug 2019 17:39:31 +0000 (UTC)
From: "Matt Turner" <mattst88@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Matt Turner" <mattst88@gentoo.org>
Message-ID: <1567100350.2779b4af6a0ea7d5dd730a0bbabd1df1744d181e.mattst88@gentoo>
Subject: [gentoo-commits] proj/releng:master commit in: tools/
X-VCS-Repository: proj/releng
X-VCS-Files: tools/catalyst-auto-sparc64.conf
X-VCS-Directories: tools/
X-VCS-Committer: mattst88
X-VCS-Committer-Name: Matt Turner
X-VCS-Revision: 2779b4af6a0ea7d5dd730a0bbabd1df1744d181e
X-VCS-Branch: master
Date: Thu, 29 Aug 2019 17:39:31 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 256eeaae-aee0-44bb-84e2-284aa495d4e4
X-Archives-Hash: eb24fe3d6ce8d81057e048ff46296cc7

commit:     2779b4af6a0ea7d5dd730a0bbabd1df1744d181e
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 29 17:38:11 2019 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Thu Aug 29 17:39:10 2019 +0000
URL:        https://gitweb.gentoo.org/proj/releng.git/commit/?id=2779b4af

catalyst-auto: Update sparc64 conf based on ppc

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 tools/catalyst-auto-sparc64.conf | 91 ++++++++++++++++++----------------------
 1 file changed, 41 insertions(+), 50 deletions(-)

diff --git a/tools/catalyst-auto-sparc64.conf b/tools/catalyst-auto-sparc64.conf
index e153871b..1b28d283 100644
--- a/tools/catalyst-auto-sparc64.conf
+++ b/tools/catalyst-auto-sparc64.conf
@@ -1,80 +1,71 @@
 # This is the config file for the catalyst-auto script. It should be pretty
 # self-explanatory.
 
-ARCH="sparc"
-TYPE="auto"
-host="$(hostname)"
+SPECS_DIR=${REPO_DIR}/releases/weekly/specs/sparc
 
-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
-
-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]"
+EMAIL_SUBJECT_PREPEND="[sparc-auto]"
 
 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 '~' '-'
+  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 '~' '-'
+}
+
+# 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() {
 	# Symlink the latest stages3 to build from
-	for d in ${BUILD_SRCDIR_BASE}/default; do
-		pushd $d >/dev/null
-		for f in $(ls stage3*${EXTENSIONS} | grep -v latest | give_latest_from_dates ) ; do
-			# 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"
+	local d f
+	for d in "${BUILD_SRCDIR_BASE}/builds/default" ; do
+		pushd "${d}" >/dev/null
+		for f in $(ls stage3-sparc-*xz | grep -v latest | give_latest_from_dates) ; do
+			local of=$(echo "${f}" | convert_filename)
+			ln -sf "${f}" "${of}"
+		done
+		for f in $(ls stage3-sparc64-*xz | grep -v latest | give_latest_from_dates) ; do
+			local of=$(echo "${f}" | convert_filename)
+			ln -sf "${f}" "${of}"
 		done
 		popd >/dev/null
 	done
 }
 
 upload() {
-	rsync 	-e 'ssh -i /root/.ssh/id_rsa' \
-		-a \
-		--omit-dir-times \
-		--delay-updates \
-		"$@" \
-		sparc@nightheron.gentoo.org:
+	rsync -e 'ssh -i /root/.ssh/id_rsa' "$@" sparc@nightheron.gentoo.org:
 }
 
 post_build() {
 	local set=$1 spec=$2
 
-	pushd "${BUILD_SRCDIR_BASE}/default/" > /dev/null
+	pushd "${BUILD_SRCDIR_BASE}/builds/default" >/dev/null
 
 	case ${spec} in
-	stage3.spec)
-		upload stage3-*${DATESTAMP}*${EXTENSIONS}*
+	sparc64/installcd-stage2-minimal.spec)
+		upload *${TIMESTAMP}*.iso*
+		;;
+	sparc/stage3.spec)
+		upload stage3-sparc-*${TIMESTAMP}*.xz*
 		;;
-	installcd-stage2-minimal.spec)
-		upload *${DATESTAMP}*.iso*
+	sparc64/stage3.spec)
+		upload stage3-sparc64-*${TIMESTAMP}*.xz*
 		;;
 	esac
 
-	popd > /dev/null
+	popd >/dev/null
 }