Commit Graph

394 Commits

Author SHA1 Message Date
Juan RP
0c7701f2bc Introduce xbps_array_foreach_cb() and use it in random code.
This routine will spawn a thread per core to process N items stored
in the specified array, the last thread gets the remainder of items left.

Results have shown that xbps benefits if there is a considerable amount
of items and number of threads being spawned.

Use it in xbps_pkgdb_foreach_cb(), xbps-pkgdb(8), xbps-query(8)
and xbps-rindex(8).

On UP systems there's no overhead because pthread(3) is not used at all.

WIP! investigate if it can be used in libxbps (xbps_rpool_foreach()),
and finish conversion of xbps-rindex(8) -c.
2013-07-27 09:47:16 +02:00
Juan RP
432067de48 Remove three unused API functions. 2013-07-27 06:12:59 +02:00
Juan RP
1d0a5faff0 include/xbps.h.in: xbps_api.h -> xbps.h 2013-06-29 06:46:46 +02:00
Juan RP
505a933097 Added support to verify reverse dependencies in a transaction.
See https://plus.google.com/106812073015308749022/posts/ZXMHimd8iKd
2013-06-27 16:52:31 +02:00
Juan RP
09e116b7f0 xbps_api.h -> xbps.h 2013-06-20 12:31:02 +02:00
Juan RP
42c0766c00 Get rid of libfetch and proplib external dependencies.
The list of required external deps is now confuse, libarchive and openssl.

libxbps now includes a wrapper for proplib prefixed with xbps_ rather than prop_.
2013-06-20 10:26:12 +02:00
Juan RP
4ef66d99bb Drop requirement of confuse header for the public API; it's only used by libxbps. 2013-06-19 11:29:04 +02:00
Juan RP
d419f8ac2a Move fetch.h to lib/fetch. 2013-06-19 11:03:03 +02:00
Juan RP
0d22fe362c Increase default libfetch cache limits. 2013-06-19 09:39:39 +02:00
Juan RP
3abe48b68a Introduce xbps_repo_get_pkg_plist() and use it in xbps-query -R. 2013-06-14 10:22:10 +02:00
Juan RP
5f2bba7f4e Move functionality to resolve revdeps from repos to libxbps. 2013-06-14 08:13:51 +02:00
Juan RP
99be698979 Use a single file to store repository data.
This is just the starting point to extend repositories with PGP signatures.
2013-06-10 10:28:39 +02:00
Juan RP
5fd7565e6c xbps-install(8): -R now overrides the repository list set in a configuration file.
Now -R can be used independently if a configuration file exists or not.
2013-04-18 18:17:14 +02:00
Juan RP
57bb7baf5e unpack: use archive_entry_{filetype,uid,gid,mode} rather than stored struct stat. 2013-03-15 13:18:30 +01:00
Juan RP
b9888fd7be xbps_match_virtual_pkg_in_dict: add support to match vpkgs with exact version. 2013-03-10 10:07:54 +01:00
Juan RP
b976a45aed New code to find pkg obsolete files, with a proper kyua test.
Previous code incorrectly found obsolete files in this case:

(curpkg) - in files: /etc/foo.conf
(newpkg) - in conf_files: /etc/foo.conf

and removed this file because the code couldn't find it in the same
array. The new code fixes this case and compares the whole pkg filelist.
2013-03-09 13:30:56 +01:00
Juan RP
c504a73f08 Re-use pkgname from unpack to handle config files. 2013-03-08 10:11:16 +01:00
Juan RP
50ea03df2a Revert code to update xbps independently; I'll use another way to implement this. 2013-03-08 09:44:57 +01:00
Juan RP
5eddf04898 Ignore executing install/remove scripts if XBPS_TARGET_ARCH is set.
Instead a two stage approach is necessary when packages for target arch
are installed:

	- XBPS_TARGET_ARCH=arch xbps-install foo <- only unpack
	- xbps-reconfigure -a <- configure natively or via an emulator
