Commit Graph

282 Commits

Author SHA1 Message Date
Juan RP
67707657a4 xbps-create: always sanitize gathered symlinks.
Added a new test case.

Close #199
2019-12-27 23:15:21 +01:00
Juan RP
166caab986 Do not silently update xbps on any install/update transaction.
When there's a new xbps update, xbps-install(1) will now return
EBUSY (16) and a message (if dry-run disabled) explaining
how to proceed.

If there's an update and transaction does not contain xbps, it will
error out unless the 'xbps' pkg is the only target pkg, i.e:

	# xbps-install -Su
	# echo $?
	16

To update xbps, the only way to proceed is to explicitly declare
it as an update, i.e:

	# xbps-install -u xbps

The dry-run mode will still show there's an xbps update.

Modified the existing test cases to satisfy the new behaviour.

Closes #166
Closes #142
2019-12-27 21:35:40 +01:00
Juan RP
73e0668840 libxbps: fix issue found by the recent glvnd switch.
See the new test case for details, but this simulates
the recent glvnd switch, with mesa, nvidia and libglvnd.

Thanks @st3r4g for the fix! this indeed fixes the new test case.

Close #186
2019-12-27 20:25:05 +01:00
Juan RP
34a1ab51d0
xbps-checkvers: version cache file.
We do not want obsolete files from previous versions, so that
we version the filename of that working version.
2019-12-27 18:23:46 +01:00
Juan RP
64aeabf3f6
xbps-checkvers: restore previous behaviour after 7a220b37db.
The '%n' pkgname fmt option still needs to be the sourcepkg
for xbps-src to work with no additional changes.

This restores previous behaviour, and uses binpkg's pkgname
while checking for pkgdb/repo.
2019-12-27 18:04:53 +01:00
Juan RP
7f75fd840a xbps_init: autodetect musl libc variant at compile time.
This way we don't need to set the 'architecture' xbps.d
setting when the binaries are compiled for musl.

Close #195
2019-12-27 16:23:56 +01:00
Juan RP
7a220b37db xbps-checkvers: use binpkg's pkgname rather than srcpkgs.
Up until now `xbps-checkvers` would only check for the
real sourcepkg, this broke detection of binary packages
that are subpkgs.

Added a new test case.

Close #192
2019-12-27 12:24:16 +01:00
Piotr Wójcik
26d853751e lib/util.c: relax revision check to match existing data 2019-12-14 12:07:12 +01:00
Juan RP
be05118aa8
libxbps: verify repodata signatures even if rootdir is unset.
xbps-rindex(1) has a -r option that sets the remove mode,
due to the changes added to sign repodata we need to access
to the correct directory where repository public keys are
stored. This makes the code use `$PWD/keys` before falling
back to `metadir`.

Fixes the test suite to run with unprivileged users (non root).
2019-11-24 12:52:50 +01:00
q66
85b8b3bbb7 lib/package_alternatives.c: prune obsolete alternatives groups
In the edge case when an updated package has different (or no)
alternatives groups, make sure to prune those that are in pkgdb
but not in the newly installed package.

A potentially common case of this is when a package that formerly
had alternatives gets removed and a transitional metapackage
takes its place (which has no alternatives).

When the new package has no dependencies, oldest next possible
alternatives group will be used. This is because that indicates
a removed package. When there are dependencies, the newest one
will be used; as this indicates a transitional package.
2019-11-17 13:22:15 +01:00
Piotr Wójcik
d785e7e483 Tests for signing metadata 2019-11-02 11:53:14 +01:00
Piotr Wójcik
699b2bdd3b lib/util.c: verify revision in xbps_pkg_{version,revision,name} 2019-10-25 23:37:23 +02:00
Duncan Overbruck
7b66a2885b tests: add two more tests for preserving and force removal of conf files 2019-08-06 13:49:51 +02:00
Duncan Overbruck
c88f15c8fa tests: add two new test cases for keep and removal of modified files 2019-08-05 14:45:19 +02:00
Duncan Overbruck
f215411362 tests: add another testcase for transitional package replaces/provides 2019-08-05 14:44:39 +02:00
Duncan Overbruck
b20e1f5192 Revert "tests: add another case to install_and_update_revdeps test"
This reverts commit f6bc7f621c.
2019-08-05 11:49:40 +02:00
Duncan Overbruck
4f6a5a51de tests: obsolete files test to prove that alternatives don't need to be considered 2019-08-02 11:44:26 +02:00
Duncaen
f6bc7f621c tests: add another case to install_and_update_revdeps test
The new case checks if xbps is smart enough to only update packages that
require an update due to revdep updates.
2019-07-03 00:48:57 +02:00
Duncaen
7c3029589c lib/package_fulldeptree.c: don't add the package itself to the fulldeptree result
This was noticed a few days ago by @leah2.
2019-07-02 09:48:05 +02:00
Duncaen
f9233a862c tests: cover more cases find_pkg_orphans_test:find_all_orphans_test 2019-07-02 09:48:05 +02:00
Juan RP
db00ccc3b0
tests/xbps-remove/orphans: use -r root. 2019-06-27 07:57:13 +02:00
Duncaen
cc1c984e9a tests: add xbps-remove tests 2019-06-26 22:22:44 +02:00
Duncaen
3c07036c24 tests: new obsolete files test with modified files which should catch bug from previous commit 2019-06-26 13:23:18 +02:00
Juan RP
f9477e08a7
tests/update_itself: improve test case on_any_op even more. 2019-06-25 23:13:17 +02:00
Duncaen
5fc340a838 tests: add test for removal of ignored package 2019-06-23 12:23:17 +02:00
Juan RP
4f717dc597 xbps-install(1): added -I, --ignore-file-conflicts.
If set it will continue with the transaction and will
just print what are the conflicting files without returning
EEXIST.

