2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-05 12:37:54 +00:00
Files
xcat-core/xCAT-test
Daniel Hilst 2f8010badd feat(build): add a source-only mode to buildrpms.pl
buildrpms.pl already produces a source rpm for every package on every run --
buildall() is createmockconfig -> buildsources -> buildspkgs (mock --buildsrpm)
-> buildpkgs (mock --rebuild). Source-only is that sequence without the last
step, so it belongs here rather than in a parallel implementation: the spec, the
staged sources and the mock root are identical either way, and anything built
beside them can drift from what a real build does.

--source-only stops after buildspkgs. Two things downstream had to learn about
it, and both are about not publishing something untrue:

- index_repo no longer re-indexes the binary directory. Running createrepo_c
  over a directory with no binaries in it would replace working metadata with
  metadata for an empty repository -- a repo that resolves nothing. The srpm
  index is still regenerated.
- write_repo_metadata_dir emits nothing. The .repo file and buildinfo describe
  an installable binary repository, which this mode does not produce.

--source-only with --merge-core-repos is refused: one builds packages, the other
assembles per-arch trees that are already built.

buildrpms.pl cannot be loaded by a test -- it runs mkdir, git and read_text at
file scope -- so the two routines whose behaviour changed are lifted out with a
regex and eval'd into a scratch package with their collaborators stubbed, per
the code standard, with BAIL_OUT if the extraction stops matching. The CLI
contract is exercised by running the real program. Verified by mutation:
removing the index_repo guard reddens 2 of the 7 assertions.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-09-01 07:07:41 -03:00
..
2018-04-26 15:15:47 -04:00