From 0bbef1f18eab93eef97dbee1d1c3eb3442e0191f Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Fri, 22 Feb 2019 13:32:20 -0500 Subject: [PATCH] Allow requesting serial signing Sigul-signing directories containing a lot of large artifacts may not be optimal, because whether serial or parallel, the same amount of network IO is required and the job takes about the same amount of time in the end. This allows passing "serial" as a third argument to sign_dir to specifically request serial operation. Change-Id: I6a6267090cee6cbed1f134b27eb6cec485fa1793 Signed-off-by: Konstantin Ryabitsev --- releasenotes/notes/add-option-for-serial-e5342f8365a92120.yaml | 8 ++++++++ shell/sign | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/add-option-for-serial-e5342f8365a92120.yaml diff --git a/releasenotes/notes/add-option-for-serial-e5342f8365a92120.yaml b/releasenotes/notes/add-option-for-serial-e5342f8365a92120.yaml new file mode 100644 index 00000000..a3b7655e --- /dev/null +++ b/releasenotes/notes/add-option-for-serial-e5342f8365a92120.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + Allow passing ``serial`` as third argument to **sign_dir** + + Parallel-signing using sigul is resulting in NSPR reset errors, + so allow passing "serial" to the sign_dir function as a third argument + to request serial signing of directory contents. diff --git a/shell/sign b/shell/sign index d5725601..4ef50a03 100755 --- a/shell/sign +++ b/shell/sign @@ -91,7 +91,15 @@ sign_dir() { exit 1 fi + local mode="serial" if hash parallel 2>/dev/null; then + # Unless you specifically asked for serial mode + if [ "$3" != "serial" ]; then + local mode="parallel" + fi + fi + + if [ "$mode" == "parallel" ]; then echo "Signing in parallel..." case "$signer" in gpg ) @@ -116,7 +124,7 @@ sign_dir() { echo "Signed the following files:" printf '%s\n' "${files_to_sign[@]}" else - echo "GNU parallel not found. Signing in serial mode..." + echo "Signing in serial mode..." case "$signer" in gpg ) for f in "${files_to_sign[@]}"; do -- 2.16.6