trivial: ci: debian: Use helper script to install dependencies instead. (#4906)

* trivial: ci: debian: Use helper script to install dependencies instead.

Should fix building Debian stable containers
Fixes: #4901

* trivial: debian: ci: only populate fwupd-doc if dependencies are met

* trivial: ci: debian: generate control file using fwupd_setup_helpers
This commit is contained in:
Mario Limonciello 2022-08-05 02:43:13 -05:00 committed by GitHub
parent 639493259d
commit a19b6f23e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 55 deletions

View File

@ -4,5 +4,6 @@ ENV CI_NETWORK true
RUN echo fubar > /etc/machine-id
%%%ARCH_SPECIFIC_COMMAND%%%
%%%INSTALL_DEPENDENCIES_COMMAND%%%
RUN apt install -yq --no-install-recommends python3-apt
WORKDIR /github/workspace
CMD ["./contrib/ci/debian.sh"]

View File

@ -6,14 +6,12 @@
#
import os
import sys
import xml.etree.ElementTree as etree
from fwupd_setup_helpers import get_build_dependencies
def parse_control_dependencies(requested_type):
TARGET = os.getenv("OS")
QUBES = os.getenv("QUBES")
deps = []
dep = ""
if TARGET == "":
print("Missing OS environment variable")
@ -33,56 +31,7 @@ def parse_control_dependencies(requested_type):
SUBOS = platform.machine()
tree = etree.parse(os.path.join(os.path.dirname(sys.argv[0]), "dependencies.xml"))
root = tree.getroot()
for child in root:
if not "type" in child.attrib or not "id" in child.attrib:
continue
for distro in child:
if not "id" in distro.attrib:
continue
if distro.attrib["id"] != OS:
continue
control = distro.find("control")
if control is None:
continue
packages = distro.findall("package")
for package in packages:
if SUBOS:
if not "variant" in package.attrib:
continue
if package.attrib["variant"] != SUBOS:
continue
if package.text:
dep = package.text
else:
dep = child.attrib["id"]
if child.attrib["type"] == requested_type and dep:
version = control.find("version")
if version is not None:
dep = "%s %s" % (dep, version.text)
inclusions = control.findall("inclusive")
if inclusions:
for i in range(0, len(inclusions)):
prefix = ""
suffix = " "
if i == 0:
prefix = " ["
if i == len(inclusions) - 1:
suffix = "]"
dep = "%s%s%s%s" % (dep, prefix, inclusions[i].text, suffix)
exclusions = control.findall("exclusive")
if exclusions:
for i in range(0, len(exclusions)):
prefix = "!"
suffix = " "
if i == 0:
prefix = " [!"
if i == len(exclusions) - 1:
suffix = "]"
dep = "%s%s%s%s" % (dep, prefix, exclusions[i].text, suffix)
deps.append(dep)
return deps, QUBES
return get_build_dependencies(OS, SUBOS), QUBES
def update_debian_control(target):

View File

@ -71,7 +71,7 @@ with open("Dockerfile", "w") as wfd:
if i < len(deps) - 1:
wfd.write("\t%s \\\n" % deps[i])
else:
wfd.write("\t%s \n" % deps[i])
wfd.write("\t%s || true\n" % deps[i])
elif line == "%%%ARCH_SPECIFIC_COMMAND%%%\n":
if OS == "debian" and SUBOS == "s390x":
# add sources

View File

@ -1 +0,0 @@
usr/share/*doc

View File

@ -63,6 +63,10 @@ override_dh_install:
#install MSR conf if needed (depending on distro)
[ ! -d debian/tmp/usr/lib/modules-load.d ] || dh_install -pfwupd usr/lib/modules-load.d
[ ! -d debian/tmp/lib/modules-load.d ] || dh_install -pfwupd lib/modules-load.d
#install docs (maybe)
[ -d debian/usr/share/doc ] || dh_install -pfwupd-doc usr/share/doc
dh_missing -a --fail-missing
#this is placed in fwupd-tests