457 Commits
Author SHA1 Message Date
Tudor Marcu 7e5442b293 Release v4.5.2
This release introduces a new mixer “config set” command to set properties
in the builder.conf, fixes for delta creation, mixin to read correct
upstream versions, and documentation for adding custom content from a build
root without building RPMs.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v4.5.2
2018-05-18 19:07:36 +00:00
Matthew Johnson a68aaef443 Add tutorial for adding custom content from build root
Some users are asking for instructions on how to build custom bundles
without having to go through the pain of packaging their content in an
RPM. Provide a tutorial explaining how this can be achieved.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-18 10:57:20 -07:00
Matthew Johnson c1199bb52c mixin: read current version from upstreamversion
If the upstreamversion file exists read the current version from there.
Only read from /usr/lib/os-release if the upstreamversion file does not
exist. The os-release file is modified every time a local mix is
migrated to (version * 1000) so reading from that file every time causes
the mix version to multiply by 1000 every mix build.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-18 10:41:11 -07:00
Rodrigo Chiossi 456073ffd0 battest: Use config name instead of code name
The name used in battests for config set were using the name used in the
code for the properties instead of the name found in the config file
causing the test to fail.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-05-18 10:39:20 -07:00
Kevin C. Wells 2cd5811ba9 Report config name for missing config values.
Previously, when a "required" config value was missing, the config
object's variable name was reported, rather than the name actually used
in the builder.conf file itself.

This resulted in the following output, for example:
ERROR: Missing required field in config file: ServerStateDir
rather than
ERROR: Missing required field in config file: SERVER_STATE_DIR

This patch falls back to the variable name if a config field does not
have a "toml" name defined.

Signed-off-by: Kevin C. Wells <kevin.c.wells@intel.com>
2018-05-17 13:43:23 -07:00
Rodrigo Chiossi d260dc1528 cmd: remove unnecessary return
fail() ends with a call to os.Exit(1) so there is no need to return
after it.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-05-17 13:19:45 -07:00
Rodrigo Chiossi fbf806ab4f battest: Fix property setting for new config
LOCAL_BUNDLE_DIR and LOCAL_REPO_DIR must be added using TOML format.
This patch changes bat tests to try to use new-config for setting the
properties. If it fails, it will fall back to appending INI properties
to the end of the file.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-05-17 13:19:45 -07:00
Rodrigo Chiossi 9b35bdd872 bat-test: Allow global arg via env var
Allow global arguments to be passed to mixer during `make batcheck`
through the $MIXARGS environment variable.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-05-17 13:19:45 -07:00
Rodrigo Chiossi 1bf8d23c72 config: add mixer config set command
This patch introduces `mixer config set` command which allows any
arbitrary property withing the configuration file to be set via command
line.

The command receives the properties in the format `Section.Property`.
Only existing sections and corresponding properties can be set and this
input is validated by the command. On the other hand, the value provided
can be arbitrary and will not be validated by this command.

Signed-off-by: Rodrigo Chiossi <rodrigo.chiossi@intel.com>
2018-05-17 13:19:45 -07:00
Matthew Johnson 44f45c37d9 Add test for FULLDL delta creation
Test that we successfully remove the FULLDL no-op delta.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-16 11:43:53 -07:00
Matthew Johnson 57dc9643cc Fix FULLDL detection for delta creation
Call the ExitStatus method to get the actual exit code of the bsdiff
command to check for the FULLDL return code.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-16 11:43:53 -07:00
Matthew Johnson 7ad184417e Add a test for a delta file larger than the full file
Add a unit test to make sure we do not create delta files larger than
the compressed full file.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-15 13:27:43 -07:00
Matthew Johnson 236408c933 delta: add size check against full compressed file
Do not keep a delta if its size is larger than or equal to the size of
the compressed full file since download size is not being optimized in
this case.

