The 'git branch' command fails at this stage because the master branch
is not initialized locally, but because the remote is also not
initialized, additional special incantations are needed to make this
work. Revert it for now so that users do not see an error message from
the 'git branch' command. A proper fix will follow later.
This reverts commit 71d9699bdd.
Because 'make koji' expects that master should track origin/master,
initialize the tracking branch during the autospecnew.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
If you run `newgrp kvm` after the user-setup script completes, and then
proceed to run `make build`, `make autospec`, etc. within a package
repo, mock will fail because it tries to `groupadd mockbuild` in the
package chroot with the wrong group ID. Logging out and logging back in
results in correct behavior, so leave that as the sole recommendation.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
In my previous commit, one of the changed lines used a combination of
tabs and spaces, but it should have used tabs only.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Over time, the autospec options used for 'autospec' and 'autospecnew'
commands have diverged. They are meant to be in sync, so do that here,
and format the recipe in a way that eases future changes.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
The echo commands at key points of the pullrebase should be sufficient
for users to know what action pullrebase performed.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
If a new package repo is created with make autospecnew, and then make
autospec is run immediately afterward, a git fetch is performed, but
the remote repo is not likely to exist yet.
Address this issue by only running the git fetch if the remote origin is
initialized locally via a git push, git pull, etc.
In addition to properly supporting the workflow described above, this
change also enables developers to build packages that are *not* intended
to be included in Clear Linux OS, thus not destined to appear in the
'packages' file. Package repos of this nature might have different,
manually configured remotes, or the remote may never be initialized at
all if builds are only run locally.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
A 'make clone' sets the proper git pushurl for autospec, but a
subsequent 'make pull' does not honor override. Fix by adding a special
condition for 'make pull'.
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>
To make sure the conf files are more visible in the local repo
directory, unhide them by installing them without a leading dot
character.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
DNF seems to ignore an uninitialized repo, but Yum does not. To fix,
make sure to run createrepo immediately after creating the local repo
directory.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
With this change, 'make build' will automatically use the local repo, if
enabled. A notice is printed in case the user didn't want to use the
local repo and wishes to disable it with 'make repodisable'.
Another functional change here is that 'make build' will use the in-tree
mock config (clear.cfg) instead of the /etc/mock/clear.cfg. If this
behavior is not desired, then MOCK_CONF can be modified in
Makefile.config, or overridden by a Makefile.config.site_local.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
In case the user runs 'make repoclean' followed by 'make repoadd' in a
package repo dir, 'rm' will complain. Add the -f option to silence those
warnings.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
In case the user wants to remove all RPMs from the local repo, they can
now run 'make repoclean' at toplevel.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This new command displays a helpful summary of what packages exist in
the local RPM repo and whether it is enabled for Yum/DNF, Mock, or both.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
To ensure that RPM repo metadata is always up-to-date for the local
repo, make sure createrepo is run after removing the RPMs.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
An interface for a local RPM repository already exists, so extend it by
adding Mock support and the ability to enable and disable the
repository, at package level and at toplevel.
Integration for commands that use Mock will be added in separate
commits.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
With the assumption that developers will be keeping up-to-date by
running 'make pull; make clone', trying to clone the remote repo here is
not necessary.
If the package git repo already exists locally, no action is taken.
Otherwise, create a local package git repo, and then run autospec.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>