From 9b0fb8e4555ebf571d09c3ffb59f6ccb04242088 Mon Sep 17 00:00:00 2001 From: Dan Voiculeasa Date: Thu, 23 Dec 2021 15:05:51 +0200 Subject: [PATCH] debian: Add and patch dh-python package This is a transient work that enables us to progress Debian integration. This work affects only Debian. Sysinv loads stevedore plugins. The logic is based on the fact that the source files are listed in SOURCES.txt which is included in the egg. The package that provides a plugin is determined by parsing entry_point and distribution data. Distribution data loads information from SOURCES.txt. dh-python is used during build and silently removes the file that sysinv expects to be present. Patch the package to keep the file. Skip CentOS tests because this is a Debian only package. Debian tests: PASS: build python package, build non-package python PASS: SOURCES.txt present in .egg-info in python package Partial-Bug: https://bugs.launchpad.net/starlingx/+bug/1955648 Signed-off-by: Dan Voiculeasa Change-Id: Id45b1ba93f9ee88cc01a9cb1fb25527b8a5f1e19 --- debian_pkg_dirs | 1 + python/dh-python/debian/meta_data.yaml | 10 ++++++ .../patches/0001-Keep-SOURCES.txt.patch | 31 +++++++++++++++++++ python/dh-python/debian/patches/series | 1 + 4 files changed, 43 insertions(+) create mode 100644 python/dh-python/debian/meta_data.yaml create mode 100644 python/dh-python/debian/patches/0001-Keep-SOURCES.txt.patch create mode 100644 python/dh-python/debian/patches/series diff --git a/debian_pkg_dirs b/debian_pkg_dirs index bc7197820..3c5b293f3 100644 --- a/debian_pkg_dirs +++ b/debian_pkg_dirs @@ -55,6 +55,7 @@ ostree/initramfs-ostree ostree/mttyexec ostree/ostree ostree/ostree-upgrade-mgr +python/dh-python python/python3-setuptools security/keyrings.alt security/python-keyring diff --git a/python/dh-python/debian/meta_data.yaml b/python/dh-python/debian/meta_data.yaml new file mode 100644 index 000000000..df43841e7 --- /dev/null +++ b/python/dh-python/debian/meta_data.yaml @@ -0,0 +1,10 @@ +--- +debname: dh-python +debver: 4.20201102+nmu1 +dl_path: + name: dh-python-4.20201102+nmu1.tar.gz + url: https://salsa.debian.org/python-team/tools/dh-python/-/archive/4.20201102+nmu1/dh-python-4.20201102+nmu1.tar.gz + md5sum: e8ffceb6618446cd57916d3063a326e3 +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true diff --git a/python/dh-python/debian/patches/0001-Keep-SOURCES.txt.patch b/python/dh-python/debian/patches/0001-Keep-SOURCES.txt.patch new file mode 100644 index 000000000..cae2c96cf --- /dev/null +++ b/python/dh-python/debian/patches/0001-Keep-SOURCES.txt.patch @@ -0,0 +1,31 @@ +From a199540ebeb3be34ce8602f5977cdaf867c578d9 Mon Sep 17 00:00:00 2001 +From: Dan Voiculeasa +Date: Thu, 23 Dec 2021 15:00:17 +0200 +Subject: [PATCH] Keep SOURCES.txt + +Sysinv logic is based on the fact that the source files are listed +in SOURCES.txt. + +Partial-Bug: https://bugs.launchpad.net/starlingx/+bug/1955648 +Signed-off-by: Dan Voiculeasa +--- + dhpython/fs.py | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/dhpython/fs.py b/dhpython/fs.py +index 08fd8a9..6d411e2 100644 +--- a/dhpython/fs.py ++++ b/dhpython/fs.py +@@ -400,9 +400,6 @@ class Scan: + self.result['requires.txt'].add(join(dpath, 'requires.txt')) + if 'namespace_packages.txt' in file_names: + self.result['nsp.txt'].add(join(dpath, 'namespace_packages.txt')) +- if 'SOURCES.txt' in file_names: +- os.remove(join(dpath, 'SOURCES.txt')) +- file_names.remove('SOURCES.txt') + + def is_egg_file(self, fpath): + """Check if given file contains egg-info.""" +-- +2.30.0 + diff --git a/python/dh-python/debian/patches/series b/python/dh-python/debian/patches/series new file mode 100644 index 000000000..e6db44147 --- /dev/null +++ b/python/dh-python/debian/patches/series @@ -0,0 +1 @@ +0001-Keep-SOURCES.txt.patch