This release adds enhancements, bug fixes and test improvements .
Bug fixes:
- Case insensitive when checking for insecure urls
- Better overload of multiple configuration files
- Improvements in documentation and help messages
- Fixing corner cases where swupd mirror was setting invalid values
- Fixed some memory leaks and invalid memory access
- Fix problem on restarting swupd after a format bump
- Fix infinite loop that could be triggered by an unstable network
- Use same retry strategy in both sync and async downloads
Feature:
- Make it possible to run swupd post-update scripts synchronously
- Including zsh autocomplete script
- Print distribution variant on swupd info command
- Make usages of diagnose and repair consistent by always checking for both files missing and files included when using --picky
- Introduce a new flag for diagnose and repair, --extra-files-only, to checking only extra files in the system.
- Make it possible to run swupd offline when all needed files are in the state dir
- Create a --download flag in os-install operation, to cache files for offline operations
- Create a flag to always download search-file indexes on update (--update-search-file-index)
- Print the latest available version on swupd check-update in the case of a format-bump
- Support to have an external cache to fill the statedir on installations. The external cache is needed because it may be read only or in a different partition
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
When a statedir manifest is corrupt, the statedir-cache must also be
cleaned so that the manifest can be downloaded over the network on the
second attempt.
Signed-off-by: John Akre <john.w.akre@intel.com>
The contents of the statedir-cache can be copied to the statedir, so it
must follow the same permission requirements.
Signed-off-by: John Akre <john.w.akre@intel.com>
The --statedir-cache flag specifies a secondary statedir that will be
checked before downloading files over the network.
The primary reason to use the statedir-cache is to enable the os-install
command to take advantage of hardlinks when installing content across
partitions. In this case, update content stored in the statedir-cache
(source partition) will be copied to the statedir (target partition) before
installing content into the target partition. Since the update content
will exist on the target partition before installation, hardlinks can be
used instead of copies.
Signed-off-by: John Akre <john.w.akre@intel.com>
Instead of initializing curl library on start, initialize it only when needed.
The advantage of this approach is that we can run some commands offline, if
there's no file to download.
Fixes#801Fixes#895Fixes#277
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Instead of checking if the url is valid and approved in curl we can check
that in globals. This is important because we should fail even if we aren't
going to download any file and curl may not be initialized
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Don't let users to set the capath to use to test the connection.
This property should be only used by curl module.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
We're seeing a problem in current curl when using the flag
CURLOPT_PIPEWAIT and trying to download a file from an unexistent or
unreachable server.
Easiest way to reproduce that on swupd is to disable your while you are
in the download phase of any swupd command. Without this patch swupd will
hangs and wont timeout.
The downside of removing this flag is that curl will prefer to open more connections
instead of waiting to check if it can multiplex. So it's a good thing to have
this enabled back in the future
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
On updates swupd binary can be replaced so readlink will fail to get the
swudp binary path. In this case we should run that before running any update
process.
And besides that hardcode /usr/bin/swupd as the default swupd path in the case
there's something wrong with readlink
Fixes#1067Fixes#1068
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
When running the check-update command we get the latest version for the
format we are currently in, but we really want to get the latest version
regardless of the format.
This commit fixes the issue.
Closes#482
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Estimating the total download size is almost as slow as downloading the
manifests. So just don't do it.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
If --update-search-file-index flag is used on update, all search-file indexes, i.e.
all Manifests will be downloaded on update. This shouldn't be used if you have
disk or network restrictions, but it shouldn't be very download intensive after the
first usage because delta manifests are going to be used.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Previously, when adding included manifests errors were thrown away which
resulted in swupd operations that could succeed, even when failing to
load an included manifest. Now when an included manifest fails to load,
swupd will return a failure.
Signed-off-by: John Akre <john.w.akre@intel.com>
More than one config file can be read, if the same option is found in
more than one config, it will be overwritten.
This commit reverse the order of the defaul paths for the config file so
they are read in the appropriate order of precedence.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit enables the ability to provide many paths for the
configuration file and read configuration from all of them if more than
one config file is found. If the same option is defined in more than one
configuration file it will just be overwritten by the one last read.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Adding the skip_diskspace_check option to the bundle-add section of the
default config file.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Diagnose picky behavior has changed so now we can use just one call
to swupd to verify if there's no extra file and no corruption.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
This is very handy for testing because we can just run:
$ swupd os-install --path testing/
And the testing/ directory will be automatically created. It's the same
behavior we have for the state dir.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
When the --download flag is set for the os-install command, update
content will be downloaded to the statedir and no content will be
installed.
Signed-off-by: John Akre <john.w.akre@intel.com>
When using testlib to create tests, ignore lists can be used which
include lines of output that should be ignored when running tests.
The ignore lists can exist at three different levels:
- an ignore file that applies to all tests
- an ignore file that applies to all files of one theme
- an ignore file that applies to all tests within the same file
There was a bug in this last one that was causing ignore-list files to
be unrecognized unless the test number was also used as part of the
ignore-list name. This was causing issues because the test number
can change depending on how you run the test.
This commit fixes the issue.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
check_connection() returns an int. We shouldn't use ! before comparing it to zero.
If check_connection() return is zero it's a success.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>