#413 Correct source flattening for RPM 4.19.90+ (#2290735)
Merged 7 months ago by msrb. Opened 9 months ago by adamwill.
adamwill/standard-test-roles rpm-420-flatten-alt2  into  master

@@ -92,10 +92,23 @@ 

      "_sourcedir {{tenv_workdir}}/" --define "_builddir {{srcdir}}"

    when: not fetch_only

  

+ # https://github.com/rpm-software-management/rpm/issues/3147#issuecomment-2154192419

+ # handles rpm 4.20 adding another level of build directory nesting

+ - name: Discover the build directory

+   shell: |

+     rpmbuild -bc --short-circuit --define "_builddir {{srcdir}}" \

+     --define "__spec_build_pre echo XXX %{_builddir}; exit 0" \

+     {{tenv_workdir}}/*.spec | grep XXX | cut -d" " -f2

+   register: builddir

+   when:

+     - flatten

+     - not fetch_only

+ 

  - name: Flatten sources

    shell: |

      shopt -s dotglob

-     mv {{ srcdir }}/*/* {{ srcdir }}

+     mv {{ builddir.stdout }}/*/*/* {{ builddir.stdout }}

    when:

      - flatten

      - not fetch_only

+     - "rpm_vercheck.rc == 0"

RPM 4.19.90 (4.20 alpha 1) introduced per-build directories,
which adds one more level to the build directory nesting that
this is trying to flatten out. This uses a trick provided by
@pmatilai to discover the true build directory; he says this
works on both old and new RPM. We then flatten relative to that
directory.

Signed-off-by: Adam Williamson awilliam@redhat.com

Can somebody please take a look and merge one of these fixes? this is a clear and significant breakage.

I am not really familiar with this package, but I do have the commit rights here.

Commit 79ad14c fixes this pull-request

Pull-Request has been merged by msrb

7 months ago

Pull-Request has been merged by msrb

7 months ago
Metadata