This is not a critical error so do not remove the delta if the
supporting information can not be determined. For example, this check
fails if full files were not created before creating deltas because
there is no compressed full file to check. This is the case with many of
our unit tests.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-15 13:27:43 -07:00
Matthew Johnson 2185b76046 bat: Perform integer comparison checks in test
One of the checks started failing, not sure why it was passing before
but not any more. Update all checks against $line to use integer
comparison instead of string comparison.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-15 12:05:04 -07:00
Tudor Marcu 0ce7f7bc8d Release v4.5.1
This release fixes a bug in the Makefile not creating the man pages
directory.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v4.5.1
2018-05-15 00:43:33 +00:00
Tudor Marcu 8fe042117c Create man page directory if it doesn't exist
Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2018-05-14 17:40:45 -07:00
Tudor Marcu e2a059f2e5 Release v4.5.0
This release introduces a new binary 'mixin' which allows users
running official upstream images to create custom content that swupd
can consume, without generating a full mix. This is a port of the
swupd-add-pkg script that lived in the swupd-client project.

Manual pages for both mixer and mixin have been added.

Bug fixes include:
- Updating RPM url in BAT tests that became stale
- Compresing the Manifest.Full
- Cleaning up manifest creation code
- Removing unused pack scripts (pack creation done by mixer now)

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
v4.5.0
2018-05-14 23:35:21 +00:00
Matthew Johnson 7f9669740a Add man page for mixin
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-14 16:25:13 -07:00
Matthew Johnson 6b36411ae2 swupd: clean up manifest creation
This patch moves the complicated processing loops out of top-level
functions to make them more readable and thus reduce gocyclo complaints
for this operation.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-14 16:05:21 -07:00
Matthew Johnson dec40c3940 mixin: write flag file for good builds
Write a flag file to MIXWS/.valid-mix when a mixer build is successful
so swupd-client will know when the user's mix is in a good state to run
an update from.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-14 16:03:04 -07:00
Matthew Johnson 5494272d5d Compress Manifest.full as well
The client needs to download the Manifest.full for mixer-integration to
work and expects a tar to exist.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-14 16:00:58 -07:00
Matthew Johnson d1e3e324b8 Update RPM url for BAT tests
The old one disappeared, so add one that actually exists... for now.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-14 11:07:12 -07:00
Matthew Johnson 8e93fa21e6 Add mixer manual pages
Add manual pages for the top-level mixer command and all subcommands.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-14 11:06:49 -07:00
Matthew Johnson d7b2b92396 Remove unused pack scripts
The pack-maker.sh and superpack-maker.sh scripts are no longer used or
supported by mixer. Remove these scripts from the mixer repository.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-11 16:10:40 -07:00
Matthew Johnson da7fa3ed34 mixin: use RunCommandSilent where appropriate
Instead of throwing away the output just explicitly use RunCommandSilent
where the output is unused.
2018-05-11 16:08:00 -07:00
Matthew Johnson b77dfb21b1 mixin: implicitly add package to repo bundle
Instead of requiring the user to add a bundle name when invoking mixin
package add implicitly add the package to a bundle named after the
repository it is found in. This also effectively adds a check that the
package the user is trying to add actually exists.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-11 16:08:00 -07:00
Matthew Johnson cdf0ec4c69 mixin: init builder.conf for repo commands
Allow the user to manipulate their DNF configuration by initializing the
builder.conf if it does not exist.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-11 16:08:00 -07:00
Matthew Johnson d5ef866e88 mixin: restructure package into logical structure
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-11 16:08:00 -07:00
Matthew Johnson d38c3618b8 mixin: add build command
The build command builds the mixer content under /usr/share/mix for use
by swupd update --migrate.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-11 16:08:00 -07:00
Matthew Johnson 45635e21ab mixin: Add package add command
Add the package add command to allow users to add packages to their mix.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-11 16:08:00 -07:00
Matthew Johnson 944d3ac79e Re-write swupd-add-pkg into mixer
This commit rewrites swupd-add-pkg into a Go binary provided by mixer.
It uses mixer libraries to make manifest merges and manipulation easier
and is a first step in enabling external repos for mixer-integration
client-side.

Some minor changes to the swupd library were necessary to make the 'm'
flag a supported flag for integration manifests.

