This release adds fixes to remove unsuccessful curl download files,
merges the git helper functions into a generic one to use for all future
git commands, and rewrites the cmd-line code to a more maintainable and
extensible implementation.
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
Changed it to be a function in main.go instead of a method since it
wasn't using anything related to the Builder struct.
Minor tweaks to make code more idiomatic: avoid i for the non-index
variable in range, return an error instead of printing the error and
boolean.
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
The method (and use of reflect package) is unnecessary when we are
using a literal string as argument.
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Instead of having the flag specification, flag parsing, and command
processing in three different parts of the main function, move the
whole code for each command to its own function.
This patch also fixes the issue that build-all was always using the
default values of the flags, since the build-update specific flags
were not being added to its FlagSet. The problem was hard to see
because all commands shared the same scope.
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
And also dump the Stderr of the command to os.Stderr. Without a git
failure might not give enough information about what gone wrong,
e.g. when trying to call "git commit" without a user.email configured.
The commit message was changed to include the Clear version from which
the Mix was based off.
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Only create the file if the HTTP connection succeeds, and in case of
failure later on during download, remove the partial file.
This let the user retries the operation, otherwise the empty/partial
file will prevent the download. One of such cases is forgetting to set
the https_proxy.
Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
This release fixes mixer to use absolute path for certificates so that
it can be run from different directories other than the workspace.
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
This release updates the name of the release tarball to 'mixer-tools',
and adds better validation to the version file reading.
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
This release changes add-rpms to hardlink instead of copy if possible,
speeding up the operation when there are many local rpms, and falls back to
a regular copy if hardlinking fails.
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
This release fixes a bug for compatibility with the swupd-client v3.8.3
release; the /usr/share/clear/update-ca directory must now be manually
created in the os-core-update bundle before installing the certificate.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Starting with swupd-client v3.8.3, the update-ca directory is no longer
created for the build, so the cert copy is failing. Fix the issue by
creating the directory before the copy operation.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This release enables the build-all option which will generate all content
for a mix; this means: chroots, all update content (manifests, packs, etc),
and auto-increments the mixversion number so it can be run consecutively
without any user intervention between mixes.
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
The tools have been converted from many bash scripts into a single binary,
written in Go. This creates a codebase that is much easier to edit and
maintain, and a single tool that provides all the functionality needed. The
interface is more intuitive and easy to use as it provides options and menus
for each subcommand.
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
Because Clear version numbers use numeric digits only, it's possible for
the tag names to conflict with the prefix of a git object hash in the
repo. To remove the possibility of conflict, use the refs/tags/ prefix
when querying the tag names.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
With the current workflow, the "mix-bundles" repo is used for
mix-specific bundle changes, and the "clr-bundles" repo is treated as
read-only.
So in clr-bundles, the CLRVER_mix branches should always point to the
commit tagged with CLRVER. To make this handling more robust, first
verify that CLRVER exists and is a tag. Then create the CLRVER_mix
branch based on CLRVER, or if the branch already exists, reset it
appropriately.
Since this is the best place to detect invalid CLEAR_VERSION numbers
passed in the builder.conf, I've added that error handling too.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This release makes build-chroots.sh and check_dep() fail on error to properly
quit the build process when an error occurs. The chroot building script
would get passed the chroot install, and then continue to clean up which
would always return success.
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
Because 'set -e' is enabled for init-mix.sh, the exit status of 'type'
is not checked, so an error raised by 'type' would exit immediately, not
running the $? conditional logic.
To fix, disable 'set -e' for the dependency check function.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
The rest of the mixer-tools scripts (excluding the pack makers) already
set this shell option, so add it to the build-chroots script too.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
This release forces a check for the version numbers existence, which are
absolutely needed for the scripts to function properly.
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
This release fixes a path error outputting the Manifest.MoM.sig to the wrong
location when using custom STATE_DIR.
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
This release fixes a serious path error when mixes are not created in the
current mixer workspace as expected by default. The path for the output
(STATE_DIR) needs to be used to make this work anywhere.
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
This release is largely a rewrite of the mixer scripts to reduce complexity
in using them, add a more robust helper library to minimize the code, and
enable certificate generation for Manifest.MoM signing so mixer users can
have signed content.
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
When REPO_DIR is set, the actual binary might not exist at that location
(e.g. swupd-server might not have been compiled).
Add an additional dependency check for the REPO_DIR location.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Since create-update supports a custom location for the swupd-server
binaries, if that option is passed, it should be propogated to the
pack-maker, which also calls swupd_make_pack.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
The files now call functions defined in the helper script to stay more minimal
and be easier to read. One very significant change to note is that all state
variables and information needed for mixing will now be stored and read in
the builder.conf. No longer will there be various hidden state files, with
the exception of the yum-mix.conf which is autogenerated by the template
still. This change simplifies the scripts calling convention and creates
one centralized point to specify the configuration(s) needed.
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
This will do a lot of the ugly work that does not need to be taking up space
in the main scripts, and should be abstracted out so they are easier to read.
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>