A user was running into issues installing the kernel-container bundle on
Clear Linux. Namely, all missing files marked as boot were not
installed.
The root issue is that the bundle-add action does not set the "fix"
global variable before calling ignore(), so ignore() mistakenly returns
true when considering boot files that are missing, but not marked
deleted.
Because 'bundle-add' should be installing new boot files, and 'verify
--fix' should be repairing boot files if they have mismatching hashes,
remove the global "fix" variable entirely, since in all current call
sites, the "fix" behavior is expected.
Also, add another call to ignore() in remove_orphaned_files() to ensure
that any file that should be ignored (including deleted boot files) are
not removed during a 'verify --fix'.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
To support swupd-client testing without connecting to a web server, it's
convenient to use libcurl's FILE protocol, which will query files on the
local filesystem instead.
Because the libcurl-multi download path for fullfiles has treated the
"0" response code as an error, but it has the opposite meaning when
using the FILE protocol, only set the error when connecting to a web
server.
Also, the libcurl-easy code for synchronous downloads didn't treat "0"
specially, so this commit ensures the proper handling, as well as
setting a generic download error for the FILE protocol specific
CURLE_FILE_COULDNT_READ_FILE.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
The verify_fix_path function takes a path and a consolidated MOM as its arguments.
It breaks down the path into subpaths and checks if each subpath is missing.
If found missing, the path is searched for in the consolidated manifest for its hash
and downloaded synchronously. It returns success if all that subpaths are verified
and fixed.
The following command was run with clang 3.7.1:
$ clang-format -i -style=file include/*.h src/*.c test/*.c
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
New swupd primary command, offers the ability to
search for the provider of a specified binary or library.
A full complement of bundle manifests for the os-release version
is downloaded to the client prior to conducting any search. This
patch has been designed to enable this download, or staging, to
take place prior and separate from use of the search function.
However, with each search, the manifest complement is checked to
ensure completion.
Overhead:
A check against the Clear Linux 6300 manifest set
shows a search will entail a ONE TIME 83 MB network download
(the compressed manifest set), and a constant decompressed 400MB
usage on disk. Future searches will only require new or modified
manifests be downloaded.
Finally, download size is provided to notify user of expected delay
-----
Ex:
"Downloading manifests. Downloading 83.23 MB..."
Signed-off-by: Brad T. Peters <brad.t.peters@intel.com>