19 Commits

Author SHA1 Message Date
Patrick McCarty
8ff80b0be2 Sync options for 'autospec' and 'autospecnew' commands
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>
2018-03-26 14:12:38 -07:00
Patrick McCarty
05634010e9 Disable recipe echo and set -x for 'pullrebase'
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>
2018-03-23 16:42:20 -07:00
Patrick McCarty
f6442a0e7f Improve behavior of 'make autospec' for new repos
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>
2018-03-23 11:59:56 -07:00
Patrick McCarty
cc6e70bb29 Enable local repo notice for autospec commands
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>
2018-03-08 14:01:48 -08:00
Patrick McCarty
f3989c0d5a Enable local repo support for autospec
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>
2018-03-07 16:36:41 -08:00
Patrick McCarty
f697b227e8 Rename Makefile.functions to Makefile.shared
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>
2018-03-07 16:00:24 -08:00
Patrick McCarty
128799fa02 local repo: unhide local repo conf files
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>
2018-03-06 16:56:47 -08:00
Patrick McCarty
ad77e695dc local repo: instantiate repo after creating the directory
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>
2018-03-06 16:56:47 -08:00
Patrick McCarty
8bf6c59e96 Enable local repo support for 'make build'
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>
2018-03-06 16:56:47 -08:00
Patrick McCarty
ac3f1898f6 local repo: forcibly remove RPMs from the local dir
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>
2018-03-06 16:56:47 -08:00
Patrick McCarty
e3b1adedd8 local repo: add 'repostatus' command
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>
2018-03-06 16:56:47 -08:00
Patrick McCarty
ab142ead38 local repo: run createrepo after 'repodel' removes RPMs
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>
2018-03-06 16:56:47 -08:00
Patrick McCarty
a9982b4064 local repo: add Mock support and enable/disable commands
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>
2018-03-06 16:56:47 -08:00
Patrick McCarty
1cc337d5fa Fix support for ARCHIVES in autospec rules
PKG_NAME and URL were properly supported, but ARCHIVES needed to be
written back to the package repo makefile.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-01-16 13:22:57 -08:00
Patrick McCarty
a3f2351225 Adopt strict policy for koji submissions
Because there have been very few situations in the past requiring a
"make koji" from a branch other than master, add a strict check that the
active local branch is "master". This also blocks submissions from a
"detached" state, which was previously permitted.

Also, fix and consolidate the git push commands into one. Now that the
branch check is implemented, the "master" refspec can be used, and
explicitly push *one* tag (the tag created immediately before the push).
The --follow-tags and --tags options don't have the intended effect, so
omit them.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2018-01-12 14:43:19 -08:00
Leandro Dorileo
e0a2933bce Introduce pre build and koji targets
These are targets to be executed before build and koji targets. They
are meant to execute security and validation checks.

Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
2018-01-10 12:57:33 -08:00
Icarus Sparry
56b23370bd Remove an extra layer of shell
As pointed out by Kai, I can avoid one level of shell wrapping. Mock
is already running this via "/bin/sh -c" (function doshell in
/usr/lib/python2.7/site-packages/mockbuild/util.py currently).

Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
2017-12-24 12:47:13 -08:00
Icarus Sparry
f99b2de07e Add rootshell target and change shell to be unprivileged
Change the "make shell" command to invoke a shell as the "mockbuild"
user and starting in ~mockbuild. This is typically what you want when
you enter the build environment.

Add a new target, "rootshell", which gives the old behavior, a root
shell starting at /.

Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
2017-12-23 14:40:53 -08:00
Patrick McCarty
c18abdb9db Initial import
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-12-22 22:51:05 -08:00