When diagnosing/repairing a system, sometimes is useful to only
diagnose/repair a specific file or path.
This commit implements the --file option for diagnose/repair so a file
or path can be diagnosed only instead of doing it to the whole OS or a
whole bundle.
Closes#1150
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit updates the swupd man pages to have a better looking
formatting, it fixes some omissions in the documentation and also
rewords a few sentences to make the information more digestable.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The "bundle-list" command can be used to show all installed bundles in
the system, however, currently there is no way to know which of those
installed bundles were implicitly or explicitly installed.
This commit implements the "--status" flag for bundle-list which can be
used to show which bundles were explicitly or implicitly installed.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit improves the diagnose/repair --picky documentation in an
attempt to make it clearer for the user.
Closes#1205
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The search-file command is restricted to looking for files in the
current version. This commit adds the --version option to the command
that can be used to seach for files in specific versions of Clear.
Closes#1155
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
After a grace time period, superseded or deprecated commands should be
removed from the help menu so people is not encouraged to use them. They
should continue to work though for backward compatibility.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit adds the --repo flag for the 3rd-party bundle-list command
which can be used to specify the repository from which the bundles are
going to be listed.
When user uses the --force or --recursive flag swupd prints a message
explaining what effects it will have on the system. This commit changes
this message from informational to warning to attract more attention.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
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>
This commit adds the --recursive flag to bundle-remove but doesn't
implement its functionality, only makes the flag available in the
command line and into the command's documentation.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The bundle-info command shows detailed data related to a specified
bundle. Among the data currently displayed it includes:
- If the bundle is installed or not
- If the bundle is experimental or not
- If the bundle is installed, it shows if there is an existing update
for the bundle
- The latest available version of the bundle
- The size of the bundle and all its dependencies
- The max size needed in disk to install a bundle if not installed
This commit also adds the following command flags:
--version: so a user can display information for a bundle in a
specific version, not only the current version.
--dependencies: this flag can be used to show all optional and required
bundles that are directly and indirectly included by the specified
bundle.
--files: this flag can be used to show all files that are part of a
given bundle.
All flags can be combined to show specific data.
This is the first of a series of PRs to implement the bundle-info
features referred to at #461.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
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#891Closes#732Closes#674
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Now that --bundles has been made safe to use, it can be re-enabled with
repair to only repair problems with the selected bundles.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Now that the -B/--bundles option has been made safe to be used with
diagnose it can be re-enabled.
This commit enables the --bundles option when using diagnose, so users
can now only verify that the comma separated list of bundles are
correctly installed. The --bundles option cannot be used along with the
--picky option or the --external-files-only, these two options remove
all files in the picky-tree path that are not listed in any of the
manifests from installed bundles, when using --bundles the manifests
considered are only those from the bundles in the list, so the user
would end up deleting many files which is probably not what they want.
So these options are not allowed.
Users will still be able to use --bundles with --picky or --bundles with
--extra-files-only with the "verify" command (for backward
compatibility). The verify command has been superseded and will be
removed from the documentation eventually, so only users that know about
this command and are already using it for something would continue to
use --bundles with --picky or --extra-files-only.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Now, we have global option
and info_verbose logging level.
For this PR, we have verbose for info,
check-update which shows format versions.
This also helps future implementations leverage
the use of a verbose option for their own need.
commands:
swupd check-update --verbose
swupd info --verbose
Fixes#1066
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@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>
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>
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>
The -B/--bundle option is confusing and causing users to wipe out their
systems. This option was really just meant for os-install, so this
commit removes it from "swupd diagnose"
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The -B/--bundle option is confusing and causing users to wipe out their
systems. This option was really just meant for os-install, so this
commit removes it from "swupd repair".
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Since --picky was made a superset of diagnose/repair, there is the need
of a new flag that only finds/repairs the extra files that are not in
any manifest.
Many things were included in this commit:
- This commit adds the new flag --extra-files-only for this purpose.
- The commit also refactors the verify function to simplify its workflow
and remove code duplication
- It also adds some validations for flags that are mutually exclusive in
verify/diagnose/repair
- Updates the documentation
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Running "swupd diagnose --picky" result in only identifying the extra
files in the system, but doesn't run the other standard checks that a
"swupd diagnose" do. "swupd diagnose --picky" should do everything
"swupd diagnose" does plus searching for the extra files.
This commit fixes the issue by making diagnose --picky a superset of
diagnose. The commit also makes some changes in the output of --picky so
it is consistent with the rest of the diagnose output.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When running tasks that require to run post update scripts in swupd,
for most users we don't want to wait for the scripts to finish running,
those can be run in the background so we can finish the task faster.
However for some users like DevOps, clr-installer, and QA, it is useful
to have a way to instruct swupd to wait until these scripts have finish
running.
This commit adds a way of doing this by introducing the
--wait-for-scripts flag.
Closes#909
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Some swupd flags from subcommands clash with some global flags.
This commit fixes the issue by renaming the duplicated flags in the
subcommands.
Closes#946Closes#950
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit renames the "verify" command to "diagnose" to make it
more straightforward for the user to understand the purpose of the
command.
Closes#918
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The purpose of "swupd verify --fix" is to repair local issues relative
to a server manifest. However the verify command currently has many
flags, and some flags are mutually exclusive, this makes the command
very confusing to use for users.
This commit makes "swupd verify --fix" the top level command
"swupd repair". This new command still uses the verify code under the
covers.
Closes#914
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The purpose of swupd verify --install is so it can be used to install
a new Clear OS in a target system. However since currently it is part
of the swupd verify command it makes it confusing as of to what its
purpose is.
This commit moves the swupd verify --install option to be a top level
command (swupd os-install) so its purpose is more straightforward. The
new command still uses the verify code to perform the task underneath.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Documentation coverage on src/lib is now 100% and the goal is to eventually
reach that for everything on src/.
Also improve some documention on headers.
--scope=b output is the same as -T 1. And if we have a real use case for
--scope=o we can create another parameter just for it.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>