If something already exists in backup form, skip it, otherwise move
the content to the backup directory.
Signed-off-by: William Douglas <william.douglas@intel.com>
Using the --stat flag also has the benefit of automatically colorizing
the output when appropriate.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Comparing whether commit hashes for `HEAD` and `origin/master` are not
equal captures three typical scenarios:
1. HEAD is behind origin/master
2. HEAD is ahead of origin/master
3. HEAD is ahead of an older commit in origin/master
The intent of `make log` is to capture cases #2 and #3, and not #1, so
use `git rev-list ...` with the appropriate commit range instead.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Always clone autospec from the upstream clearlinux/autospec github repo
regardless of whether a gitolite instance is configured.
Also, do not set the repo's pushurl, since the expectation is for
contributors to push changes to github forks of autospec, not directly
to the upstream repo.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
If a package repo contains only untracked content, `make diff` prints
output for it in this form:
Uncommitted changes in: packages/FOO
0 files changed
Avoid this type of output by more carefully detecting local package repo
changes that will actually produce a diffstat.
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>
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>
Add a new 'log' command that is similar to 'diff' but shows the log of
commits from HEAD to origin/master, thus listing all commits that have
not yet been pushed.
For example:
$ make log
packages/glib-networking
glib-networking: enable installed tests
packages/gnome-desktop
gnome-desktop: Autospec creation for update from version 3.34.3 to version 3.36.0
packages/gnome-terminal
gnome-terminal: Autospec creation for update from version 3.34.2 to version 3.36.0.1
Signed-off-by: Ross Burton <ross.burton@intel.com>
This change allows specifying short/long mock options via MOCK_OPTS
without a leading backslash escape.
For example, `MOCK_OPTS="\--old-chroot --no-clean"` can now be specified
as `MOCK_OPTS="--old-chroot --no-clean"`.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This tool no longer works and the repo looks abandoned (last commit
04/27/2017). The NVD cve database has changed format since.
Signed-off-by: Alex Jaramillo <alex.v.jaramillo@intel.com>
This change enables recurive dependency resolution and packaging when
creating new go packages. To do so the 'autospecnewgo' target is
created and the autospecnew target is slightly modified to align
make target exit code expectations for failure handling.
Create a PKGS_ORPHANED list containing all orphaned package repos (i.e.
package repos for packages not listed in projects/common/packages,
excluding the local compatibility packages/common directory), and use
that list for the `clean-pkgs-dir` command.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
The for-review.txt files were being generated with `git show` and thus
not compatible with `git send-email`. Use `git format-patch` instead to
fix this issue.
Also add a more prominent notice about the existence of for-review.txt
and its intended purpose.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
- Run git commands within the newly created package repo
- Only run these commands if autospec succeeds
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
For some commands, it is useful to be able to add custom prerequisites.
We already support this for `make koji` and `make build`, and there was
just a request to add it for `make autospec` and `make autospecnew`.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Several commands should be using PKGS_LOCAL, which is the list of all
package repos that are present on the system, since the user might not
have all repos from PKGS cloned.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This fixes integration with the GNU Make jobserver such that the
-j/--jobs value passed to make is actually honored.
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>
Since the user-setup script does not clone package repos by default
anymore, 'make pull' can be made more user-friendly by not printing
warnings if some/all/most of the package repos are not already present
in the packages/ directory.
Instead, only populate the package "pull" list with names from the
packages file that are currently present in the packages/ directory.
Package repos that are not present can be cloned as before: 'make clone'
to clone all missing package repos, or 'make clone_PKG' to clone a
selected package repo.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
If the user tries to create a new package with 'make autospecnew', a
package repo will be created from scratch, even if a repo exists with
the same name at PKG_BASE_URL.
This problem stems from 'make autospecnew' assuming that all tracked
package repos are cloned already, but is a bad assumption, given the
recent change of behavior for user-setup.sh (not cloning package repos
by default).
Resolve it by first trying to clone the repo with "make clone_PKGNAME";
clone_PKGNAME targets are automatically defined for all packages listed
in the projects/common/packages file. As long as users have an
up-to-date packages file (i.e. are running 'make pull' regularly), then
this solution works well. The case not covered is when packages are
added, then later removed; package repos will already exist remotely in
this case. However, this is a relatively rare case, so I opted to only
handle the common case where a package is added and never removed from
the distro at a later point.
(Side note: I originally wanted to 'git ls-remote REPO' to check remote
repo existence, but this does not work well with Github, as Github
prompts for username/password for remotes that appear to not exist,
since they might be private repos. Prompting a Github username/password
in this case is not very user-friendly. Using the Github API looks
viable, but I would rather not special case the handling of Github repos
in the common tooling.)
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
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>
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>
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>
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>
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>
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>
Improve the output for "make status" by displaying only relevant
status parts (avoiding the git warning and instructions output).
Also make sure we don't run git status "non git package folders"
(i.e packages/common).
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>