Commit Graph

59 Commits

Author SHA1 Message Date
Juan RP
5c0abc9754 libxbps: remove old code and return early if pkg has no rundeps. 2012-11-15 01:37:09 +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
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
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
c61ba8dfcc Added support for package conflicts. 2012-06-11 16:14:03 +02:00
Juan RP
9441f9f14b libxbps: multiple random changes for overall performance increase. 2012-06-04 23:22:33 +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
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
Juan RP
a5f4848d0b Use best pkg available when resolving required dependencies. 2012-03-28 12:01:59 +02:00
Juan RP
af593500c3 Fix a couple of issues resolving deps with virtual packages. 2012-03-24 09:21:28 +01:00
Juan RP
ca03127a82 Revert "xbps_match_any_virtualpkg_in_rundeps: break correctly from inner loop on match."
This reverts commit 31b1975b1e.

Revert experimental changes to repository_finddeps.c.
2012-03-11 17:16:58 +01:00
Juan RP
31b1975b1e xbps_match_any_virtualpkg_in_rundeps: break correctly from inner loop on match. 2012-03-11 17:15:49 +01:00
Juan RP
dc61fbed0e libxbps: match required pkgdep by virtual pkg in a transaction. 2012-02-28 20:39:10 +01:00
Juan RP
abb0d260b9 xbps-bin: the install target gains suppor for installing best pkg available. 2012-01-25 02:14:04 +01:00
Juan RP
49baad48f4 Fixed module-init-tools->kmod update as reported by davehome.
The problem was that required package dependency was installed, but
the version didn't satisfy the requirement and the code unconditionally
assumed an updated existed in repository pool. Now the code checks
package state to set transaction reason.
2012-01-24 18:45:50 +01:00
Juan RP
791f1d40b2 xbps_handle: remove debug, install_*, syslog_enabled members.
Replaced by definitions that can be set to xbps_handle::flags.
2012-01-22 10:52:35 +01: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
dfc7ff4232 API break: simplify xbps_repository_pool_find_virtualpkg(). 2012-01-18 08:25:28 +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
b8c804e891 Check for obj validity with prop_object_type(), use xbps_pkg_has_rundeps(). 2011-10-31 09:48:46 +01:00
Juan RP
f35e1eff42 libxbps: improve debugging messages while looking for pkgs in repos. 2011-10-30 16:41:39 +01:00
Juan RP
43ab2ec083 libxbps: fixed a bug with virtualpkgs as dependencies in a transaction. 2011-10-27 10:54:28 +02:00
Juan RP
51b45a0d08 libxbps: improve code to match replaced package patterns.
The replaces code now checks all package dictionaries in the
transaction dictionary, and the sorting algorithm will put packages
to be removed at the head of the tailq.

This should fix issue 11 in googlecode.
2011-10-20 14:39:58 +02:00
Juan RP
9fb3c38aa2 Extend assertions by checking passed in proplib type. 2011-10-19 16:53:38 +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
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
9468520e69 libxbps: fixed a bug in virtual pkg handling.
When resolving dependencies it didn't take into account virtual packages
in some cases.
2011-06-23 11:30:04 +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
d9eb0341cd Some dead stores and build fixes reported by LLVM 2.9. 2011-04-07 12:24:20 +02:00
Juan RP
8baad7b5da Simplify setting pkg state in transaction's dictionary. 2011-02-23 17:14:33 +01:00
Juan RP
d5c2a3266f Rename the transaction object key to "transaction" rater than "trans-action". 2011-02-05 12:21:04 +01:00
Juan RP
097b50b3c2 Fix all warnings found by clang analyzer as reported by ojab in issue 3. 2011-02-03 17:49:43 +01:00
Juan RP
927d7e0c5d xbps_repository_find_pkg_deps: improve a debug printf. 2011-02-01 17:32:25 +01:00
Juan RP
fdc496e8f1 Added xbps_repository_pkg_replaces() to handle pkg "replaces" in the transaction.
The frontend (in that case xbps-bin(8)) is only responsible to remove
those packages that have the "trans-action" string object set to "remove".
2011-02-01 01:21:54 +01:00
Juan RP
af5d3a0653 xbps_repository_find_pkg_deps: do not recurse more than MAX_DEPTH times, return ELOOP. 2011-01-28 12:12:47 +01:00
Juan RP
4438fd1183 xbps_repository_find_pkg_deps: simplify even more and remove dead code. 2011-01-27 21:54:55 +01:00
Juan RP
bebad82316 repository_finddeps.c: remove useless code. 2011-01-27 21:12:42 +01:00
Juan RP
c58107bd27 xbps_repository_find_pkg_deps: fix stupid error by reusing a var. 2011-01-27 21:02:56 +01:00
Juan RP
8a7bfe6cda xbps_repository_find_pkg_deps: simplify and handle an error case. 2011-01-27 18:23:32 +01:00
Juan RP
ac6fe51340 xbps_repository_find_pkg_deps: some performance optimizations. 2011-01-25 18:09:27 +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
Juan RP
503afdd48d libxbps: extend the API, new func: xbps_repository_pool_find_pkg.
prop_dictionary_t xbps_repository_pool_find_pkg(const char *pkg, bool bypattern, bool best)

This function iterates over the repository pool and returns a pkg
dictionary matching its pkgname if "bypattern" is false, otherwise
if "pkg" matches the pkgdep pattern. If "best" is true, it will look
in all repos and will return the newer version, otherwise the first one
that matches the arguments specified.

With this addition supporting many small registered repos is cheap, because
it checks by-package rather than by-package-list. This also helped to removed
some duplicated code and fix some rare bugs.

Bump XBPS_RELVER to 20110118.
2011-01-18 14:44:39 +01:00
Juan RP
d2be842ce5 Fix and improve when there are missing deps in the transaction dictionary. 2010-11-23 23:17:04 +01:00
Juan RP
fdec663855 API clean up (part 2), plus misc changes and improvements.
- Rename regpkgs_dictionary to regpkgdb_dictionary to better describe what is is.
- Change some funcs in plist.c to return a boolean rather than int.
- Hide more internal funcs off the API.
- Simplify xbps_repository_update_pkg() and remove its second arg.
- Hide implementation details in xbps_repository_pool, now to iterate over the
  pool you have to use xbps_repository_pool_foreach and its struct
  repository_pool_index.
- Introduce xbps_{init,end}, to initialize/destroy some stuff in the library.
- Introduce xbps_dbg_printf to printf stuff for debugging purposes.
- xbps-{bin,repo}:  added -d arg to enable debugging output.
- Before checking if a config file needs to be installed or such, check that
  package contains the "conf_files" array.
- Remove obsolete dirs as well while updating packages.
- If transaction dictionary is ready remove the "missing_deps" array.

Bump XBPS_RELVER to 20101118.

--HG--
rename : lib/regpkgs_dictionary.c => lib/regpkgdb_dictionary.c
2010-11-19 13:40:13 +01:00
Juan RP
ffc255b715 Starting to clean up the public API, move private stuff into xbps_api_impl.h. 2010-11-13 03:18:58 +01:00