In Clear Linux OS, all package spec files define their header fields
(and other required sections, like %description) above the first %files
section. Restricting the `rpmspec` queries to sections of %files speeds
up the command significantly, most notably for `texlive`, which has the
largest spec file.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
The `rpmspec` commands usually specify the same flags aside from the
queryformat and the spec file(s) to query.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
The local repo implementation makes some assumptions about the contents
of the package manager and mock conf files, so do some basic input
validation to assess whether the assumptions are correct, and exit with
informative errors if not.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
For commands that modify contents of $(TOPLVL)/repo, wrap them with
`flock`, using a lock file `repo.lock` within the repo directory. This
ensures that the repo directory tree is not otherwise modified while
each command is running.
To keep the implementation simple, I opted to not wrap entire makefile
targets with a lock (e.g. lock the entire operation of `make repoadd`).
If users need that level of control, they can implement locking in a
separate wrapper script.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Over the lifetime of Clear Linux OS, many packages have been added and
removed, but the package *repos* always remain once they have been
created.
Thus, if a package is removed at one point, and later added back to the
distro, the same package repo should be used. This commit adds support
to `make autospecnew` for that use case, always using a pre-existing
package repo if one is available.
(Note that the gitolite repo detection is more complicated because it
must support configurations with and without "wild repos" enabled.)
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
The RPMs from repo `localrepo` should have priority over RPMs from the
main repo, so set `priority=1` for it.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
In case git repos cloned by autospec into results/ contain RPMs, we do
not want to hardlink those files to rpms/.
Fix the issue by limiting the find depth to 1 level so that the tooling
only hardlinks rpms created by Mock.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
To improve visibility of which RPMs a user may want to install after a
build, copy (hardlink) them to a separate "rpms" directory.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
I often find myself running "make clean proper", when by default, I
think the old build artifacts should be removed so that the results
directory is pristine at the start of a new build.
As a result, if users wish to keep all build artifacts from a previous
"make build" or "make autospec", they must keep manual backups, as the
tooling no longer keeps them around.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Similar to how a notice is printed for 'make build', enable the same
notice for 'make autospec' and 'make autospecnew'.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Local repo support was recently added for 'make build', so do the same
for 'make autospec' and 'make autospecnew'.
Note that to make mock invocations work at both package-level and
toplevel, I am resolving MOCK_CONFIG_VAL with the realpath function.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
The name "shared" makes more sense at this point, since the makefile
does not contain only functions, and it is meant to be shared between
Makefile.common and Makefile.toplevel.
Also, reorder the makefile includes, since Makefile.shared should be
able to use variables defined in Makefile.config.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>