Support both absolute and relative paths for the cert options, instead
of relative paths only, by using realpath(1) to resolve the arguments.
(Note that the script cannot reference the path arguments verbatim
because much of the script operates in the workspace's toplevel
directory, which is a different location than where the script is
invoked. In that situation, relative paths would not resolve.)
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
After running 'make autospecnew', the freshly created repo only exists locally,
so the repo remote is not yet initialized. The 'git pull --rebase' (via 'make
koji') will then fail due to the uninitialized remote. Improve this case by
only rebasing when the remote is initialized.
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 DOWNLOAD_MIRROR server, the SOURCES_URL server, and upstream
source tarballs may be hosted in many different environments.
Allow users to supply additional curl options via a config to use
whenever connecting to the DOWNLOAD_MIRROR and SOURCES_URL servers and
work better with their particular hosting environment. Because upstream
source tarballs can come from many different locations, do not offer a
global config and instead allow users to define this manually as needed
when the rule is used.
Signed-off-by: George T Kramer <george.t.kramer@intel.com>
Eventually developers - when they know what they're doing - want to
manipulate a little bit the mock arguments to i.e skip a few stages
in the mock build cycle while they're hacking a package.
One example is when developers are testing changes to a spec file but
not touching dependencies and they're [re]running the build multiple times
it would be nice to not cleanup before the build and run a rebuild
for example with: --rebuild --no-clean
With this patch one should only do:
make build MOCK_OPTS="--rebuild --no-clean"
Signed-off-by: Leandro Dorileo <leandro.maciel.dorileo@intel.com>
Users are encouraged to run the user-setup script as documented in the
"Automated setup" section. To clarify that the "Manual setup" section is
an alternative to "Automated setup", move those docs to the end of the
README instead.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Because the package repo cloning process can take a lot of time, do not
clone them by default. Instead, add a new --clone-packages|-a option to
perform this task.
Also, immediately before the script exits, document some possible next
steps when *not* cloning package repos (the new default).
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
To allow setting up multiple workspaces in the same directory, or if the
name "clearlinux" is not the desired name, add a --directory|-d option
to let the user configure it.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Since Clear Linux has many package repos, cloning them all in serial can
take a long time. Add a -j option to the script to let users speed up
the process.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
My previous change to handling of the 'upstream' file assumed that the
file exists already, but this need not be true.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
When SOURCES_URL is not defined, the current behavior of extracting
source files from SRPMs in the latest published Clear Linux release has
proven to not work so well: It is not optimal when users are adding new
packages, modifying existing packages, not building from latest master,
etc.
Instead, run 'generateupstream' automatically so that source files are
downloaded from the remote locations listed in the spec file. This
target creates the 'upstream' file too, which becomes useful if the user
later defines SOURCES_URL, when 'upstream' is actively consumed.
In the event that download errors occur, as a fallback mechanism, try to
find the corresponding SRPM from a published release of Clear Linux OS.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
I will reusing this code (largely unmodified) in the next commit, so
move it into a separate target to easily inspect changes.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
If any of the curl commands fail, it's better for the entire target to
fail. In this way, developers will be properly notified.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
The curl --no-proxy hint is not needed anymore, since Clear Linux OS has
an autoproxy, and curl will honor proxy environment variables.
Also, pass -L to curl to follow redirects, similarly to other curl calls
in this makefile.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Improve the detection of source URLs by matching only non-commented
Source* lines with "://" present.
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>