Commit Graph

1096 Commits

Author SHA1 Message Date
Juan RP
1bae26606e Introduce xbps_{pkgdb,rpool}_get_pkg_fulldeptree().
These routines return a xbps_array_t with a full sorted dependency graph
for the target pkg, by querying pkgdb or rpool.

Update xbps-query(8) to use the new libxbps API.
2014-11-20 09:23:51 +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
428a747fad Fix #69 (No way to set globally a custom architecture)
The "architecture" configuration keyword is now available to override
the native machine architecture returned by (uname(2)).

The XBPS_ARCH environment variable still has preference.
2014-11-19 11:36:09 +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
77c6c3e504 Introduce xbps_binpkg_get_file_into_fd() and use it for xbps-query(8) --cat.
This allows you to print to stdout any file stored in a binary package,
locally or remotely!

$ xbps-query -R --cat=/usr/bin/ls coreutils > ls
$ file ls
ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=7a195fc46d1d5cdca32bfccd3b30f81784e342ed, stripped
$
2014-11-17 18:43:08 +01:00
Juan RP
a6516505e9 xbps-query(8: added --cat=FILE mode support.
- This mode prints to stdout the matching FILE stored in a binary package.
- ABI break: renamed xbps_get_pkg_plist_from_binpkg() xbps_binpkg_get_plist().
- Added xbps_binpkg_get_file() as a generic way to get pkg file contents.
- Removed useless comments from xbps_api_impl.h.
2014-11-17 15:45:46 +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
2153c87464 lib/portableproplib/prop_array.c: comment out another debug printf. 2014-11-13 15:22:58 +01:00
Juan RP
3290df5d62 lib/portableproplib/prop_array.c: comment out a debug printf. 2014-11-13 15:22:13 +01:00
Juan RP
43c9497feb Introduce xbps_array_add_first() to insert obj at the head of array.
The behaviour of this routine mimics the existing xbps_array_add() with
the difference that stored objects are moved to the right to insert
our object as the first element on the array.

Use this to add replaced packages in the transaction array at the head
rather than at the end, to preserve the proper sorting order.
2014-11-13 15:18:21 +01:00
Juan RP
74c30556fc xbps_transaction_prepare: check for unresolved shlibs a bit early.
It's just better if we check for unresolved shlibs earlier because
the transaction array will be smaller if there are replaced packages.
2014-11-13 11:39:20 +01:00
Juan RP
04bde70969 xbps_init: print bestmatching value. 2014-11-07 10:18:01 +01:00
Juan RP
53f13d579e Added the "bestmatching" configuration keyword to enable pkg best matching.
See the NEWS file for more information.
2014-11-07 10:07:51 +01:00
Juan RP
6c76f6786d xbps_repo_open: do not create repodata file in locked mode.
... we want a proper errno value (ENOENT) if the archive does not exist.
2014-11-06 11:38:55 +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
9566a0e737 Re-add support for system virtualpkg.d (XBPS_SYS_VPKG_PATH).
This is still useful to set distro defaults for virtual packages, with
the option to override them via /etc/xbps/virtualpkg.d.
2014-11-05 09:40:32 +01:00
Juan RP
595136704e Get rid of system virtualpkg.d support (<prefix>/share/xbps/virtualpkg.d).
Binary packages do not need to provide those virtualpkg configuration files
anymore; all vpkg info is now collected from pkgdb.
2014-11-04 11:17:27 +01:00
Juan RP
5dba1108d1 lib/package_remove.c: simplify link relative check. 2014-10-25 10:32:58 +02:00
Juan RP
ff3960696f lib/package_remove.c: fix a memleak. 2014-10-25 08:08:04 +02:00
Juan RP
e75beec76f unpack: get rid of code that checks for modified symlinks.
Unpacking those symlinks is so cheap that there's no point in wasting
resources just to check if those have been modified, just unpack them
unconditionally.
2014-10-25 06:52:12 +02:00
Juan RP
5fe3594cb5 Make sure that modified symlinks are preserved.
When removing a package, symlinks owned by this package that have been
modified should be preserved, unless the force flag is set via xbps-remove(8).
2014-10-25 06:43:30 +02:00
Juan RP
b81dedb770 lib/transaction_package_replace.c: simplify. 2014-10-25 05:20:13 +02:00
Juan RP
789326cf3a xbps_repo_sync: fix regression introduced in 87ca42f3. 2014-10-24 11:16:24 +02:00
Juan RP
87ca42f399 Remove xdelta support: it never worked and wasn't fully implemented. 2014-10-24 11:04:51 +02:00
Juan RP
654c77df25 Switch back to uncompressed plists.
There's no point in slowing down read performance just to save a few bytes.
2014-10-24 10:15:41 +02:00
Juan RP
e35d0c202c unpack: simplify pkg metadata extraction.
There's no need to internalize props.plist because there are no changes
compared to the pkg dictionary stored in the repo index, simply ignore it.
The code only cares for the files.plist to check for obsolete files.
2014-10-21 09:25:15 +02:00
Juan RP
627a5afaaf Make sure that automatic/manual installation modes are set as expected. 2014-10-20 07:59:06 +02:00
Juan RP
231582e671 libxbps: make sure to not add dups in transaction for remove. 2014-10-19 11:22:17 +02:00
Juan RP
fb868454b2 libxbps: make sure to not add dups in transaction for install/update. 2014-10-19 11:00:40 +02:00
Juan RP
e884270e06 xbps_transaction_prepare: ignore pkgs that will be removed. 2014-10-18 16:07:52 +02:00
Juan RP
ff189fd210 Replaced redundant dependency sorting code with a simpler implementation.
This fixes the issue found by "xbps-src bootstrap" when a package
without "provides" was declared as a virtual package.
2014-10-18 12:35:47 +02:00
Juan RP
adc0643ee4 Fully switch to zplists. 2014-10-17 10:27:58 +02:00
Juan RP
b1eb62a2df lib/package_unpack.c: switch pkg meta files to zplist too. 2014-10-17 10:23:12 +02:00
Juan RP
fc368e159d lib/portableproplib/prop_zlib.c: use a stack buffer to process compressed chunks. 2014-10-17 10:12:12 +02:00
Juan RP
83f5e35ec7 pkgdb: switch to zplists by default. 2014-10-17 10:11:56 +02:00
Juan RP
47310d3408 lib/archive.c: remove support to read zplists in archives.
It was never used and the binpkgs are already compressed...
2014-10-17 10:10:16 +02:00
Juan RP
d7633e88e0 Fix #62 (Dup replaced pkgs in transaction) 2014-10-17 09:52:32 +02:00
Juan RP
1c20086896 Package remove: disable file owner checks if euid==0.
All package files even not owned by root should be removed, so make sure
that those checks return success while being root.

This fixes package removal for polkit, that had /etc/polkit/rules.d
files owned by the polkitd user.
2014-10-17 09:17:07 +02:00
Juan RP
fe76af7702 proplib: use GCC atomic builtins if supported. 2014-10-09 14:41:43 +02:00
Juan RP
09c630a825 lib/transaction_commit.c: CID 62740 (toctou) 2014-10-08 10:13:21 +02:00
Juan RP
513f8a2bae lib/repo.c: CID 62757 (toctou) 2014-10-08 10:00:17 +02:00
Juan RP
805f6aa1b2 lib/repo_sync.c: CID 62763 (toctou) 2014-10-08 09:55:12 +02:00
Juan RP
0c74a5d7fe Revert "lib/portableproplib/prop_object.c: CID 62694 (data race condition)"
This reverts commit dc63aed221.
2014-10-07 11:51:53 +02:00
Juan RP
967acd82b0 lib/fetch/http.c: CID 62725 (NULL pointer dereference) 2014-10-07 11:12:04 +02:00
Juan RP
a6cdd9a698 lib/fetch/common.c: CID 62709 (NULL pointer dereference) 2014-10-07 11:07:24 +02:00
Juan RP
6e7c160195 lib/fetch/file.c: CID 62701 (NULL pointer dereference) 2014-10-07 11:02:12 +02:00
Juan RP
d434b44cfc lib/fetch/http.c: CID 62698 (NULL pointer dereference) 2014-10-07 10:51:37 +02:00
Juan RP
dc63aed221 lib/portableproplib/prop_object.c: CID 62694 (data race condition) 2014-10-07 10:27:07 +02:00
Juan RP
9c5af90fae lib/portableproplib/prop_object.c: CID 62703 (argument cannot be negative) 2014-10-07 10:23:02 +02:00