[uyuni-users] Feature request: Add missing Debian headers to repository metadata before signing
Hello Uyuni devel, this is a feature request for sysadmins, managing Debian / Ubuntu systems with Uyuni. Although there has been a lot of work to support Ubuntu / Debian, there is still some major thing missing. Several metadata headers are missing for Debian packages, that causes major issues on Debian / Ubuntu systems. One header is the "Multi-Arch" header, that is missing. This missing header causes packages to be installable over and over again. "apt" does not correctly "get it", that this package is already the newest installed and suggests these packages when searching for updates all the time. Also some dependencies cannot be successfully solved, because of this missing header. So the workaround most Debian / Ubuntu admins are doing right now, is to - sync the data into Uyuni - wait for spacewalk to generate the "Packages.gz" file - start - possibly below - script to add the missing "Multi-Arch" header to the "Packages.gz" file - sign the file Currently, I don't think that there are any efforts to tune the Uyuni database to also support the missing headers of Debian packages. So a further workaround could be to include such a script to add the missing headers "while or after" the "Packages.gz" gets created (or has been created), but before the file gets "signed". This could be added somewhere within the "DebRepositoryWriter.java" file, where the "signing" of the channel starts. First, I only had written a script to only add the "Multi-Arch" header. But this script below adds all headers missing for a packages. For this to work, you - of course - need the original "Packages.gz" file from Debian / Ubuntu with *all* headers present. Think about it. Would be cool, if this part could also be integrated into Uyuni. Just an idea and still used as workaround.... Best regards, Robert #!/usr/bin/env python -tt # Basically, this should only add one major header # 'Multi-Arch' to the Debian Packages file, but now # we add all missing headers. # # This only works correctly, if you are syncing the Debian repos # directly to one channel within Spacewalk or Uyuni # # You also need python-debian (which is installed on # Spacewalk server) to run this script # # Author: Robert Paschedag <robert.paschedag@netlution.de> # Version: 20181107 import sys import os from debian.deb822 import * if len(sys.argv) < 3: print "Usage: %s <path_to_unzipped_Packages_from_Spacewalk_Uyuni> <path_to_original_Debian_repo>" % sys.argv[0] sys.exit(1) spacewalk_file = sys.argv[1] original_file = sys.argv[2] if not os.path.isfile(spacewalk_file): print "Error: Inputfile '%s' not available." % spacewalk_file sys.exit(1) if not os.path.isfile(original_file): print "Error: Inputfile '%s' not available." % original_file sys.exit(1) spacewalk_packages = {} original_packages = {} with open(spacewalk_file, 'r') as pkgs: for pkg in Packages.iter_paragraphs(pkgs): spacewalk_packages[pkg['Package'] + pkg['Version'] + pkg['Architecture']] = pkg with open(original_file, 'r') as orig_file: for pkg in Packages.iter_paragraphs(orig_file): p = pkg['Package'] v = pkg['Version'] a = pkg['Architecture'] if spacewalk_packages.has_key(p + v + a): # found package. Check for missing headers for header in pkg.keys(): if not header in spacewalk_packages[p + v + a].keys(): spacewalk_packages[p + v + a][header] = pkg[header] # open new file new_package = open(spacewalk_file + '.new', 'w') for pkg in spacewalk_packages.values(): pkg.dump(new_package) new_package.write("\n") new_package.close() sys.exit(0) uyuni-test:/usr/local/sbin # -- To unsubscribe, e-mail: uyuni-users+unsubscribe@opensuse.org To contact the owner, e-mail: uyuni-users+owner@opensuse.org
participants (1)
-
Robert Paschedag