[sysadmin/neon-tooling] /: remove other direct uses of apt-key

Carlos De Maine <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 856ea88d2eac77b60d7d790c5b0bdb5027306cc3 by Carlos De Maine.
Committed on 19/07/2026 at 03:13.
Pushed by carlosdem into branch 'master'.

remove other direct uses of apt-key

and also use --batch and --no-tty flags when invoking gpg

M  +0    -1    deploy_in_container.rake
M  +3    -3    lib/apt/key.rb

https://invent.kde.org/sysadmin/neon-tooling/-/commit/856ea88d2eac77b60d7d790c5b0bdb5027306cc3

diff --git a/deploy_in_container.rake b/deploy_in_container.rake
index 68cf1843..7a7d4095 100644
--- a/deploy_in_container.rake
+++ b/deploy_in_container.rake
@@ -304,7 +304,6 @@ update: --no-document
         puts "trying to add #{NCI.archive_key}"
         raise 'Failed to import key' unless Apt::Key.add(NCI.archive_key)
       end
-      system 'apt-key list'
     end
 
     with_ubuntu_pin do
diff --git a/lib/apt/key.rb b/lib/apt/key.rb
index 08f3fb7d..b3068642 100644
--- a/lib/apt/key.rb
+++ b/lib/apt/key.rb
@@ -55,7 +55,7 @@ module Apt
 
       def add_fingerprint(id_or_fingerprint)
         tmp_key = "/tmp/#{id_or_fingerprint}.key"
-        success = system('gpg', '--no-default-keyring', '--keyring', tmp_key,
+        success = system('gpg', '--no-tty', '--batch', '--no-default-keyring', '--keyring', tmp_key,
                          '--keyserver', 'keyserver.ubuntu.com', '--recv-keys', id_or_fingerprint)
         return false unless success && File.exist?(tmp_key)
 
@@ -74,7 +74,7 @@ module Apt
 
         FileUtils.mkdir_p(KEYRINGS_DIR)
 
-        IO.popen(['gpg', '--dearmor', '-o', target_path], 'w') do |io|
+        IO.popen(['gpg', '--no-tty', '--batch', '--dearmor', '-o', target_path], 'w') do |io|
           io.write(raw_data)
         end
         $?.success?
@@ -83,7 +83,7 @@ module Apt
       def fingerprint_added?(str)
         return false unless Dir.exist?(KEYRINGS_DIR)
         Dir.glob(File.join(KEYRINGS_DIR, '*.gpg')).each do |keyring|
-          output = `gpg --show-keys --with-fingerprint "#{keyring}" 2>/dev/null`
+          output = `gpg --batch --no-tty --show-keys --with-fingerprint "#{keyring}" 2>/dev/null`
           next if output.nil? || !$?.success?
 
           # This is a bit imprecise, but cheapest way to do it without having
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.