Commit Graph

274 Commits

Author SHA1 Message Date
Juan RP
511dbffa9e Simplify find_pkg_in_array(). 2011-02-21 23:21:53 +01:00
Juan RP
bdfa81c29d package_unpack.c: fix a comment. 2011-02-21 17:57:46 +01:00
Juan RP
870ad18d58 xbps_init() now sets rootdir, cachedir and flags.
That means that the following functions were removed:
	- xbps_set_{cachedir,flags,rootdir}.
	- xbps_get_{cachedir,flags,rootdir}.

With this change fixed an obvious typo that made -c argument to not work,
and now the cache directory is an absolute path not relative to rootdir.
2011-02-21 17:42:47 +01:00
Juan RP
afe0f3e2f0 Make the xbps_handle struct const internally. 2011-02-21 14:03:08 +01:00
Juan RP
22ae7aa2e8 Introduce struct xbps_handle and use it for xbps_init().
This structure sets up function callbacks for fetching files and
unpacking binary packages, as well as setting the debug boolean.

This way the affected functions (xbps_fetch_file() and
xbps_unpack_binary_pkg()) do not need to accept the fn cb pointers
and data as arguments.

Bump XBPS_RELVER.
2011-02-21 13:38:44 +01:00
Juan RP
078f9f1cda Fixed finally another real case when updating and replacing pkgs. 2011-02-18 16:39:42 +01:00
Juan RP
8b58b88a5f xbps_repository_{install,update}_pkg: fixed a stupid logic error. 2011-02-18 16:37:16 +01:00
Juan RP
032f993a53 xbps_repository_pool_init: do not fail to internalize all repos when the first one fails.
If the first registered repo couldn't be internalized, all other repositories
were also failing because it returned error, so simply skip them and return
error when all them cannot be internalized.
2011-02-17 09:24:57 +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
8803bfd7d8 Move plist find/remove functions into its own files. 2011-02-05 12:06:03 +01:00
Juan RP
f4cdbaf17d Move xbps_read_dict_from_archive_entry() and friends into its own file. 2011-02-05 11:57:13 +01:00
Juan RP
de296d8192 Added the concept of package properties in the API.
See the NEWS file and xbps-bin(8) for more information.
2011-02-05 11:25:04 +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
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
0a26497b50 xbps_repository_update_allpkgs: return ENOENT if regpkgdb dict cannot be internalized. 2011-02-03 09:34:38 +01:00
Juan RP
692caea1cd xbps_get_pkg_state_*: if state object is not available return EINVAL. 2011-02-02 09:53:56 +01:00
Juan RP
927d7e0c5d xbps_repository_find_pkg_deps: improve a debug printf. 2011-02-01 17:32:25 +01:00
Juan RP
0e38b649ff xbps_get_pkg_state_installed: if pkg dictionary is not found return ENOENT. 2011-02-01 17:30:59 +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
da607becf9 Make some xbps_warn_printf dependent of XBPS_FLAG_VERBOSE. 2011-01-30 18:38:16 +01:00
Juan RP
5c7eaf2f92 xbps_warn_printf: fix previous and remove unused var. 2011-01-30 18:32:15 +01:00
Juan RP
42eb834e8d xbps_warn_printf: always print regardless of XBPS_FLAG_VERBOSE. 2011-01-30 18:31:36 +01:00
Juan RP
e04f167d09 xbps_repository_pool_foreach: use SIMPLEQ_FOREACH_SAFE. 2011-01-30 15:09:18 +01:00
Juan RP
bdd48de67d xbps_sort_pkg_deps: use TAILQ_FOREACH_SAFE. 2011-01-30 14:42:17 +01:00
Juan RP
2492d98d13 xbps_purge_pkg: chdir to rootdir, check that REMOVE file exists and is executable. 2011-01-30 12:49:55 +01:00
Juan RP
b6b3bd799b xbps_purge_pkg: execute the "purge" action in REMOVE script (if found).
This replaces code for removing all directories installed by the
package and instead let's the package do whatever is ok in the REMOVE
script by executing the "purge" action.
2011-01-30 11:32:46 +01:00
Juan RP
7da33469cc xbps-bin(8): added -R option to recursively remove pkgs that were instaled automatically. 2011-01-30 08:08:34 +01:00
Juan RP
bb897da7b4 Fix an assertion. 2011-01-30 00:14:29 +01:00
Juan RP
de034c28f5 xbps_find_pkg_orphans: simplify even more. 2011-01-29 18:34:50 +01:00
Juan RP
5bbbb3c8fd xbps_find_pkg_in_*: search for virtual pkg before the real one. 2011-01-29 17:57:01 +01:00
Juan RP
8d6eab5ac1 xbps_remove_obsoletes: make xbps_printf conditionalized with XBPS_FLAG_VERBOSE. 2011-01-29 16:26:17 +01:00
Juan RP
d7bafff252 xbps_requiredby_pkg_{add,remove}: simplify and make them aware of virtual pkgs. 2011-01-29 12:29:30 +01:00
Juan RP
241751f1b7 Added three new helper functions to the API.
xbps_find_pkg_in_array_by_name
xbps_find_pkg_in_array_by_pattern
xbps_remove_pkgname_from_array
2011-01-29 12:28:23 +01:00
Juan RP
298305c1d5 Make some xbps_printf()s conditioned on XBPS_FLAG_VERBOSE. 2011-01-29 01:55:52 +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
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
f7f3cfcb9c Performance improvements for xbps_find_pkg_in_dict_by_* and xbps_find_*_in_array(). 2011-01-28 12:11:43 +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
176f5e3e40 xbps_sort_pkg_deps: use xbps_check_is_installed_pkg_by_name(). 2011-01-27 20:54:23 +01:00
Juan RP
1cc45ee20f Fix two asserts. 2011-01-27 20:47:34 +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
faad0a6597 Make xbps_remove_pkg_from_* use shared code, and add another variant.
The functions have been renamed to really match what they do.
2011-01-27 18:22:57 +01:00
Juan RP
93e1a0a22c Performance improvements for xbps_find_pkg_in_dict_by_{name,pattern} with virtual pkgs. 2011-01-27 15:50:50 +01:00
Juan RP
1c21a98545 Rename some symbols in repository_plist.c.
xbps_repository_get_pkg_plist_dict_from_url -> xbps_repository_plist_find_pkg_dict_from_url
xbps_repository_get_pkg_plist_dict -> xbps_repository_plist_find_pkg_dict
2011-01-27 13:53:33 +01:00
Juan RP
6e8e5b830e repository_register.c: fix doxygen @file mark. 2011-01-27 12:44:32 +01:00
Juan RP
69512d4da7 Rename xbps_find_pkg_from_plist to xbps_find_pkg_dict_from_plist_by_name. 2011-01-27 12:41:49 +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