Gentoo Archives: gentoo-catalyst

From: "Andreas K. Huettel" <dilfridge@g.o>
To: gentoo-catalyst@l.g.o
Cc: "Andreas K. Huettel" <dilfridge@g.o>
Subject: [gentoo-catalyst] [PATCH] Add catalyst-auto option --nonetwork
Date: Wed, 06 Jan 2021 15:49:28
Message-Id: 20210106154602.1556-1-dilfridge@gentoo.org
1 Signed-off-by: Andreas K. Huettel <dilfridge@g.o>
2 ---
3 tools/catalyst-auto | 16 +++++++++++++++-
4 tools/catalyst-auto-riscv.conf | 15 ++++-----------
5 2 files changed, 19 insertions(+), 12 deletions(-)
6
7 diff --git a/tools/catalyst-auto b/tools/catalyst-auto
8 index d71ad5a2..203abe81 100755
9 --- a/tools/catalyst-auto
10 +++ b/tools/catalyst-auto
11 @@ -24,6 +24,7 @@ preclean=0
12 lastrun=0
13 lock_file=
14 parallel_sets=1
15 +nonetwork=0
16
17 usage() {
18 local msg=$1
19 @@ -45,12 +46,16 @@ Options:
20 -t|--test Stop after mangling specs and copying files
21 --interval <days> Exit if last successful run was less than <days> ago
22 -l|--lock <file> File to grab a lock on to prevent multiple invocations
23 + -X|--nonetwork Do not perform network operations (like uploading result)
24 + This needs to be supported by the config file as well.
25 -h|--help Show this message and quit
26
27 EOH
28 }
29
30 send_email() {
31 + if [[ ${nonetwork} == 0 ]]; then
32 +
33 local subject="${EMAIL_SUBJECT_PREPEND} $1"
34 local message=$2
35 local logfile=$3
36 @@ -65,6 +70,8 @@ send_email() {
37 printf 'From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%b' \
38 "${EMAIL_FROM}" "${EMAIL_TO}" "${subject}" "${body}" | \
39 /usr/sbin/sendmail -f "${EMAIL_FROM}" ${EMAIL_TO//,/ }
40 +
41 + fi
42 }
43
44 # Usage: run_cmd <logfile> <command to run>
45 @@ -151,6 +158,9 @@ parse_args() {
46 -C|--preclean)
47 preclean=1
48 ;;
49 + -X|--nonetwork)
50 + nonetwork=1
51 + ;;
52 --interval)
53 lastrun=$1
54 shift
55 @@ -215,7 +225,7 @@ containerize() {
56 # the script whenever there's an update.
57 git_update() {
58 # If we've already relaunched, nothing to do.
59 - if [[ ${GIT_UPDATE} == "true" ]] ; then
60 + if [[ ${GIT_UPDATE} == "true" || ${nonetwork} == 1 ]] ; then
61 return
62 fi
63
64 @@ -240,6 +250,8 @@ git_update() {
65 # SSH fingerprint from DNS. To do this securely, we need to ensure DNSSEC is
66 # working.
67 verify_dnssec() {
68 + if [[ ${nonetwork} == 0 ]]; then
69 +
70 which dig >/dev/null || {
71 echo "net-dns/bind-tools is needed to verify DNSSEC is working"
72 exit 1
73 @@ -254,6 +266,8 @@ verify_dnssec() {
74 echo "DNSSEC is not enabled in /etc/resolv.conf"
75 exit 1
76 fi
77 +
78 + fi
79 }
80
81 run_catalyst_commands() {
82 diff --git a/tools/catalyst-auto-riscv.conf b/tools/catalyst-auto-riscv.conf
83 index 4a5d40b5..6a7e8657 100644
84 --- a/tools/catalyst-auto-riscv.conf
85 +++ b/tools/catalyst-auto-riscv.conf
86 @@ -24,15 +24,6 @@ SET_ilp32_SPECS="stage1-ilp32.spec stage2-ilp32.spec stage3-ilp32.spec"
87
88 #KCONFIG_DIR=${REPO_DIR}/releases/kconfig/${ARCH}
89
90 -send_email() {
91 - :
92 -}
93 -
94 -# no upload -> no dnssec needed
95 -verify_dnssec() {
96 - :
97 -}
98 -
99 update_symlinks() {
100 # Symlink the latest stages3 to build from
101 local d f
102 @@ -47,8 +38,10 @@ update_symlinks() {
103 }
104
105 upload() {
106 - echo NOT Uploading "$@"
107 -# rsync -e 'ssh -i /root/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=yes -o StrictHostKeyChecking=no' "$@" alpha@××××××××××××××××××××××.org:
108 + if [[ ${nonetwork} == 0 ]]; then
109 + echo Uploading "$@"
110 + rsync -e 'ssh -i /root/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=yes -o StrictHostKeyChecking=no' "$@" riscv@××××××××××××××××××××××.org:
111 + fi
112 }
113
114 post_build() {
115 --
116 2.26.2

Replies

Subject Author
Re: [gentoo-catalyst] [PATCH] Add catalyst-auto option --nonetwork Matt Turner <mattst88@g.o>