Currently, when using the dist-git layout, build results are written directly to layout root, since all of builddir, srpmdir and rpmdir are set to root. This pattern is unnecessarily difficult to cover in gitignore rules and has led to situation in Fedora where, for many packages, running fedpkg local pollutes git status.
Instead of writing to repository root, it is much cleaner to write to a single subdirectory which is easy to add to ignore rules. To enable this without interfering with current usage, new config option results_diris added. Default value preserving current behavior is root, whereas setting subdir leads to selecting an alternative dist-git layout that uses subdirectory results instead.
This topic has been discussed in Fedora mailing list thread. There, it was proposed that the subdirectory would be the same that the mockbuild command uses. Unfortunately, resolving mockbuild results dir name requires parsing the spec file, whereas layout selection happens before. Because of this difficulty, a simpler method of fixed name "results" is used here.
Earlier, layout selection was based solely on directory contents. Since build results directory is only created after something is built, that method is not adequate. Thus, additionalhint input is added to layout from_path method, allowing selecting the subdir variant from standard dist-git structure.
To keep the build result directory as simple as possible, and as similar to mockbuild results, architecture specific subdirectories are not created. This requires adding new member to layouts: rpmfilename. It is passed directly to rpmdefines.
Currently, when using the dist-git layout, build results are written directly to layout root, since all of builddir, srpmdir and rpmdir are set to root. This pattern is unnecessarily difficult to cover in gitignore rules and has led to situation in Fedora where, for many packages, running
fedpkg localpollutesgit status.Instead of writing to repository root, it is much cleaner to write to a single subdirectory which is easy to add to ignore rules. To enable this without interfering with current usage, new config option
results_diris added. Default value preserving current behavior isroot, whereas settingsubdirleads to selecting an alternative dist-git layout that uses subdirectoryresultsinstead.This topic has been discussed in Fedora mailing list thread. There, it was proposed that the subdirectory would be the same that the
mockbuildcommand uses. Unfortunately, resolving mockbuild results dir name requires parsing the spec file, whereas layout selection happens before. Because of this difficulty, a simpler method of fixed name "results" is used here.Earlier, layout selection was based solely on directory contents. Since build results directory is only created after something is built, that method is not adequate. Thus, additional
hintinput is added to layoutfrom_pathmethod, allowing selecting the subdir variant from standard dist-git structure.To keep the build result directory as simple as possible, and as similar to mockbuild results, architecture specific subdirectories are not created. This requires adding new member to layouts: rpmfilename. It is passed directly to rpmdefines.
Signed-off-by: Otto Urpelainen oturpe@iki.fi