Commit Graph

131 Commits

Author SHA1 Message Date
Duncan Overbruck
6794077efd
Add noextract configuration option
Closes #208
Fixes #165
2020-01-18 15:51:13 +01:00
Piotr Wójcik
26d853751e lib/util.c: relax revision check to match existing data 2019-12-14 12:07:12 +01:00
Duncaen
62c1102cc4 lib/util.c: xbps_remote_binpkg_exists to check if signature and binpkg are cached 2019-10-25 23:38:01 +02:00
Piotr Wójcik
699b2bdd3b lib/util.c: verify revision in xbps_pkg_{version,revision,name} 2019-10-25 23:37:23 +02:00
Juan RP
0677678387 Added LTO support and fix warnings (maybe-uninitialized). 2019-06-27 18:09:26 +02:00
Juan RP
87f7766c5f xbps_symlink_target: fix two memleaks found by clang-analyzer. 2019-06-18 18:49:29 +02:00
Duncaen
45fc07260c xbps_binpkg_exists: fix access() on remote packages and avoid malloc 2019-06-14 23:21:06 +02:00
Juan RP
dd3dc2ddec xbps_symlink_target: always canonicalize rootdir.
... otherwise we might end up with a relative rootdir that will
give unexpected results.

dtrt when rootdir != /
2019-06-07 20:13:24 +02:00
Juan RP
9e2c00ee8b libxbps: remove dangling symlinks properly.
This fixes removal of packages that contain multiple levels
of dangling symlinks, i.e faenza-icon-theme and probably others.

Close #23
2019-06-07 20:13:24 +02:00
Juan RP
cf78b7272f lib/util: musl needs _{GNU,BSD}_SOURCE for strlc{at,py}(). 2019-04-22 15:31:07 +02:00
Duncaen
d1667fd931 Add the ability to ignore packages
The previous idea was to use virtual packages in the users configuration
to satisfy dependencies by mapping them to existing installed packages.
Using virtual packages for it doesn't work as expected and trying to make
it work would break other functionalities of virtual packages, like the
version satisfaction checks for `provides` and the ability to replace
virtual packages with real packages. The virtual package functionality
should be used exclusively for virtual packages.

This allows users to specify packages packages that should be ignored.
Ignored packages in dependencies are always satisfied without installing
the package, while updating or installing a package that depends on an
ignored package.

This does NOT ignore the shlib checks, ignoring a package that provides
required shared libraries will abort the transaction as if there was no
package that provides the required shared library.
2019-04-19 23:07:59 +02:00
human
8d594727cc lib/util.c: improve error handling in xbps_binpkg_{arch,pkgver}
they no longer assert or segfault on malformed strings

