Commit Graph
7 Commits
Author SHA1 Message Date
Castulo Martinez c796cd310c Also remove deps when bundle-remove --recursive
If the -R / --recursive flag is used, remove the specified bundles along
with their "deletable" dependencies.

In this context deletable means:
- the dependency is not os-core
- the dependency is not required by other installed bundle that is not
to be removed
- the dependency is not tracked (specifically installed by the user)

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-10-30 13:38:41 -06:00
Otavio Pontes bb1559ef6e compliant: Add check for trailing whitespaces on tests
Note that the clang-format already does this for the source code

Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
2019-10-04 16:05:21 -07:00
Castulo Martinez e419e7fa9d Refactor bundle-remove to include improvements
This commit does a major refactor of the bundle-remove command to
include these improvements:

- Adds a "--force" flag that can be used to remove a bundle that is
required by other installed bundles along with all the bundles that
depend on it
- When attempting to remove a bundle which is required by other
installed bundles, swupd used to show the list of dependencies in a tree
view, this list was very large in some cases. This commit changes the
output of such cases from a tree view to a simple deduplicated list of
bundles that require the bundle to be removed. The user can still see
the old tree view by including the --verbose when running the command
- Stops notifying telemetry of user errors, like user trying to remove
an invalid bundle, or a bundle that was not installed, etc
- Consider all bundles provided in the bundle-remove command when
checking for dependencies (required by)
- Instead of removing each bundle in the command one by one, consolidate
all bundles to be removed, validate them and remove them all at once.
This will optimize the tasks to be executed for removing bundles.

One change included in this commit for bundle-remove is propagated to
bundle-list:

- When using "bundle-list -D BUNDLE" to find what bundles depend on
BUNDLE. The list will be presented in a simplified deduplicated list of
dependencies by default instead of the tree view that used to be
default. The user can still see the old tree view by running the command
appending the --verbose flag

Closes #891
Closes #732
Closes #674

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-09-30 14:40:01 -07:00
William Douglas 6da50ee5d7 Fix manually installed bundle tracking and add tests
Update bundle tracking to correctly initialize tracked bundle state
and add testing to validate tracking works as expected.
2019-02-13 12:23:28 -08:00
Castulo Martinez f71b84f22d Renaming existing exit codes for consistency
Renaming codes following these rules:
- All codes should start with SWUPD_ so we never get confused what
code comes from swupd
- Always separate codes that contain multiple words using an underscore
SWUPD_MULTI_WORD_ERROR instead of using SWUPDMULTIWORDERROR
- Code 0 is reserved for SWUPD_SUCCESS (or SWUPD_OK)
- Code 1 is reserved to be used as "no" by commands that return a boolean
state (e.g. swupd autoupdate, check-update)

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2019-01-24 15:23:15 -08:00
Castulo Martinez 71d48a5033 Reporting of deleted files in bundle-remove
When running bundle-remove to remove a bundle the number in "Total
deleted files" is often wrong. This is happening because when deleting
the files from a bundle sometimes we start by deleting a directory
(with all the files within it), so all the files that got deleted are not
accounted for, only one file will be counted as deleted (the directory),
this will yield to an incorrect count of deleted files.

This commit fixes this issue by printing the total number of
files that should be deleted, minus those that failed to be deleted,
instead of counting those that succeeded.

Closes #690

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2018-12-06 14:50:32 -08:00
Castulo Martinez 26a748394f Adding IDs to bundle-remove tests
This commit adds the test ID to every bundle-remove test, removes
duplicates and make readability improvements.

Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
2018-11-14 13:09:42 -08:00