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>
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>
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>
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>
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>
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:
- swupd 3rd-party add
- swupd 3rd-party remove
- swupd 3rd-party list
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Make sure files with unsual characters are successfully installed. Most
characters used in test are filtered by mixer, but there's no reason to
not support them in swupd
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
This commit provides a minimal output to be displayed when the --quiet
flag is used for these commands:
- swupd hashdump
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 clean
- swupd 3rd-party clean
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 os-install
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 repair
- swupd 3rd-party repair
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When creating the fullfile and installing the bundle in targetfs we
need to preserve the owner and mode of file
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
XDG_CONFIG_DIRS variable was added with an incorrect name. XDG_CONF_DIRS was used instead.
Fixing that.
Fix#1443
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
When dealing with extra files during a "verify" action, we cannot really
tell how far in the process we are, so we should be defining that step
as PROGRESS_UNDEFINED. Since we are using a PROGRESS_BAR, it is causing
to show an extra "[100%]" at the end of the diagnose process.
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 diagnose
- swupd 3rd-party diagnose
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 search-file
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 bundle-info
- swupd 3rd-party bundle-info
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 bundle-list
- swupd 3rd-party bundle-list
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When a MoM contains an experimental bundle and the hashes in the MoM are
regenerated, the experimental bundles are being skipped. This commit
fixes that issue.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When listing bundles using "swupd bundle-list --status" we were
distinguishing bundles that were explicitly installed, by marking them
as such and since bundle-list shows only bundles tha are installed, bundles
that were not marked as explicitelly installed were assumed to be
just installed.
When we use "bundle-list --all --status" (which shows installed and
uninstalled bundles), we were marking files as "installed", "explicitly
installed" and bundles without any of these distinctions were assumed to
be not installed. This could cause confusion.
This PR changes the "bundle-list --status" so we always label bundles
as either "implicitly installed" or "installed" (even though it couls
sound a little redundant) so it is consistent with the way they are
labeled during "bundle-list --all --status".
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When creating test bundles, we are not including os-core in them by
default. This is how it works in production so we should do it so it
resembles the real production environment more accurately.
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 bundle-add
- swupd 3rd-party bundle-add
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>