public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andreas K. Huettel" <dilfridge@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Cc: "Andreas K. Huettel" <dilfridge@gentoo.org>
Subject: [gentoo-catalyst] [PATCH] Add catalyst-auto option --nonetwork
Date: Wed,  6 Jan 2021 17:46:02 +0200	[thread overview]
Message-ID: <20210106154602.1556-1-dilfridge@gentoo.org> (raw)

Signed-off-by: Andreas K. Huettel <dilfridge@gentoo.org>
---
 tools/catalyst-auto            | 16 +++++++++++++++-
 tools/catalyst-auto-riscv.conf | 15 ++++-----------
 2 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/tools/catalyst-auto b/tools/catalyst-auto
index d71ad5a2..203abe81 100755
--- a/tools/catalyst-auto
+++ b/tools/catalyst-auto
@@ -24,6 +24,7 @@ preclean=0
 lastrun=0
 lock_file=
 parallel_sets=1
+nonetwork=0
 
 usage() {
 	local msg=$1
@@ -45,12 +46,16 @@ Options:
   -t|--test           Stop after mangling specs and copying files
   --interval <days>   Exit if last successful run was less than <days> ago
   -l|--lock <file>    File to grab a lock on to prevent multiple invocations
+  -X|--nonetwork      Do not perform network operations (like uploading result)
+                      This needs to be supported by the config file as well.
   -h|--help           Show this message and quit
 
 EOH
 }
 
 send_email() {
+    if [[ ${nonetwork} == 0 ]]; then
+
 	local subject="${EMAIL_SUBJECT_PREPEND} $1"
 	local message=$2
 	local logfile=$3
@@ -65,6 +70,8 @@ send_email() {
 	printf 'From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%b' \
 		"${EMAIL_FROM}" "${EMAIL_TO}" "${subject}" "${body}" | \
 		/usr/sbin/sendmail -f "${EMAIL_FROM}" ${EMAIL_TO//,/ }
+
+    fi
 }
 
 # Usage: run_cmd <logfile> <command to run>
@@ -151,6 +158,9 @@ parse_args() {
 		-C|--preclean)
 			preclean=1
 			;;
+		-X|--nonetwork)
+			nonetwork=1
+			;;
 		--interval)
 			lastrun=$1
 			shift
@@ -215,7 +225,7 @@ containerize() {
 # the script whenever there's an update.
 git_update() {
 	# If we've already relaunched, nothing to do.
-	if [[ ${GIT_UPDATE} == "true" ]] ; then
+	if [[ ${GIT_UPDATE} == "true" || ${nonetwork} == 1 ]] ; then
 		return
 	fi
 
@@ -240,6 +250,8 @@ git_update() {
 # SSH fingerprint from DNS. To do this securely, we need to ensure DNSSEC is
 # working.
 verify_dnssec() {
+    if [[ ${nonetwork} == 0 ]]; then
+
 	which dig >/dev/null || {
 		echo "net-dns/bind-tools is needed to verify DNSSEC is working"
 		exit 1
@@ -254,6 +266,8 @@ verify_dnssec() {
 		echo "DNSSEC is not enabled in /etc/resolv.conf"
 		exit 1
 	fi
+
+    fi
 }
 
 run_catalyst_commands() {
diff --git a/tools/catalyst-auto-riscv.conf b/tools/catalyst-auto-riscv.conf
index 4a5d40b5..6a7e8657 100644
--- a/tools/catalyst-auto-riscv.conf
+++ b/tools/catalyst-auto-riscv.conf
@@ -24,15 +24,6 @@ SET_ilp32_SPECS="stage1-ilp32.spec stage2-ilp32.spec stage3-ilp32.spec"
 
 #KCONFIG_DIR=${REPO_DIR}/releases/kconfig/${ARCH}
 
-send_email() {
-	:
-}
-
-# no upload -> no dnssec needed
-verify_dnssec() {
-	:
-}
-
 update_symlinks() {
 	# Symlink the latest stages3 to build from
 	local d f
@@ -47,8 +38,10 @@ update_symlinks() {
 }
 
 upload() {
-	echo NOT Uploading "$@"
-#	rsync -e 'ssh -i /root/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=yes -o StrictHostKeyChecking=no' "$@" alpha@releng-incoming.gentoo.org:
+    if [[ ${nonetwork} == 0 ]]; then
+	echo Uploading "$@"
+	rsync -e 'ssh -i /root/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=yes -o StrictHostKeyChecking=no' "$@" riscv@releng-incoming.gentoo.org:
+    fi
 }
 
 post_build() {
-- 
2.26.2



             reply	other threads:[~2021-01-06 15:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 15:46 Andreas K. Huettel [this message]
2021-01-06 15:56 ` [gentoo-catalyst] [PATCH] Add catalyst-auto option --nonetwork Matt Turner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210106154602.1556-1-dilfridge@gentoo.org \
    --to=dilfridge@gentoo.org \
    --cc=gentoo-catalyst@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox