Commit Graph

42 Commits

Author SHA1 Message Date
Juan RP
4057e4961c Use C99 for loop initializers.
That means that a C99 compiler is now mandatory.
2013-09-15 10:06:49 +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
9d80524a34 Minor optimization: no need to check if obj is NULL, prop_object_type() does that already. 2013-06-14 12:22:29 +02:00
Juan RP
db1efb3aa6 Relax memory requirements on 64bit platforms; fix two memleaks. 2013-06-12 10:04:10 +02:00
Juan RP
1741019b90 lib/transaction_sortdeps.c: remove bogus assignment in pkgdep_release(). 2013-04-04 09:57:59 +02: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
8c84e22b94 xbps_transaction_sort: do not sort removed pkgs; just add them to head. 2012-12-01 08:10:15 +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
d6735d5685 xbps_xasprintf: do not return NULL anymore; remove checks for this. 2012-11-11 09:37:27 +01: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
ebc0f27ae1 Do not add to the queue a pkgdep that has been already added via a vpkg.
The problem was after merging udev into systemd, udev is now a virtual pkg
and another dependency was requiring it and added systemd (real pkg) to
the list, but later in the sorting phase systemd was added again breaking
the dependency order.
2012-10-06 10:34:29 +02:00
Juan RP
c158acefac Revert "transaction: keep last dep and remove dup matches while sorting deps."
This reverts commit b764f8e19a.
2012-10-06 10:01:37 +02:00
Juan RP
b764f8e19a transaction: keep last dep and remove dup matches while sorting deps.
This bug has been uncovered due to udev -> systemd merge.
2012-10-06 09:21:26 +02:00
Juan RP
e879c71a02 transaction_sortdeps: check if dep is installed by pattern. 2012-07-04 11:55:51 +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
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
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
a3adbcda95 libxbps: use prop_array_get_cstring_nocopy(). 2012-06-13 09:23:48 +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
8e0612bb46 A bugfix while sorting dependencies in a transaction (thanks dave). 2012-03-30 01:39:13 +02:00
Juan RP
a166d6a2a3 Simplify xbps_transaction_prepare()/commit() and related API changes.
- xbps_handle::transd -> new member with transaction dictionary.
- xbps_transaction_prepare: returns an int.
- xbps_transaction_commit: doesn't need any arg now.
- xbps_repository_pool_sync: doesn't need any arg now.
- xbps_pkgdb_update: removed xbps_handle * arg.
- xbps_transaction_missingdeps_get: removed, missing_deps array is in
  xbps_handle::transd("missing_deps") array object.
2012-01-22 10:00:46 +01:00
Juan RP
3ccfec7054 Improved callback/states support to make libxbps std{err,out} printf free.
This is a major API/ABI change, documentation has been updated accordingly.
2011-11-24 11:23:08 +01:00
Juan RP
eae6bf8ab4 libxbps: when sorting deps, add removed pkgs to head. 2011-10-20 13:10:39 +02:00
Juan RP
12af2370da libxbps: separate virtualpkg conf stuff from repository_pool_find_pkg.
Now to find a virtualpkg set by the user in conf file, there is a new
function: xbps_repository_pool_find_virtualpkg(). Use it in some
places to make jpeg -> libjpeg-turbo (and other pkgs that can be
replaced with other virtual pkgs) work correctly even if installed
multiple times.
2011-10-16 12:22:46 +02:00
Juan RP
d3e1c0dcf2 libxbps: when sorting deps take into account transaction reason. 2011-10-15 20:00:41 +02:00
Juan RP
33d6d2e166 libxbps: API/ABI break changes to fix issues with virtual packages.
Please see the NEWS file for info about this commit.
2011-07-15 18:22:58 +02:00
Juan RP
f0745120f6 Fix sorting algorithm to add same pkgs with different transaction reasons. 2011-06-25 22:53:16 +02:00
Juan RP
9673c4bd09 XBPS major changes in June 2011.
- A configuration file "xbps-conf.plist" replaces the (un)register target
  in xbps-repo(8) and (un)set-prop in xbps-bin(8). For now, you can set
  the repositories and prefered virtual packages.

- New package pattern matching code from NetBSD. Supports more ways of
  matching patterns in packages.

- Multiple bugs fixed in virtual packages related matching code.

--HG--
rename : LICENSE => COPYING
2011-06-04 13:37:53 +02:00
Juan RP
841c9e2d51 API/ABI break for June 2011.
Rename some functions to reflect its description a bit better.

--HG--
rename : lib/repository_plist.c => lib/plist_fetch.c
2011-06-01 09:37:32 +02:00
Juan RP
078f9f1cda Fixed finally another real case when updating and replacing pkgs. 2011-02-18 16:39:42 +01:00
Juan RP
ec7549fa04 xbps_sort_pkg_deps: change an assertion into a real check. 2011-02-04 16:17:47 +01:00
Juan RP
bdd48de67d xbps_sort_pkg_deps: use TAILQ_FOREACH_SAFE. 2011-01-30 14:42:17 +01:00
Juan RP
463d182c49 When sorting packages also look for virtual packages.
A new function xbps_find_virtual_pkg_in_dict() has been made public
to the API to make this find duplicate packages in the transaction
when updating packages.
2011-01-28 20:56:28 +01:00
Juan RP
6e26332a2e A really faster dependency sorting algorithm, 60% faster approx!
Benchmarks before and after the code for installing
"xorg gnome xbmc vlc firefox epdfview":

OLD
-----------------
real	0m1.844s
user	0m1.841s
sys	0m0.003s

NEW
-----------------
real	0m0.873s
user	0m0.868s
sys	0m0.004s
2011-01-28 19:47:05 +01:00
Juan RP
176f5e3e40 xbps_sort_pkg_deps: use xbps_check_is_installed_pkg_by_name(). 2011-01-27 20:54:23 +01:00
Juan RP
26701d3bf3 Rename a few symbols for clarity.
xbps_check_is_installed_pkg -> xbps_check_is_installed_pkg_by_pattern
xbps_check_is_installed_pkgname -> xbps_check_is_installed_pkg_by_name
xbps_check_is_repo_string_remote -> xbps_check_is_remote_uri_remote
2011-01-27 12:34:13 +01:00
Juan RP
22d67bcfb9 Improve comments for dependency sorting. 2011-01-26 18:57:29 +01:00
Juan RP
a685c9ee41 xbps_sort_pkg_deps: exit from the loop immediately if all pkgs were sorted. 2011-01-25 16:04:37 +01:00
Juan RP
a47d030851 xbps_sort_pkg_deps: optimize one more time, it is 5% faster approx. 2011-01-25 14:56:37 +01:00
Juan RP
0bb0838982 Start moving code from repository_find* to transaction_*.
--HG--
rename : lib/sortdeps.c => lib/transaction_sortdeps.c
2011-01-24 16:55:58 +01:00