Add catalyst-auto option --nonetwork
Signed-off-by: Andreas K. Huettel <dilfridge@gentoo.org>
This commit is contained in:
parent
823f4646f4
commit
0c7067713b
|
@ -24,6 +24,7 @@ preclean=0
|
||||||
lastrun=0
|
lastrun=0
|
||||||
lock_file=
|
lock_file=
|
||||||
parallel_sets=1
|
parallel_sets=1
|
||||||
|
nonetwork=0
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
local msg=$1
|
local msg=$1
|
||||||
|
@ -45,12 +46,16 @@ Options:
|
||||||
-t|--test Stop after mangling specs and copying files
|
-t|--test Stop after mangling specs and copying files
|
||||||
--interval <days> Exit if last successful run was less than <days> ago
|
--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
|
-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
|
-h|--help Show this message and quit
|
||||||
|
|
||||||
EOH
|
EOH
|
||||||
}
|
}
|
||||||
|
|
||||||
send_email() {
|
send_email() {
|
||||||
|
if [[ ${nonetwork} == 0 ]]; then
|
||||||
|
|
||||||
local subject="${EMAIL_SUBJECT_PREPEND} $1"
|
local subject="${EMAIL_SUBJECT_PREPEND} $1"
|
||||||
local message=$2
|
local message=$2
|
||||||
local logfile=$3
|
local logfile=$3
|
||||||
|
@ -65,6 +70,8 @@ send_email() {
|
||||||
printf 'From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%b' \
|
printf 'From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%b' \
|
||||||
"${EMAIL_FROM}" "${EMAIL_TO}" "${subject}" "${body}" | \
|
"${EMAIL_FROM}" "${EMAIL_TO}" "${subject}" "${body}" | \
|
||||||
/usr/sbin/sendmail -f "${EMAIL_FROM}" ${EMAIL_TO//,/ }
|
/usr/sbin/sendmail -f "${EMAIL_FROM}" ${EMAIL_TO//,/ }
|
||||||
|
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Usage: run_cmd <logfile> <command to run>
|
# Usage: run_cmd <logfile> <command to run>
|
||||||
|
@ -151,6 +158,9 @@ parse_args() {
|
||||||
-C|--preclean)
|
-C|--preclean)
|
||||||
preclean=1
|
preclean=1
|
||||||
;;
|
;;
|
||||||
|
-X|--nonetwork)
|
||||||
|
nonetwork=1
|
||||||
|
;;
|
||||||
--interval)
|
--interval)
|
||||||
lastrun=$1
|
lastrun=$1
|
||||||
shift
|
shift
|
||||||
|
@ -215,7 +225,7 @@ containerize() {
|
||||||
# the script whenever there's an update.
|
# the script whenever there's an update.
|
||||||
git_update() {
|
git_update() {
|
||||||
# If we've already relaunched, nothing to do.
|
# If we've already relaunched, nothing to do.
|
||||||
if [[ ${GIT_UPDATE} == "true" ]] ; then
|
if [[ ${GIT_UPDATE} == "true" || ${nonetwork} == 1 ]] ; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -240,6 +250,8 @@ git_update() {
|
||||||
# SSH fingerprint from DNS. To do this securely, we need to ensure DNSSEC is
|
# SSH fingerprint from DNS. To do this securely, we need to ensure DNSSEC is
|
||||||
# working.
|
# working.
|
||||||
verify_dnssec() {
|
verify_dnssec() {
|
||||||
|
if [[ ${nonetwork} == 0 ]]; then
|
||||||
|
|
||||||
which dig >/dev/null || {
|
which dig >/dev/null || {
|
||||||
echo "net-dns/bind-tools is needed to verify DNSSEC is working"
|
echo "net-dns/bind-tools is needed to verify DNSSEC is working"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -254,6 +266,8 @@ verify_dnssec() {
|
||||||
echo "DNSSEC is not enabled in /etc/resolv.conf"
|
echo "DNSSEC is not enabled in /etc/resolv.conf"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
run_catalyst_commands() {
|
run_catalyst_commands() {
|
||||||
|
|
|
@ -24,15 +24,6 @@ SET_ilp32_SPECS="stage1-ilp32.spec stage2-ilp32.spec stage3-ilp32.spec"
|
||||||
|
|
||||||
#KCONFIG_DIR=${REPO_DIR}/releases/kconfig/${ARCH}
|
#KCONFIG_DIR=${REPO_DIR}/releases/kconfig/${ARCH}
|
||||||
|
|
||||||
send_email() {
|
|
||||||
:
|
|
||||||
}
|
|
||||||
|
|
||||||
# no upload -> no dnssec needed
|
|
||||||
verify_dnssec() {
|
|
||||||
:
|
|
||||||
}
|
|
||||||
|
|
||||||
update_symlinks() {
|
update_symlinks() {
|
||||||
# Symlink the latest stages3 to build from
|
# Symlink the latest stages3 to build from
|
||||||
local d f
|
local d f
|
||||||
|
@ -47,8 +38,10 @@ update_symlinks() {
|
||||||
}
|
}
|
||||||
|
|
||||||
upload() {
|
upload() {
|
||||||
echo NOT Uploading "$@"
|
if [[ ${nonetwork} == 0 ]]; then
|
||||||
# rsync -e 'ssh -i /root/.ssh/id_rsa -o UserKnownHostsFile=/dev/null -o VerifyHostKeyDNS=yes -o StrictHostKeyChecking=no' "$@" alpha@releng-incoming.gentoo.org:
|
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() {
|
post_build() {
|
||||||
|
|
Loading…
Reference in a new issue