Bug Fixes:
- On 3rd-party add, if the execution was aborted by user, we could end up with an invalid repository entry
- Don't create hardlink for symlinks because this is not supported by some toos, like bsdtar
Enhancements:
- Improving debug output on external commands executed, like scripts
- Using same curl reporting callback for spinner and progress
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
When adding a 3rd-party repo, if the repo cannot be added it is reverted
back. However if a user uses an incorrect URL that hangs and the user
cancels the process, the repo add is never rolled back, which will cause
the invalid repo to be left in the system.
This commit fixes the issue by making sure the repo is reachable and
somewhat valid before adding it to the config file.
Closes#1384
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Alternative solution to solution proposed on #1318
Instead of trying to create a link just don't try to link symlinks.
Tested patch using bsdtar and implemented automated testing to
validate solution.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Moving from PROGRESS function to XFERINFO that is recommended by the
manual.
This fix a warning in the build, so we can turn on -Werror in tests
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
It looks like CURLOPT_PROGRESSDATA is working, but the correct parameter
to use for XFERINFO is CURLOPT_XFERINFODATA. There's no guarantee this will
work in the future, so porting to the recommended parameter.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
The reason we have a build script is that we wan't to control all
configuration arguments, so don't add any implicity CFLAGS
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Besides having a script that is used to run tests on github
actions CI, adding another script that can be used in any
system to build swupd with different configurations and
run all needed tests.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Bug Fixes:
- 3rd-party update could report some incorrect file permission changes due to symlink derreference
- os-install --bundles with only os-core parameter was failing
- Fix some invalid examples on swupd manual
- Fix warning message on autocomplete for zsh
Tests and clean-up:
- Funcional tests running in paralell for default and in lexicographic order
- Removing code on parser and tests related to the deprecated iterative manifest
- 3rd-party enabled by default on build systems
- Printing 3rd-party compile flag status on swupd -v
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
When doing a system install with "os-install --bundles" if the list of
bundles to install includes only "os-core" the install fails.
This commit fixes the issue.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Huge amount of changes are due to re-formatting. There are only four actual
changes:
- Added a ')' on line 203, 211, and 219.
- Changed line 280 from
`'(help --status)'[Show the installation status of the listed bundles'`
to
`'(help --status)--status[Show the installation status of the listed bundles]'`
Vi isn't a bundle anymore. Replacing all examples to vim.
os-core isn't a good bundle for example. Using xterm.
Related to #1369
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
We print all flags selected on build time on swupd -v. This is useful
to check if an specific swupd binary has one specific feature enabled.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
The iterative manifest effort was droped so this commit removes the
iterative manifest support from testlib.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When building swupd with --disable-signature we need to have all
signature functions with a dummy implementation that doesn't validate
the signature.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Instead of requiring an --enable-third-party, as 3rd-party was already
released, we can make it default.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
We had a format bump and now Iterative manifests aren't supported
anymore. We are safe to remove that from the parser.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
When updating 3rd-party bundles, swupd validates the files to be updated
to make sure there were no changes in file permissions that could be
risky for the system, it uses stat to get the file permissions. The
problem is that stat follows links, and while the files are in staging,
the links are really pointing to invalid locations so stat will always
fail.
This commit fixes the problem by not following links when validating
file permissions.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Check-functional wasn't being run in parallel. Using $(MAKE) instead
of make to propagate make parameters
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Clear Linux isn't using the check-update service anymore for a long time
and there's no other known uses for those scripts. So there's no reason to
keep them.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
This release of swupd includes a swupd 3rd-party info command and
fixes some minor bugs on swupd 3rd-party error handling.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
This release of swupd introduces management of 3rd-party repositories and
content installed from them. A 3rd-party repository enables the distribution
of user produced content. Multiple repositories can be managed along with the
default upstream server. Most of the swupd subcommands used for managing
upstream content are supported to manage 3rd-party content along with most of
their options.
Besides that, this release also adds multiple improvements in pre-existing
swupd commands and bug fixes.
Enhancements:
- Adding flag --recursive to bundle-remove so dependencies can also be removed from the system as long as nothing else still depends on them
- Improve the output of bundle-info and bundle-list to inform if dependencies were included or added by also-add flag
- Reporting the total space cleared by swupd clean command
- Display which bundles are installed on the output of bundle-info command
- Run ldconfig on chroot when running swupd using --path parameter
- Display a spinner before downloading a file to improve progress report
- Support searching files on specific version on search-file command
- Make swupd config files case insensitive
Bugs:
- Invalid output when using an empty file as swupd config file
- Memory leaks on initialization erros or downloading a file to a full disk
- Bundle info was showing an incorrect size for large bundles
- Number of files added by bundle-add was corrected
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
Reordering so it matches the order of the regular swupd commands. Also
adding missing values to config file.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Implementation of the 3rd-party info command to show the version of the
3rd-party repository along with the update URL.
Closes#1354
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
This reverts commit be1deab965.
Castulo found a critical bug introduced by this commit. Reverting while we are
investigating the root cause and proposing a solution
stime is deprecated in newer versions of glibc, so using the recommended
clock_settime() instead.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
This commit allow users to force the deletion of corrupt 3rd-party repos
which will end up deleting most of the repo's files, except for the
scripts that exported files from that repo.
Closes#1343
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
When adding an upstream bundle, we apply some heuristics to the bundle
files and based on that some files are skipped from being installed.
These heuristics don't apply to 3rd-party bundles.
This commit skips running heuristics when adding 3rd-party bundles.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
Sometimes a test fails before finisihing to create all the required
directories under the testdir. So destroy_environment thinks this is
not a valid test environment.
Touching a dot file to show that the directory is a test environment
instead on counting on its content.
Fixes bug #1135
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
When users add a 3rd-party repository they are asked if they want to
trust the certificate, this commit makes possible to use the
--assume flag to answer that question.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>
It's possible to create a post_update script to run ld_config, but we
had problems with this in the past, so it was decided to hardcode that
on swupd instead of relying on scripts.
Signed-off-by: Otavio Pontes <otavio.pontes@intel.com>
When running an operation that should run in all the 3rd-party repos
installed, if one repo fails to set up, the process is aborted and the
operation is never performed in the repos after the failed repo.
This PR changes the proces so if one repo fails to set up it is just
skipped so the operation is attempted in the other repos.
Signed-off-by: Castulo Martinez <castulo.martinez@intel.com>