Closes: #48 [via git-merge-pr]
2019-04-14 15:01:18 +02:00
Juan RP
91067c0547 xbps_symlink_target: fix bug introduced in b81b9ab. 2016-02-04 09:55:46 +01:00
Juan RP
1e733f4daa lib/util: fix a memleak detected by clang-analyzer. 2016-02-03 11:52:07 +01:00
Juan RP
f5f25a5ff4 xbps_symlink_target: fix a double free. 2016-02-02 11:51:26 +01:00
Juan RP
b81b9ab379 xbps_symlink_target: fix bb977c7 (v3). 2016-02-02 11:08:05 +01:00
Juan RP
d984eeeb47 xbps_symlink_target: fix bb977c7 (v2). 2015-12-21 17:50:13 +01:00
Juan RP
4c655fd56a xbps_symlink_target: fix bb977c7 2015-12-21 17:20:34 +01:00
Juan RP
bb977c73e4 xbps_symlink_target: fix a meamleak reported by clang-analyzer. 2015-12-21 16:55:53 +01:00
Juan RP
090464e4b2 xbps_sanitize_path: fix an out-of-bounds access (CID #98686). 2015-07-26 08:01:29 +02:00
Juan RP
7e21f1ee1a xbps_symlink_target: rename var to avoid shadowing a global var. 2015-02-19 11:44:10 +01:00
Juan RP
9083191e4b xbps_symlink_target: double free in rootdir == '/' case. 2015-02-19 11:39:59 +01:00
Juan RP
6d65e76f91 xbps_symlink_target: fix a memleak. 2015-02-19 11:36:09 +01:00
Juan RP
a05e039cce Revert "Stop converting relative symlinks to absolute."
This reverts commit 9ae3638429.

This change is ok, but cannot be used right now because all existing
binpkgs were created with an old xbps-create(8).
2015-02-19 11:11:58 +01:00
Juan RP
9ae3638429 Stop converting relative symlinks to absolute.
There's no reason to make them absolute, simply store in the metadata
the target file as is. This vastly simplifies the code and makes all
test pass correctly.
2015-02-19 11:04:34 +01:00
Juan RP
67eba7d912 Improve detection of target file in relative symlinks.
If xbps-create(8) did not guess the target file of relative symlinks for
some reason, just compare the current symlink and what's stored as is,
without converting it to absolute.

This might happen with dangling relative symlinks or existing binary
packages that were not created with a newer xbps-create(8).
2015-02-19 10:24:24 +01:00
Juan RP
05f879ec09 Introduce xbps_symlink_target() and use it in two places.
This code is now shared by xbps-pkgdb and libxbps/xbps-remove.
2015-02-19 09:47:09 +01:00
Juan RP
1722635e08 Introduce xbps_sanitize_path() to fix #78 properly.
This removes multiple slashes of a path and returns you a buffer with
the sanitized string.
2015-02-18 15:12:39 +01:00
Juan RP
eb90fcc50c xbps_binpkg_{arch,pkgver}: return a buffer of matched string instead.
... otherwise will pass an invalid pointer to free(3) later on.
2014-11-19 11:56:16 +01:00
Juan RP
b2bc7af66e Fix #68 (xbps_binpkg_arch() asserts if arch contains a dash) 2014-11-19 11:14:37 +01:00
Juan RP
c549252223 xbps_pkg_version: minor optimization. 2014-11-18 16:11:43 +01:00
Juan RP
3afb9d709d Get rid of repodata index-files; the archive is now 8x smaller.
See the NEWS file for more information.
2014-11-13 17:09:43 +01:00
Juan RP
5b522109f7 Replaced config/system {repo,preserve,virtualpkg}.d with a single directory.
See the NEWS file for more information.
2014-11-06 09:58:04 +01:00
Juan RP
fe87bc1a88 lib/util.c: CID 62710 (dead code) 2014-10-07 08:16:45 +02:00
Juan RP
97045960f9 xbps_pkg_reverts: style. 2014-09-27 11:28:29 +02:00
Enno Boland
b5a169b65c xbps_pkg_reverts: this function can do more than just return false! 2014-09-23 21:18:47 +02:00
Enno Boland
a421bf7db5 xbps_pkg_reverts: return bool instead of int. 2014-09-23 20:50:34 +02:00
Enno Boland
dbab3f2cfc xbps_pkg_reverts: use version instead of pkgname-version to find reverts 2014-09-23 18:22:57 +02:00
Enno Boland
50fb6c1605 rename xbps_pkgver_is_reverted to xbps_pkg_reverts 2014-09-23 13:54:06 +02:00
Enno Boland
18204aeac1 lib/util.c: add function which tests if a given pkgver is reverted by a given pkg. 2014-09-23 13:54:06 +02:00
Juan RP
5863ec17fe libxbps: two new functions to get the pkgver and arch components in a filename.
- xbps_binpkg_pkgver() returns a heap allocated string with the pkgver component.
- xbps_binpkg_arch() returns a heap allocated string with the architecture component.

A basename, full path or relative path is supported, i.e:

	/path/to/foo-1.0_1.x86_64.xbps
	../../foo/blah-0.1_1.x86_64.xbps
	baz-0.1_1.x86_64.xbps
2014-09-05 20:59:00 +02:00
Juan RP
5a1919e520 xbps_pkg_is_installed(): a pkg in "unpacked" state is now accepted as installed too.
The reason is that even if the pkg was not configured, it should still be accepted
as installed. If installing packages via XBPS_TARGET_ARCH, pkgs are never configured,
so this must be taken into account.

Will be cherry-picked to 0.37 meanwhile.
2014-08-23 15:54:24 +02:00
Juan RP
79fe312302 Gather proper transaction stats (take into account binpkgs in cachedir, and "preserved" pkgs). 2014-07-13 09:56:06 +02:00
Juan RP
2fa0d56658 Fixed a xbps_pkgpattern_name() crash and a test to reproduce it (found by Gottox). 2014-02-15 01:26:42 +01:00
Juan RP
5eea259c13 Remove the config.h kludge and override vasprintf detection via HAVE_VASPRINTF. 2014-01-20 18:50:33 +01:00
Juan RP
c9825feb29 util.c: add stricter checks for pkgver conformance (v2).
There was another case where it now was failing: "fs-utils-v1.00_1".

Previous code didn't take into account that a valid version might also
contain a non digit after '-'.

Added more tests to the testsuite to verify its correctness.
2013-11-17 12:25:02 +01:00
Juan RP
c44d7070a4 util.c: add stricter checks for pkgver conformance.
Make xbps_pkg_{name,version} return NULL if next character
after the last '-' character is not a digit, and if there's a digit
make sure that there exists a '_' character too.

Added more tests to the testsuite to catch this. With these changes
'python-e_dbus' is properly detected and validated.
2013-11-17 11:34:14 +01:00
Juan RP
53ecaf9819 Remove xbps_print_hexfp() from API and move it xbps-rindex, where it belongs. 2013-11-08 09:12:29 +01:00
Juan RP
c69134f851 xbps_repository_is_remote: optimize and check for http:// first. 2013-10-07 09:23:25 +02:00
Juan RP
8d5c48b861 Added support for the long awaited feature: RSA signed repositories. 2013-10-05 11:38:04 +02:00