The usage of the new binary is slightly different from the old script.

mixin <bundle-name> <path/to/rpm>

Instead of requiring the user to copy the rpm to /usr/share/mix/rpms it
does the work for the user.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-11 16:08:00 -07:00
Matthew Johnson a99aa00cd8 Release v4.4.0
This release adds 'mixer repo' commands to allow users to add, remove,
modify, and init RPM repositories for mixer use during the build bundles
stage. This is an important prerequisite for enabling additive repos on
the client side.

Rename flags are removed from manifests and rename detection is now done
between any arbitrary version pairs during the delta-pack creation
stage. This allows us to maximize delta creations for delta-packs to
make updates faster for clients.

When reading the local bundle directory files with leading '.'s are
ignored, allowing users to track this as a git repository (with .git
directory).

A bug causing files to be skipped during fullfile creation due to a
shared error variable was fixed by declaring local-scope error variables
for all fullfile workers.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
v4.4.0
2018-05-04 12:36:01 -07:00
Matthew Johnson 1db786490f Declare local error for fullfile creation
Instead of using the same error variable across all workers declare a
new error variable for each goroutine. This prevents race conditions
where multiple routines are using the same error variable to make
decisions and failures are missed.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-04 12:33:58 -07:00
Matthew Johnson 04de2c49b5 Make repo subcommand help text consistent
Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-03 15:07:54 -07:00
Matthew Johnson b67ab4e608 Add mixer repo set-url capability
'mixer repo set-url' allows the user to set the url of a RPM repo to the
url they provide. This is helpful when users want to build mixes off a
mirror of upstream Clear Linux instead of the CDN when the CDN is slow.

mixer repo set-url clear <mirror-url>

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-03 15:07:54 -07:00
Icarus Sparry d5114b6010 Ignore filenames starting with '.'
Previously the code was using ioutils.ReadDir which does a stat call
on every file, but none of the code required the results of the stat
calls, just the names.

In addition programs such as git would like to hold information in the
directories. The usual unix way to do this is to have filenames
beginning with '.', and these are ignored by default by things such as
shell globbing and the ls program.

fixes #269

Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
2018-05-02 16:51:12 -07:00
Matthew Johnson cb912c9248 Add mixer repo init command
The 'mixer repo init' command writes the default DNF configuration file
used by mixer if it does not already exist. The configuration file is
written with the default "Clear" repository and potentially the "local"
repository depending on user setup.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-02 16:27:48 -07:00
Matthew Johnson 4debf1e996 Add mixer repo list command
The 'mixer repo list' command lists all available repos in the DNF
configuration file used by mixer.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-02 16:27:48 -07:00
Matthew Johnson 6215eff039 Add repo remove capability
Allow the user to invoke 'mixer repo remove <name>' to remove a
configured RPM repository.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-02 16:27:48 -07:00
Matthew Johnson dd74bbb60c Do not insensitively load the DNFConf
Do direct string matching instead of insensitive string matching. The
insensitive load will break when someone tries to add something with
capital letters twice. For example, the following will be allowed when
it should not be:

mixer repo add QtPy url
mixer repo add QtPy url

Do a regular load so the string comparison with upper-case names will
work.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-02 16:27:48 -07:00
Matthew Johnson ad5d111ec8 Move add-repo command to repo subcommand
This will help support adding additional commands such as 'repo remove'
and 'repo list'.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-02 16:27:48 -07:00
Matthew Johnson 738c1bfb94 Add test for non-consecutive deltas using renames
This test adds a test for the following case:
* 10 contains files A B C
* 20 contains files A1 B C1
* 30 contains files A B1 C2
* 10->20 pack has deltas for A->A1, C->C1
* 20->30 pack has deltas for A1->A, B->B1, C1->C2
* 10->30 pack has deltas for B->B1, C->C2

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-02 13:19:54 -07:00
Matthew Johnson 7b6e77d3d7 Detect renames for pack creation, not manifest creation
Instead of performing rename detection for manifest creation between the
current and previous version, perform rename detection for every delta
pack that is created, thus maximizing the number of deltas created for
each pack.