2013-03-07 18:08:12 +01:00
Juan RP
0a1859987a Respect automatic-install mode from pkgdb in transaction updates.
Also simplify register/unregister and remove useless state definitions.
2013-03-07 10:03:59 +01:00
Juan RP
90b6803825 Introduce XBPS_STATE_CONFIGURE_DONE and use it in xbps-reconfigure(8). 2013-03-07 09:24:04 +01:00
Juan RP
5533259557 Also version XBPS_PKGINDEX to 1.7. 2013-03-05 07:34:37 +01:00
Juan RP
7c1a0ac3e8 New pkgdb (0.21) and repo index (1.7) format, see NEWS for info. 2013-03-05 04:08:42 +01:00
Juan RP
460e2e07fe include/xbps_api.h.in: drop __{BEGIN,END}_DECLS. 2013-03-03 11:21:26 +01:00
Juan RP
5471c7f46c Add libarchive compat definitions for 3.1.2. 2013-02-20 14:52:01 +01:00
Juan RP
ae7b76e245 xbps_fetch_file: don't fsync(3) before closing fd; slowdowns considerably slow storage. 2013-02-20 10:46:21 +01:00
Juan RP
2b5d3bb8f4 libxbps: when resolving deps, ignore all of them that depend on the origin pkg. 2013-02-07 18:50:55 +01:00
Juan RP
178a6b58ae Remove another transaction obj from pkgdb and make xbps-pkgdb catch it. 2013-02-07 17:49:28 +01:00
Juan RP
d8769c4873 Workaround fix for 'xbps-install -yf xbps <-> xbps-git'. 2013-02-05 12:10:24 +01:00
Juan RP
5c1688944d xbps-install: make -f preserve conf files; use it twice to overwrite all files. 2013-02-02 11:30:42 +01:00
Juan RP
66cf15f1c2 Update API docs. 2012-12-19 01:01:27 +01:00
Juan RP
22adf99e40 Faster generation of dynamic reverse dependencies and do this exactly once. 2012-12-15 07:33:49 +01:00
Juan RP
1d42986b75 libxbps: finish support for rindex 1.6. 2012-12-07 17:11:52 +01:00
Juan RP
2c1e4e502d XBPS can now be built on NetBSD (and probably any other BSD variant). 2012-12-06 12:58:17 +01:00
Juan RP
e277823268 xbps_api.h.in: don't redefine __{BEGIN,END}_DECLS; which is true on BSD. 2012-12-06 10:54:01 +01:00
Juan RP
2e2da80cfc find_repo_deps: find pkgd from pkgdb by name as it checks for version later. 2012-12-02 16:34:01 +01:00
Juan RP
f45352dbf8 Added support for dynamic generation of revdeps for installed packages. 2012-11-30 17:40:52 +01:00
Juan RP
63c1883201 Major API/ABI cleanup bringing performance improvements and fixes.
These are the core interfaces in the new API:

rpool - Interface to interact with the repository pool.
rindex - Interface to interact with repository indexes.
pkgdb - Interface to interact with local packages.
transaction - Interface to interact with a transaction.

This also brings new repository index format, making the index file
per architecture and being incompatible with previous versions.

The transaction frequency flush option has been removed, and due to
the nature of package states it was causing more harm than good.

More changes coming soon, but the API shall remain stable from now on.
2012-11-30 07:11:51 +01:00
Juan RP
7f577e005c metadir: replace uthash simply with a dictionary. 2012-11-21 23:07:38 +01:00
Juan RP
ddca33b4a9 XBPS_RELVER: embed the latest git rev hash. 2012-11-20 00:38:23 +01:00
Juan RP
bdd93b7aa7 Introduce xbps_pkgdb_get_virtualpkgd() and use in xbps_metadir_get_pkgd(). 2012-11-19 21:46:54 +01:00
Juan RP
5de4fb1f0a xbps-install: -f will also overwrite pkg files. 2012-11-19 20:50:58 +01:00
Juan RP
a311294f0a libxbps: added support to "inject" vpkg config files at initialization time. 2012-11-19 15:42:24 +01:00
Juan RP
1147e7ce3c xbps_find_pkg_orphans: there's no need to check pkg state, any state is ok. 2012-11-19 14:07:05 +01:00
Juan RP
46f7a808b4 xbps_metadir: use an hash table (via uthash): 15s vs 1m10s. 2012-11-18 02:38:24 +01:00
Juan RP
fcdb6b0930 unpack: use pkg dictionary from metadir to find obsoletes! 2012-11-17 15:14:11 +01:00
Juan RP
b0fab7a3ee Implemented a cache to get pkg dicts from metadir.
This improves xbps-pkgdb -a marginally, but still seems to be a bit slow.
2012-11-16 21:50:52 +01:00
Juan RP
34bd49f85a New pkg metadata structure for 0.18. See the NEWS file for info. 2012-11-16 16:55:35 +01:00
Juan RP
a77727887d Improvements for xbps_fetch_file and xbps_repository_sync_index.
xbps_fetch_file:
	- A temp file is created with .part extension to improve resuming.
	- Files are downloaded in cwd.
	- Switch to futimens(2) and fsync(2).

