[sysadmin/neon-tooling] /: add-apt-repository isn't able to process signed-by which is now mandatory in resolute
Carlos De Maine <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit e3161883c5401dbc307aff746a7f12b3266ce01b by Carlos De Maine.
Committed on 20/07/2026 at 09:25.
Pushed by carlosdem into branch 'master'.
add-apt-repository isn't able to process signed-by which is now mandatory in resolute
work around with gsub and revisit when/if it gains gpg support
M +2 -2 lib/apt/key.rb
M +11 -1 lib/apt/repository.rb
M +8 -4 nci/lib/setup_repo.rb
https://invent.kde.org/sysadmin/neon-tooling/-/commit/e3161883c5401dbc307aff746a7f12b3266ce01b
diff --git a/lib/apt/key.rb b/lib/apt/key.rb
index 3056c6d1..9c7d3546 100644
--- a/lib/apt/key.rb
+++ b/lib/apt/key.rb
@@ -62,11 +62,11 @@ module Apt
success = system('gpg', '--no-tty', '--batch', '--no-default-keyring', '--export-options', 'export-minimal', '--keyring', gpg_key, '--output', gpg_key, '--keyserver', 'keyserver.ubuntu.com', '--recv-keys', id_or_fingerprint)
return false unless success && File.exist?(gpg_key)
- FileUtils.chmod(0600, gpg_key)
+ FileUtils.chmod(0644, gpg_key)
dearmour = system('gpg', '--yes', '--no-tty', '--batch', '--export', '--export-options', 'export-minimal', '--keyring', gpg_key, '--armor', '--output', asc_key)
return false unless dearmour && File.exist?(asc_key)
- FileUtils.chmod(0600, asc_key)
+ FileUtils.chmod(0644, asc_key)
$?.success?
end
diff --git a/lib/apt/repository.rb b/lib/apt/repository.rb
index 16e3aad6..9af17f4b 100644
--- a/lib/apt/repository.rb
+++ b/lib/apt/repository.rb
@@ -29,6 +29,10 @@ module Apt
def initialize(name)
require_relative '../apt.rb'
@name = name
+ @series ||= OS::VERSION_CODENAME
+ @type = ENV.fetch('TYPE')
+ @filename = nil
+ @file_path = "/etc/apt/sources.list.d/archive_uri-http_archive_neon_kde_org_#{@type}-#{@series}.list"
self.class.send(:install_add_apt_repository)
@default_args = []
if self.class.send(:disable_auto_update?)
@@ -58,7 +62,10 @@ module Apt
else
TTY::Command.new.run!('add-apt-repository', *args).success?
end
- end
+ old_string = "deb http:"
+ new_contents = File.read(@file_path).gsub(old_string, 'deb [ signed-by=/etc/apt/keyrings/444D_ABCF_3667_D028_3F89__4EDD_E6D4_7362_5575_1E5D.asc ] http:')
+ File.write(@file_path, new_contents)
+ end
# (see #remove)
def self.remove(name)
@@ -70,6 +77,9 @@ module Apt
unless ENV['PANGEA_UNDER_TEST'] # Hello this is a hack to not update the tests
self.class.send(:install_add_apt_repository)
end
+ old_string = "deb [ signed-by=/etc/apt/keyrings/444D_ABCF_3667_D028_3F89__4EDD_E6D4_7362_5575_1E5D.asc ] http:"
+ new_contents = File.read(@file_path).gsub(old_string, 'deb http:')
+ File.write(@file_path, new_contents)
args = [] + @default_args
args << '-y'
args << '-r'
diff --git a/nci/lib/setup_repo.rb b/nci/lib/setup_repo.rb
index 167823a8..f5bf1102 100644
--- a/nci/lib/setup_repo.rb
+++ b/nci/lib/setup_repo.rb
@@ -164,6 +164,10 @@ APT::Default-Release "#{setup_repo_codename}";
File.write("/etc/apt/sources.list.d/neon_src_#{dist}.list",
lines.join("\n"))
puts "lines: #{lines.join('\n')}"
+ @file_path = "/etc/apt/sources.list.d/neon_src_#{dist}.list"
+ old_string = "deb http:"
+ new_contents = File.read(@file_path).gsub(old_string, 'deb [ signed-by=/etc/apt/keyrings/444D_ABCF_3667_D028_3F89__4EDD_E6D4_7362_5575_1E5D.asc ] http:')
+ File.write(@file_path, new_contents)
end
disable_all_src
end
@@ -190,11 +194,11 @@ APT::Default-Release "#{setup_repo_codename}";
repo = type_to_repo(type, dist)
if NCI.divert_repo?(repo)
- return format('deb [signed-by=/etc/apt/keyrings/444D_ABCF_3667_D028_3F89__4EDD_E6D4_7362_5575_1E5D.gpg] http://archive.neon.kde.org/tmp/%<repo>s %<dist>s main',
+ return format('deb http://archive.neon.kde.org/tmp/%<repo>s %<dist>s main',
repo: repo, dist: dist)
end
- format('deb [signed-by=/etc/apt/keyrings/444D_ABCF_3667_D028_3F89__4EDD_E6D4_7362_5575_1E5D.gpg] http://archive.neon.kde.org/%<repo>s %<dist>s main',
+ format('deb http://archive.neon.kde.org/%<repo>s %<dist>s main',
repo: repo, dist: dist)
end
@@ -202,11 +206,11 @@ APT::Default-Release "#{setup_repo_codename}";
repo = type_to_repo(type, dist)
if NCI.divert_repo?(repo)
- return format('deb-src [signed-by=/etc/apt/keyrings/444D_ABCF_3667_D028_3F89__4EDD_E6D4_7362_5575_1E5D.gpg] http://archive.neon.kde.org/tmp/%<repo>s %<dist>s main',
+ return format('deb-src [ signed-by=/etc/apt/keyrings/444D_ABCF_3667_D028_3F89__4EDD_E6D4_7362_5575_1E5D.asc ] http://archive.neon.kde.org/tmp/%<repo>s %<dist>s main',
repo: repo, dist: dist)
end
- format('deb-src [signed-by=/etc/apt/keyrings/444D_ABCF_3667_D028_3F89__4EDD_E6D4_7362_5575_1E5D.gpg] http://archive.neon.kde.org/%<repo>s %<dist>s main',
+ format('deb-src [ signed-by=/etc/apt/keyrings/444D_ABCF_3667_D028_3F89__4EDD_E6D4_7362_5575_1E5D.asc ] http://archive.neon.kde.org/%<repo>s %<dist>s main',
repo: repo, dist: dist)
end