This removes the now-unused rename flag from the manifest. Now that
swupd-client optimistically applies all deltas in a pack it no longer
relies on a rename flag to tell it if a delta is available.

All deleted files now have a zeroed hash, some tests had to be updated
to reflect and check this.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-02 13:19:54 -07:00
Matthew Johnson 4f2e44039f Add add-repo feature to mixer
The add-repo subcommand adds a remote repo configuration to the DNF conf
defined in the builder.conf. This allows users to configure mixer to use
remote RPM repositories when building mixes instead of being limited to
just local RPMs and upstream Clear Linux RPMs.

This feature is an important pre-requisite for enabling PPA-style repos
on the client side.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
2018-05-02 10:34:08 -07:00
Matthew Johnson c13b0dbf50 Release v4.3.3
This release fixes a panic when trying to build bundles with invalid
input.

Signed-off-by: Matthew Johnson <matthew.johnson@intel.com>
v4.3.3
2018-04-20 09:12:21 -07:00
Caio Marcelo de Oliveira Filho d82328cf86 builder: fix panic when trying to build bundles with invalid input
Sometimes dnf output will not contain the "Installing:\n" pattern,
e.g. if there is a package that doesn't exist in a bundle, the output
looks like

    Last metadata expiration check: 0:00:06 ago on Thu 19 Apr 2018 05:09:16 PM PDT.
    No match for argument: libc

and mixer would crash because the Split resulting slice wouldn't have
a second element.

The actual error will be caught later when the install of the "full
chroot" happens, so it is fine for now just ignore it.

Ideally the goroutine handling should be similar to fullfiles, so the
workers have a way to indicate that an error occurred and the program
can finish early. Added that as a TODO.
2018-04-20 09:10:50 -07:00
Kevin C. Wells be9b522757 Release v4.3.2
This release fixes an additional parsing bug in 'mixer build bundles'.

Signed-off-by: Kevin C. Wells <kevin.c.wells@intel.com>
v4.3.2
2018-04-16 22:58:12 +00:00
Kevin C. Wells 8f7bd164da Fix parsing bug in 'mixer build bundles'
The recent change in 'mixer build bundles' contained a parsing bug that
caused some packages to be dropped. The way 'dnf install' output was
split caused the regex to miss the final line on some bundles. This
patch fixes this bug.

Signed-off-by: Kevin C. Wells <kevin.c.wells@intel.com>
2018-04-16 15:56:36 -07:00
Kevin C. Wells 25280106b9 Release v4.3.1
This release contains a bug fix for name collisions between upstream
and local packages. Now the repository priority in the DNF conf is
correctly respected during the 'mixer build bunldles' command.

This release also includes improvements to Mixer's Travis CI.

Signed-off-by: Kevin C. Wells <kevin.c.wells@intel.com>
v4.3.1
2018-04-16 17:18:34 +00:00
Kevin C. Wells 7bc09e5221 Fix local package name collision bug
Previously, mixer failed to build update content if local and upstream
repositories had a package name collision with different content.

'mixer build bundles' relies on the output of 'dnf repoquery -l' to get
the contents of a given package and 'dnf install' to put the contents
of that package into the full chroot. 'dnf repoquery' does not utilize
the repository prioritization resolver that 'dnf install' does, and
instead lists the contents of every matching package in every repository.
This results in the <bundle>-info file containing the file lists of both
the upstream and the local version of the rpm, but the full chroot only
containing the actual files from the (higher-priority) local rpm. 'mixer
build bundles' then fails as it attempts to resolve missing files.

This patch fixes this by separating the packages in each bundle based on
the repository they come from according to the 'dnf install' resolution.
For each bundle, a separate 'dnf repoquery -l --repo' command is made
for each repository, guaranteeing that only the correct repopository is
queried for a given package.

Signed-off-by: Kevin C. Wells <kevin.c.wells@intel.com>
2018-04-16 10:09:47 -07:00