[elbe-devel] [PATCH] elbepack: add package architecture to source.xml
Eduard Krein
eduard.krein at linutronix.de
Fri Jun 28 13:59:13 CEST 2024
Am Freitag, dem 28.06.2024 um 11:27 +0200 schrieb Thomas Weißschuh:
> It is necessary for multiarch support and SBOM generation.
>
> Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
Reviewed-by: Eduard Krein<eduard.krein at linutronix.de>
> ---
> elbepack/aptpkgutils.py | 7 +++++++
> elbepack/elbexml.py | 2 ++
> elbepack/schema/dbsfed.xsd | 7 +++++++
> 3 files changed, 16 insertions(+)
>
> diff --git a/elbepack/aptpkgutils.py b/elbepack/aptpkgutils.py
> index ac14789f04a6..d4d99a2a913c 100644
> --- a/elbepack/aptpkgutils.py
> +++ b/elbepack/aptpkgutils.py
> @@ -215,6 +215,7 @@ class PackageBase:
> installed_version, candidate_version,
> installed_hashes, candidate_hashes,
> installed_prio, candidate_prio,
> + installed_arch, candidate_arch,
> state, is_auto_installed, origin):
>
> self.name = name
> @@ -224,6 +225,8 @@ class PackageBase:
> self.candidate_hashes = candidate_hashes
> self.installed_prio = installed_prio
> self.candidate_prio = candidate_prio
> + self.installed_arch = installed_arch
> + self.candidate_arch = candidate_arch
> self.state = state
> self.is_auto_installed = is_auto_installed
> self.origin = origin
> @@ -250,6 +253,8 @@ class APTPackage(PackageBase):
> chashes = pkg.candidate and _apt_pkg_hashes(pkg.candidate)
> iprio = pkg.installed and pkg.installed.priority
> cprio = pkg.candidate and pkg.candidate.priority
> + iarch = pkg.installed and pkg.installed.architecture
> + carch = pkg.candidate and pkg.candidate.architecture
>
> self.state = pkgstate(pkg)
> self.is_auto_installed = pkg.is_auto_installed
> @@ -264,6 +269,7 @@ class APTPackage(PackageBase):
> iver, cver,
> ihashes, chashes,
> iprio, cprio,
> + iarch, carch,
> pkgstate(pkg), pkg.is_auto_installed,
> origin)
>
> @@ -280,5 +286,6 @@ class XMLPackage(PackageBase):
> node.et.get('version'), None,
> hashes, None,
> node.et.get('prio'), None,
> + node.et.get('arch'), None,
> INSTALLED, node.et.get('auto') ==
> 'true',
> None)
> diff --git a/elbepack/elbexml.py b/elbepack/elbexml.py
> index 21cda18ea7ee..ac68cdea861b 100644
> --- a/elbepack/elbexml.py
> +++ b/elbepack/elbexml.py
> @@ -388,10 +388,12 @@ class ElbeXML:
> if aptpkg.installed_version is not None:
> pak.et.set('version', aptpkg.installed_version)
> pak.et.set('prio', aptpkg.installed_prio)
> + pak.et.set('arch', aptpkg.installed_arch)
> hashes = aptpkg.installed_hashes
> else:
> pak.et.set('version', aptpkg.candidate_version)
> pak.et.set('prio', aptpkg.candidate_prio)
> + pak.et.set('arch', aptpkg.candidate_arch)
> hashes = aptpkg.candidate_hashes
>
> for k, v in hashes.items():
> diff --git a/elbepack/schema/dbsfed.xsd b/elbepack/schema/dbsfed.xsd
> index 4a223c7cf701..8efe3f54de3e 100644
> --- a/elbepack/schema/dbsfed.xsd
> +++ b/elbepack/schema/dbsfed.xsd
> @@ -3014,6 +3014,13 @@ SPDX-FileCopyrightText: Linutronix GmbH
> </documentation>
> </annotation>
> </attribute>
> + <attribute name="arch" type="string" use="optional">
> + <annotation>
> + <documentation>
> + architecture of the package in the original
> repository.
> + </documentation>
> + </annotation>
> + </attribute>
> <attribute name="on_src_cd" type="string" use="optional">
> <annotation>
> <documentation>
>
> ---
> base-commit: 093797d9dd8c2aa4dfc678513f7e915de9a37fdd
> change-id: 20240628-xml-arch-2-f6a324f7eadb
> prerequisite-change-id: 20240628-xml-arch-e556827fdbe3:v2
>
> Best regards,
--
Eduard Krein
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 19; Fax.: +49 7556 25 999 99
Hinweise zum Datenschutz finden Sie hier (Informations on data privacy
can be found here): https://linutronix.de/legal/data-protection.php
Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen |
Registergericht (Registration Court): Amtsgericht Freiburg i.Br.,
HRB700 806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas
Gleixner, Tiffany Silva, Sean Fennelly, Jeffrey Schneiderman
More information about the elbe-devel
mailing list