xbps_repository_sync_index:
	- Do not create local repodir in metadir if it already exists.
	- Simplify the code thanks to new xbps_fetch_file().
2012-11-11 11:29:49 +01:00
Juan RP
df0d5d7330 Get rid of pkg state half-unpacked; not-installed state is good enough. 2012-11-11 09:42:30 +01:00
Juan RP
05984a31b1 xbps_rpool_sync: new arg to specify the file; bump XBPS_API_VERSION. 2012-11-07 10:37:58 +01:00
Juan RP
ca095df52f libxbps: some tweaks for struct xbps_state_cb_data.
- Renamed args pkgname/version to arg0/arg1 to make them generic.
- Update bins with this and make some tweaks in state_cb.

Bumped API version.
2012-11-07 10:11:06 +01:00
Juan RP
a5707e5b8d Bump XBPS_API_VERSION for latest changes in libxbps behaviour. 2012-10-26 11:35:01 +02:00
Juan RP
863f12e349 Improved finding obsolete files while upgrading pkgs. 2012-10-24 07:45:00 +02:00
Juan RP
22a86d82f8 Added support for installing exact dependencies, i.e pkg X depends on 'Y-1.0_1'. 2012-10-09 07:35:59 +02:00
Juan RP
6592164010 xbps_api.h.in: bump XBPS_APIVER. 2012-10-06 09:23:27 +02:00
Juan RP
b13df00ded Use a common place to set XBPS_VERSION. 2012-10-03 10:10:20 +02:00
Juan RP
7909f597cb xbps_path_from_repository_uri: do not look for binpkgs in repo arch dirs anymore. 2012-09-30 10:13:06 +02:00
Juan RP
54b6cc7ec1 xbps-{bin,repo}: add -B flag to set default repo if xbps.conf not found.
(cherry picked from commit 75eac1a1426040a833e0b10e208f2e55fa359532)
2012-09-29 19:10:48 +02:00
Juan RP
e370ff0625 libxbps: use a new bool in struct xbps_handle to track successful initialization.
(cherry picked from commit 03374950680f6a839b1ee2df8e3a4e1dfb110fa8)
2012-09-29 19:09:03 +02:00
Juan RP
b422fa654e xbps_api.h: next version will be 0.17. 2012-08-10 08:44:41 +02:00
Juan RP
8eba2d7ea3 xbps-repo: replaced 'genindex' target with 'index-{add,clean}'.
See the NEWS file for more information.
2012-07-17 12:31:04 +02:00
Juan RP
9edd60c3a7 libxbps: extend the list of symlinks in rootdir to be ignored. 2012-07-14 12:11:55 +02:00
Juan RP
2f1e975607 Added "install-date" object to pkg's pkgdb dictionary, make xbps-bin(8) print it. 2012-07-11 12:19:39 +02:00
Juan RP
34697e8022 libxbps: improve matching obsolete files, skip matches by hash and filename.
Don't remove top level symlinks (/bin, /sbin and /lib) if they were found
as obsoletes. This is a workaround for the system transition to /usr.
2012-07-10 23:22:25 +02:00
Juan RP
172435bd7e xbps_check_is_installed_pkg_by_pattern: do not reset errno, leave it as is. 2012-07-04 12:59:40 +02:00
Juan RP
94238302f2 transaction_ops: in update, check if curpkg has been previously added. 2012-07-04 11:56:01 +02:00
Juan RP
f1ad8a95de xbps-repo: fixed issue 24 (xbps-src make-repoidx is doing something wrong). 2012-06-30 11:10:00 +02:00
Juan RP
54bc92bd97 xbps_dictionary_from_archive_entry: simplify and sync zlib code with proplib. 2012-06-20 09:26:00 +02:00
Juan RP
8abd275bfb libxbps: xbps_rpool_release: don't release repo_pool, it's already released. 2012-06-18 10:49:36 +02:00
Juan RP
c24ce8e4da libxbps: use memcpy in critical paths for performance, fixed some memleaks. 2012-06-18 10:43:05 +02:00
Juan RP
0f3d4f4a19 libxbps: hide compat symbols. 2012-06-18 09:52:19 +02:00
Juan RP
974b2fe8ad libxbps: simplify pkgdb_get_pkgd and find_pkg_dict_installed internals.
There's no need to prop_dictionary_copy the returned dictionary to
later have to free it again, just return directly the dictionary and
avoid the free(3)s.
2012-06-16 09:02:07 +02:00
Juan RP
068cab8d20 libxbps: performance improvements by caching the most accessed paths.
1- We can cache the result of the first xbps_pkgdb_init() when it fails
   and avoid the malloc/free/access from it.