This is a temporary solution for void where there are still
some packages with conflicting files (qt5-host-tools vs qt5-tools-devel).

With input by @duncaen
2019-06-21 15:31:04 +02:00
Duncaen
2cccb31508 tests: add two test cases for obsolete preserved files 2019-06-20 14:53:08 +02:00
Juan RP
a3209f4b57
tests: rename some tests to make .gitignore effective. 2019-06-20 12:50:10 +02:00
Juan RP
b37dd066c9
tests: fix manpage refs. 2019-06-20 11:02:40 +02:00
Juan RP
818e399a8c
tests/xbps-checkvers: update tests for new output fmt. 2019-06-19 13:48:22 +02:00
Juan RP
829c5835f1
alternatives: respect (and love) current provider.
Added a new test case to verify.

Close #126
2019-06-18 20:47:55 +02:00
Duncaen
27b9da6c9a tests: don't rely one files mtime 2019-06-18 19:54:22 +02:00
Duncaen
f4bf826c7f tests: add two more test cases for obsolete files 2019-06-18 19:54:22 +02:00
Duncaen
f6bf9b44ce tests: add tests for package preserve keyword 2019-06-18 19:54:22 +02:00
Duncaen
3915d523d0 tests: add test for conflicting files in transaction 2019-06-18 19:54:22 +02:00
Duncaen
247463e359 tests: add two new tests for transaction_files 2019-06-18 19:54:22 +02:00
Duncaen
6877d28139 lib/package_find_obsoletes.c: remove in favor of transaction file checks 2019-06-18 19:54:22 +02:00
Duncaen
888289786b tests: move file type change tests to obsolete files 2019-06-18 19:54:22 +02:00
Duncaen
bf4740040f tests: Update package to meta moving files to dependency and replaces
https://github.com/void-linux/xbps/issues/12
2019-06-18 19:54:22 +02:00
Duncaen
c8ef119f4b tests: enable debug flag in directory to symlink test 2019-06-18 19:54:22 +02:00
Duncaen
f5e6d33c6e tests: update test issue31 2019-06-18 19:54:22 +02:00
Duncaen
69e64e6c21 tests: enable test 'replace directory with symlink' 2019-06-18 19:54:22 +02:00
Johannes Brechtmann
514dca27ef tests: update replaces file with directory 2019-06-18 19:54:22 +02:00
Duncaen
66e5b721ae tests: obsoletefiles_test:reinstall_obsoletes add debug flag and different rv 2019-06-18 19:54:22 +02:00
Duncaen
2a9029b736 tests: fix tests; transaction detect if multiple packages install the same file 2019-06-18 19:54:22 +02:00
Duncaen
c533f1bd52 tests: change the obsoletefiles tests to have the same mtime
This is required because the of reproducibility changes.
2019-06-18 19:54:22 +02:00
Juan RP
b672e1a7f2
Improved "xbps auto-updating itself" behaviour.
Always check if there's a new xbps package version available
while *installing* or *updating* in any form.

This fixes the following scenario:

- xbps-0.53_10 is currently installed
- xbps-0.54_1 is available in repo
- xbps-install --update netbsd-wtf || xbps-install new-pkg || xbps-install --update

As expected any of the following scenarios in last cmd will use *this*
transaction to autoupdate xbps and its reverse dependencies.

Another transaction will be necessary to install or update the other unrelated
packages.

Added a new test case to verify this case and improve the other test
cases with more extensive checks.
2019-06-17 12:02:02 +02:00
Duncaen
49cc70de9a xbps-checkvers: rewrite check_reverts without malloc 2019-06-15 23:50:50 +02:00
Duncaen
3805fd5297 xbps-checkvers: use proplib data structures and add cache file 2019-06-15 23:50:50 +02:00
Juan RP
a9a889c54d fulldeptree: return a proper error if deps can't be resolved.
xbps_get_pkg_fulldeptree() now returns NULL and sets errno to ENODEV
when there are missing dependencies, rather than assert()ing.

Added another test case to check returned error codes.

Signed-off-by: Juan RP <xtraeme@gmail.com>
2019-06-15 18:04:20 +02:00