From 9bfe801c96cd5f86ea0d02cf55e6cf740c47e815 Mon Sep 17 00:00:00 2001 From: William Douglas Date: Mon, 4 Nov 2024 10:54:01 -0800 Subject: [PATCH] Fix subdir for pyproject When using optimized builds for pyproject patterns that also need a subdir, the path needs to be reset before attempting to change to the optimized directory. Signed-off-by: William Douglas --- autospec/specfiles.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autospec/specfiles.py b/autospec/specfiles.py index e0cefdb8..3274ea30 100644 --- a/autospec/specfiles.py +++ b/autospec/specfiles.py @@ -1434,6 +1434,9 @@ def write_pyproject_pattern(self): for module in self.config.pypi_overrides: self._write_strip(f"pypi-dep-fix.py . {module}") self._write_strip("python3 -m build --wheel --skip-dependency-check --no-isolation " + self.config.extra_configure) + self._write_strip("\n") + if self.config.subdir: + self._write_strip("popd") if self.config.config_opts['use_avx2']: self._write_strip("pushd ../buildavx2/" + self.config.subdir) @@ -1464,8 +1467,6 @@ def write_pyproject_pattern(self): self._write_strip("popd") self._write_strip("\n") - if self.config.subdir: - self._write_strip("popd") self.write_build_append() self.write_check() self._write_strip("%install")