Converting from different int types are not always correct, so turning the
gcc warning that check for conversions that might change the value or sign of
the number.
check-update was trying to create a motd in a deprecated directory and
it was always failing.
Removing code for now.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
This commit adds these function:
- statedir_get_delta_dir: to get the "download" directory
- tatedir_get_fullfile_tar: to get thet downloaded fullfile tar
- statedir_get_fullfile_renamed_tar: to get the renamed fullfile during
untarring
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit adds the following functions:
- statedir_get_staged_dir()
- statedir_get_staged_file()
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Currently we have two functions to track bundles, bundles should always
be tracked in the same location, if there is an exception to this rule
then it should be handled separately.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This commit adds the statedir.c module and moves the function to get the
tracking directory to this module. It also adds a new function to get
the path to a tracking file into the module.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Bootloader updates should trigger a call to boot manager, but they shouldn't be
treated like boot files.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Ignore call was confusing and value was ignored for the main usages.
It should always run with the main heuristic functions.
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)
Adding src to default list of includes to make it easier to organize swupd header
files in directories.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Make sure we are not accidently using the incorrect variable
by not allowing 2 variables with the same name.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
CONFIG_FILE_PATH contains a list of paths not just one path. So
we shouldn't use realpath to point to it.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
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>
This commit adds a couple of functions:
- bundle_list_track(): list the bundles that are tracked in the system
- bundle_list_installed(): list the bundles installed in the system
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
- All options and subcommands are automatically generated from help messages.
- Used `_init_completion` to set $cur, $prev, $words variables, which are
equivalent to $2, $3, $COMP_WORD, but far more readable.
- It also allows possibility to use other functions provided in
`/usr/share/bash-completion/bash_completion`, for future
- A minor change on getting current OS version via `swupd info --quiet` from
reading `/var/lib/swupd/version`, which is non-readable to non-root users
- Though MoM file is still non-readable to non-root users
- We only ship modern Bash, so the test on Bash version near the end of the
script is removed