From: Zbigniew Jędrzejewski-Szmek Date: Fri, 25 Nov 2022 18:14:42 +0000 (+0100) Subject: ci: install pefile X-Git-Tag: v253-rc1~334^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1f6da5d902ef192c7fe24ffd4ebb3b9e1f2ecda8;p=thirdparty%2Fsystemd.git ci: install pefile --- diff --git a/.github/workflows/build_test.sh b/.github/workflows/build_test.sh index 1eed81600cc..0d18c6c18be 100755 --- a/.github/workflows/build_test.sh +++ b/.github/workflows/build_test.sh @@ -53,6 +53,7 @@ PACKAGES=( python3-evdev python3-jinja2 python3-lxml + python3-pefile python3-pip python3-pyparsing python3-setuptools diff --git a/.github/workflows/unit_tests.sh b/.github/workflows/unit_tests.sh index 9a9fbb36ab5..70ba090eb8e 100755 --- a/.github/workflows/unit_tests.sh +++ b/.github/workflows/unit_tests.sh @@ -21,6 +21,7 @@ ADDITIONAL_DEPS=( libzstd-dev perl python3-libevdev + python3-pefile python3-pyparsing rpm zstd diff --git a/README b/README index d8c279f9fa2..b12ad3f2360 100644 --- a/README +++ b/README @@ -207,6 +207,7 @@ REQUIREMENTS: docbook-xsl (optional, required for documentation) xsltproc (optional, required for documentation) python-jinja2 + python-pefile python-lxml (optional, required to build the indices) python >= 3.5 meson >= 0.53.2 diff --git a/src/ukify/test/test_ukify.py b/src/ukify/test/test_ukify.py index a4afa56ad98..48ffc6d4954 100755 --- a/src/ukify/test/test_ukify.py +++ b/src/ukify/test/test_ukify.py @@ -20,6 +20,12 @@ try: except ImportError: sys.exit(77) +try: + # pyflakes: noqa + import pefile # noqa +except ImportError: + sys.exit(77) + # We import ukify.py, which is a template file. But only __version__ is # substituted, which we don't care about here. Having the .py suffix makes it # easier to import the file. diff --git a/src/ukify/ukify.py b/src/ukify/ukify.py index d4772d2bae0..83423fc7206 100755 --- a/src/ukify/ukify.py +++ b/src/ukify/ukify.py @@ -20,7 +20,6 @@ import subprocess import tempfile import typing -import pefile __version__ = '{{GIT_VERSION}}' @@ -66,6 +65,8 @@ def shell_join(cmd): def pe_executable_size(filename): + import pefile + pe = pefile.PE(filename) section = pe.sections[-1] return section.VirtualAddress + section.Misc_VirtualSize