2- We cache the uname(2) result into a private var in xbps_handle and
   use it in xbps_pkg_arch_match().

This improves performance by ~5% approx and it's close as it was before
introducing the repository index format 1.5.
2012-06-15 15:33:11 +02:00
Juan RP
506625a716 libxbps: also match vpkgs in previous commit. 2012-06-14 12:12:05 +02:00
Juan RP
302b216d8d libxbps: do not add dups to transaction dictionary due to virtual pkgs. 2012-06-14 11:53:27 +02:00
Juan RP
c31d168e2b xbps_api.h: document EAGAIN in xbps_transaction_prepare(), fix typos. 2012-06-14 10:01:24 +02:00
Juan RP
6cc5ee2d81 xbps_api.h: fix doc for xbps_rpool_index. 2012-06-14 09:49:32 +02:00
Juan RP
d46c503a97 xbps_api.h: document new xhp arg in some funcs. 2012-06-14 09:43:39 +02:00
Juan RP
3e9e87fc2a libxbps: require a pointer to xbps_handle in functions that need it.
This removes 2 global vars from lib/initend.c and easier to know
what functions require access to xbps_handle.
2012-06-14 08:22:11 +02:00
Juan RP
c61ba8dfcc Added support for package conflicts. 2012-06-11 16:14:03 +02:00
Juan RP
81610697df xbps_transaction_install_pkg: proper pkg find order in rpool.
Previously it was preferring virtual packages from
configuration file before real packages.
2012-06-09 10:09:46 +02:00
Juan RP
e75a524ee3 xbps_transaction_install_pkg: on exact match properly detect if it's installed. 2012-06-05 22:54:46 +02:00
Juan RP
efefa000b2 xbps_dictionary_metadata_plist_by_url: only accept exact matches. 2012-06-05 20:53:15 +02:00
Juan RP
a00a450fe0 unpack: make sure to use exact file when checking for hash matches. 2012-06-05 20:23:12 +02:00
Juan RP
c37026d4c6 libxbps: require an underscore in strings to detect correctly pkgname/version. 2012-06-05 10:58:39 +02:00
Juan RP
9441f9f14b libxbps: multiple random changes for overall performance increase. 2012-06-04 23:22:33 +02:00
Juan RP
fa73de309f libxbps: remove xbps_find_pkg_dict_from_plist_by_xxx (unused). 2012-06-04 21:34:21 +02:00
Juan RP
34c1269504 Fixed installing exact pkg versions on pkgs with hyphens, we use equal sign as delimiter now. 2012-06-03 07:26:48 +02:00
Juan RP
bd3a8982cc xbps-bin: added support to install exact pkg version, i.e 'foo-1.0'. 2012-06-02 17:35:21 +02:00
Juan RP
642e6fca3a xbps_rpool_sync: also fetch repository files index, removed accidently in previous. 2012-06-01 15:45:49 +02:00
Juan RP
981b13bd5a xbps-repo: 'sync' and 'pkg-list' target now accept a repository URI argument.
If set, only the matching repository will be used for the task.
2012-06-01 15:02:06 +02:00
Juan RP
652e9afcef libxbps: fixed xbps_remove_pkg_from_array_by_{name,pattern,pkgver}.
The correct index wasn't being passed to prop_array_remove.
2012-06-01 10:53:28 +02:00
Juan RP
7289547432 Welcome "repository index format 1.5". See NEWS for information. 2012-05-31 16:29:56 +02:00
Juan RP
27aacf97f4 xbps_file_exec: simplify and don't chroot when rootdir == /.
Before that change we were chroot(2)ing even when rootdir was set to /.
2012-05-30 17:44:39 +02:00
Juan RP
a94dd5dbfa Revert "libxbps: implement xbps_file_exec() with posix_spawn()."
This reverts commit 5aa05f4c72.
2012-05-30 17:26:25 +02:00
Juan RP
5aa05f4c72 libxbps: implement xbps_file_exec() with posix_spawn(). 2012-05-30 14:45:47 +02:00
Juan RP
f40759aabe libxbps: use same order strategy when checking for deps queued in transaction. 2012-05-30 12:54:28 +02:00
Juan RP
922ee1f1b6 libxbps: rename xbps_repository_pool_xxx to xbps_rpool_xxx. 2012-05-30 10:56:32 +02:00
Juan RP
da4b8b7427 rpool: improve the order while resolving dependencies.
See the NEWS file for more information. After that change you don't have
to set a virtual pkg in conf file, if required virtual pkg is in rpool.
2012-05-30 10:22:53 +02:00