Bash autocomplete scripts should be POSIX compliant, so fixing that and
adding a test to validate this.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
When swupd downloads manifests to the statedir they are downloaded in
directories that represent the version of clear that the manifests
belong to. However those version directories are stored in the statedir,
root directory. This commit moves them into their own "manifest"
directory so there is more consistency with the downloaded files.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Print a more useful error when we fail to locate a file to apply a
delta. Add a suggestion for the user to run `swupd repair` and make
it clear that the problem is in their system and not in the update
content.
Fixes#1425
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
When swupd downloads manifests to the statedir they are downloaded in
directories that represent the version of clear that the manifests
belong to. However those version directories are stored in the statedir,
root directory. This commit moves them into their own "manifest"
directory so there is more consistency with the downloaded files.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Create another github job to check if the API has been changed in this
PR, so it will be easier to notice that a broken test is just an API
broken test
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Don't run heuristics for os-install or repair --quick.
On os-install we want all files to be always installed. On repair --quick
we don't process any do_not_update files
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Implementing the --orphans option to remove bundles no longer required
by tracked bundles from 3rd-party repositories.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit implements the --orphan flag for bundle-remove which can be
used to remove bundles that are no longer required by tracked bundles.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
src/
src/3rd-party/ # Everything that is 3rd-party related
src/cmds/ # All sub-commands from swupd (except 3rd-party ones)
src/lib/ # Modules that implement functions not dependent on swupd
behavior (i.e. system interations, logging)
src/swupd_lib/ # Modules that implement functions dependent on swupd
behavior (i.e. hash calculation, signature verification,
manifest/bundle handlers)
Porting code to better way on interacting with system commands using the
run_command function. As run_command don't support multi-thread for
performance reasons, we are now using a file instead of a pipe. As tar|tar
is now a fallback, this won't have any performance impacts on any case
where with no problems and errors.
Fixes#640 and #671
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
We have added more dependencies in verifytime, but this was harder to
keep as it looks like, so making it completely independent from swupd
libs.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Adding the --orphans flag to bundle-list which shows those bundles that
are installed ut no longer required by any tracked bundle.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Instead of relying on all tests of the same group to exist in the same
directory, testlib should assume those tests could be scattered across
multiple directories.
Closes#1485
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Use global_setup in all bundle-list tests so we can only generate the
test environment once and use it for multiple tests. The one exception
is if we need to modify the env for a specific test.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
We don't need to handle directory missing or invalid differently, because
the staging function removes it if necessary, so making the if simple.
Fix#1509
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Ignoring error SC2119 because they are false positives and I don't see cases
where that would return anything useful for us.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
On several points on swupd we need to free a pointer and then set it to
NULL. This is made in some areas using the free_and_clear_pointer(). But
most places free_and_clear_pointer() is used, this is not really necessary.
On the other hand it's hard to make sure that we are really setting to NULL
every pointer that we need, so we're adding a more conservative approach on
setting every pointer to NULL after free using a wrapper.
The greatest advantage of this wrapper over free_and_clear_pointer() is that
it's not type dependent and we don't need to call it with a pointer of a pointer,
so calls look more to calls to a standard free.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
The show_target function shows a warning that is not applicable so this
commit ignores that warning wherever show_target is used.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
We are aiming to provide a stable --quiet output, so forcing "make
compliant" to fail if there are changes in the test/functional/api
tests, which cover these scenarios will prevent us from unadvertedly
changing those tests.
Closes#1501
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When using --quiet, there was no way of knowing if a file had been
successfully repaired or not. This commit fixes that.
Closes#1504
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The tests in test/functional/api are going to validate the --quiet
output is rarely changed, therefore only expected output should be
validated and not warnings or error messages.
Closes#1502
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Headers are printed at the beginning of the output for every repository
in operations that run in multipl repos. This header was using the word
"repo" but we are trying to use the whole "repository" word every time
we printed it to the user. This commit changes that.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When running a diagnose/repair, swupd creates a list of the files to be
verified, this list contains normally all the files from the manifests
from bundles installed in the system. When the --file flag is used, this
list contains only the file specified in the flag or the directory and
files included in that directory if a directory is specified. If nothing
trakced was found using the given path, then swupd was considering
nothing else needed to be done and was exiting. This commit changes this
behavior so if there are no tracked files, we still look for extra,
untracked files before exiting.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
For some tests is useful to have a minimal version of the os-core-update
bundle since some system files are tracked there.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When running a diagnose/repair using the --file flag, swupd was
considering partial matches, for example "--file /ba" would match
"/bar", "/baz", "/bat", etc. This commit changes it so it only matches
full matches. Foe example: "/bar" will only match "/bar",
"/bar/file", but won't match "/barbar".
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit adds a flag that can be used to update content from
3rd-party repositories after updating the regular content if
successfull.
Closes#1473
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Multi-repo operations can run in one or multiple repos, so that needs to
be taken in consideration when opening and closing progress steps.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit adds the following files to trigger the execution of
clr-boot-manager:
- /usr/bin/clr-boot-manager
- /usr/share/syslinux/ldlinux.c32
Closes#1415
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:
- swupd mirror
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>