From fdac780035bc43340c4719c1d613f692154af0fd Mon Sep 17 00:00:00 2001 From: Justin Litchfield Date: Mon, 12 Sep 2016 10:49:28 -0500 Subject: [PATCH 1/2] no-tty is provided to gpg --- lib/prm/repo.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/prm/repo.rb b/lib/prm/repo.rb index 60fc618..4fcbacf 100644 --- a/lib/prm/repo.rb +++ b/lib/prm/repo.rb @@ -207,11 +207,11 @@ def generate_release_gpg(path,release,gpg) end if gpg.nil? - sign_cmd = "gpg --digest-algo \"#{sign_algorithm}\" --yes --output Release.gpg -b Release" + sign_cmd = "gpg --digest-algo \"#{sign_algorithm}\" --no-tty --yes --output Release.gpg -b Release" elsif !gpg_passphrase.nil? - sign_cmd = "echo \'#{gpg_passphrase}\' | gpg --digest-algo \"#{sign_algorithm}\" -u #{gpg} --passphrase-fd 0 --yes --output Release.gpg -b Release" + sign_cmd = "echo \'#{gpg_passphrase}\' | gpg --digest-algo \"#{sign_algorithm}\" --no-tty -u #{gpg} --passphrase-fd 0 --yes --output Release.gpg -b Release" else - sign_cmd = "gpg --digest-algo \"#{sign_algorithm}\" -u #{gpg} --yes --output Release.gpg -b Release" + sign_cmd = "gpg --digest-algo \"#{sign_algorithm}\" -u #{gpg} --no-tty --yes --output Release.gpg -b Release" end system sign_cmd end From 79dcb1971e1dd29f75415d760c17c943dde5ddd5 Mon Sep 17 00:00:00 2001 From: Justin Litchfield Date: Mon, 12 Sep 2016 10:49:53 -0500 Subject: [PATCH 2/2] Logic for gpg_passphrase reflects default --- lib/prm/repo.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/prm/repo.rb b/lib/prm/repo.rb index 4fcbacf..c19e9b2 100644 --- a/lib/prm/repo.rb +++ b/lib/prm/repo.rb @@ -208,7 +208,7 @@ def generate_release_gpg(path,release,gpg) if gpg.nil? sign_cmd = "gpg --digest-algo \"#{sign_algorithm}\" --no-tty --yes --output Release.gpg -b Release" - elsif !gpg_passphrase.nil? + elsif gpg_passphrase sign_cmd = "echo \'#{gpg_passphrase}\' | gpg --digest-algo \"#{sign_algorithm}\" --no-tty -u #{gpg} --passphrase-fd 0 --yes --output Release.gpg -b Release" else sign_cmd = "gpg --digest-algo \"#{sign_algorithm}\" -u #{gpg} --no-tty --yes --output Release.gpg -b Release"