The "verify" command was superceded many months ago. The command
still works and will continue to work for backward compatibility, but
users are discouraged to use it. To motivate users to use the newer
commands, all references to the legacy command has now been removed
from the swupd man page and the help menus.
This commit removes the command from the bash autocompletion script too.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
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>
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>
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>
This commit implements the swupd clean command for the 3rd-party bundles
so users are able to clean the cache on their state directories.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit does some housekeeping in the 3rd-party commands:
- Initialize the function "progress" only after swupd has initialized
successfully.
- Make functions that are not used outside of a file static.
- Avoid using regex or partial verifications on tests when possible.
- Add 3rd-party command flags to the default config file.
- Don't use "repo" in help menus, use the whole "repository" word.
- Add 3rd-party sub-commands to the flag_validator script.
- Add missing values from the autocompletion scripts.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit adds the ability to update the system based on the 3rd-party
repositories the user have.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit adds a new "3rd-party bundle-info" command which can be used
to show information about a bundle from a 3rd-party repository. If no
3rd-party repository is specified, the bundle is searched for in all
available repositories.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit adds the ability to remove 3rd-party bundles. If a repo is
not specified the bundle will be searched for in all repositories. All
options from the normal bundle-remove command are supported with
3rd-party bundles.
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.
This commit introduces a new command to list bundles from all 3rd-party
repositories. At this point users cannot choose a specific repo to show
its bundles but rather all repos are shown.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When a user is adding bundles from a 3rd-party repository, if the user
doesn't specify the repository, swupd will search for the bundle in all
3rd-party repositories. If the bundle is in more than one 3rd-party
repository, he/she needs to specify the repo to use.
This commit adds the means to specify this repo by providing the
--repo/-R flag for 3rd-party bundle-add.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This PR starts the third-party repo-add, delete, list skeletal features
for swupd. This PR also add support for configure flag
to build third-party optionally for swupd, off by default.
Repo Add:
sudo swupd 3rd-party add <repo_name> <URL>
Repo Remove:
sudo swupd 3rd-party remove <repo_name>
Repos List:
sudo swupd 3rd-party list
Signed-off-by: Karthik Prabhu Vinod <karthik.prabhu.vinod@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>
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>
Currently users can set content and version urls based on http or https
protocols. This pose a security risk if users decide to use http.
This commit blocks swupd from working with http unless is specifically
allowed by using the --allow-insecure-http flag.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit extracts all the global flags to its own "global" variable
in the swupd.bash script so it is easier to maintain.
The commit also fixes some inconsistencies with the flags in the script.
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>
There is a bug in the code that causes swupd bundle-add <TAB><TAB>
to list regular bundle names as well as iterative manifest names.
This commit fixes the issue by removing the iterative manifests from
the list of results.
Closes#906
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
The --json-output flag can be enabled for every swupd command.
This commit converts it to be a global flag, and enables it in every
swupd command.
Closes#869
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
--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>
This commit add a few functions to report partial progress on a given
step, either in JSON format or standard so a user or another app can
tell what is the current progress status of a swupd operation at all
times.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Since search became search-file and there is a new search, the
autocompletion script needs to be updated.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>