Commit Graph

105 Commits

Author SHA1 Message Date
Juan RP
ec15af17a0 Update queue.h with latest NetBSD's version. 2011-01-30 15:08:57 +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
0277d5b103 Bump XBPS_RELVER for today's changes. 2011-01-29 17:16:25 +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
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
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
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
e4259c2889 xbps_api.h: fix xbps_register_pkg() doc. 2011-01-27 13:27:26 +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
Juan RP
628a6cebf7 Rename xbps_find_orphan_packages() to xbps_find_pkg_orphans(). 2011-01-27 12:19:05 +01:00
Juan RP
f06a605854 Implemented support for virtual packages.
The patch adds 150 lines approximately. It is implemented by modifying
xbps_find_pkg_in_dict_by_name() and xbps_find_pkg_in_dict_by_pattern().

When no dictionary is returned if tries to find a virtual package by
looking at the "provides" array object, if found.
2011-01-26 18:05:43 +01:00
Juan RP
082efc3535 Added xbps_callback_array_iter() and use it in xbps-bin to list missing pkgdeps. 2011-01-25 02:55:34 +01:00
Juan RP
61fbf17bb9 xbps_api.h: fix some comments. 2011-01-25 02:11:45 +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
7d3e17b86b Document xbps_humanize_number() in the API.
--HG--
branch : progress_callback
2011-01-22 14:37:07 +01:00
Juan RP
0cc4ba224e Update API documentation for recent changes.
--HG--
branch : progress_callback
2011-01-22 14:24:51 +01:00
Juan RP
984eae1578 Make xbps_fetch_file accept a callback to update its progress.
This also makes xbps_unpack_binary_pkg follow this convention by avoiding
static variables.

--HG--
branch : progress_callback
rename : bin/xbps-repo/util.c => bin/xbps-bin/util.c
2011-01-22 12:40:19 +01:00
Juan RP
8c2ccea435 WIP checkpoint for progress callbacks in the API.
At this moment I've only implemented the part for unpacking, other parts
will also use progress callbacks.

--HG--
branch : progress_callback
2011-01-21 17:16:58 +01:00
Juan RP
84b578b0e4 libxbps: modify xbps_get_binpkg_repo_uri() to accept repository URL as 2nd arg. 2011-01-20 16:41:49 +01:00
Juan RP
6f8b2ca33a libxbps: simplify how configuration files are handled, use cached values if possible. 2011-01-20 02:55:40 +01:00
Juan RP
3a303755c7 xbps_api.h: fix API comments for refcnts. 2011-01-19 11:32:20 +01:00
Juan RP
efea94bec6 Fixed API documentation comments for doxygen. 2011-01-19 00:31:22 +01:00
Juan RP
2adaf610e7 libxbps: xbps_yesno/noyes() are only used in xbps-bin(8), remove from API. 2011-01-18 23:45:12 +01:00
Juan RP
992e8c6a14 libxbps::xbps_humanize_number(): use common values and hide implementation details from API.
So now its prototype is the following:

int xbps_humanize_number(char *buf, int64_t bytes)

It is a wrapper around NetBSD's humanize_number(3) which uses 6 digits for max
length, HN_AUTOSCALE and HN_NOSPACE|HN_DECIMAL. All users have been updated.
2011-01-18 23:10:07 +01:00
Juan RP
fe15380e1b libxbps: modify the API, new func xbps_get_binpkg_repo_uri().
This function replaces xbps_repository_get_path_from_pkg_dict() and
xbps_get_binpkg_local_path(). It takes a pkg dictionary as returned
by a repository pkg index or a transaction dictionary and returns
a string with the full path to the binary pkg, either in local
repos, cachedir or remote repos.

Update all code to use this function... sorry I broke ABI compatiblity.
2011-01-18 18:21:55 +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
3482e68491 configure: make symbol visibility dependent in the configure test, misc changes. 2011-01-15 12:21:38 +01:00
Juan RP
2401e72b8a Remove DPRINTF macro, unused. 2010-12-03 17:30:02 +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
Juan RP
3b931475c0 Make xbps_read_dict_from_archive_entry() private to libxbps, as it's only used internally. 2010-11-10 15:08:21 +01:00
Juan RP
0584c01088 Better describe xbps_find_pkg_from_plist(). 2010-11-08 11:49:29 +01:00
Juan RP
c3afb4f4fb New function: xbps_get_pkg_dict_from_metadata_plist.
This function returns and internalized dictionary from a package's metadata
plist file as specified by its arguments.

Update all code to use it where appropiate.
2010-11-08 03:14:41 +01:00
Juan RP
25ebcd53f8 xbps_api.h: update comments for @private funcs. 2010-11-08 02:12:03 +01:00
Juan RP
679833156a Always release the object dictionary returned by xbps_find_pkg_dict_installed().
Document this in the public API header and update all code accordingly.
2010-11-08 02:02:35 +01:00
Juan RP
756a5ec654 xbps_api.h: improve description for some defs. 2010-11-08 00:50:19 +01:00
Juan RP
8ef8d86c12 Some changes for the XBPS libfetch's frontend code.
1) Raise the cache connection settings to more sane defaults (8->6, 16->2).
2) Introduce xbps_fetch_unset_cache_connection() to drop the caches.
2010-11-03 12:23:57 +01:00
Juan RP
d64815403e Increment XBPS_RELVER for 0.6.1. 2010-10-23 18:12:54 +02:00
Juan RP
4b8f85382e Bump XBPS_RELVER for changes that will go to 0.6.0. 2010-06-02 23:50:44 +02:00
Juan RP
eb645d2974 xbps_api.h: do not rely on sys/cdefs.h, fix up some comments. 2010-05-20 04:49:53 +02:00
Juan RP
8f20f4c0c6 libxbps: use OpenSSL SHA256, 5x faster xbps_get_file_hash() implementation.
* libxbps: improved xbps_get_file_hash() to mmap(2) rather than read(2)
  the file we have to process. With mmap'ed files the hash can be
  processed 5x faster than before, or even more in some cases.

* libxbps: switch to OpenSSL SHA256 implementation and remove the one
  previously used. It's faster and OpenSSL is required for libfetch so
  there is not point in using it.
2010-05-20 02:43:56 +02:00
Juan RP
f888b582f9 Added a configure script to emulate GNU autoconf and related changes.
Changes included in this set:

 * Added strlcat() and strlcpy() from OpenBSD, always use them if the
   system does not have them built in.
 * Changed an array of PATH_MAX size allocated in the stack, to a dynamically
   allocated buffer from heap. This should reduce memory usage a bit.
 * Simplify code that implemented a homegrown realpath(3) implementation,
   simply use realpath(3).
 * If compiler supports -fstack-protector, build all code with
   -D_FORTIFY_SOURCE=2 and --param ssp-buffer-size=1 so that all
   buffers are protected.
2010-05-19 22:38:27 +02:00
Juan RP
c4e9d86630 libxbps::xbps_remove_obsoletes(): reset a var to 0 in non fatal errors! 2010-05-18 15:33:27 +02:00
Juan RP
bb220904b7 Bump XBPS_RELVER. 2010-05-18 13:41:51 +02:00
Juan RP
76ca32e76f libxbps: some random bugfixes.
* libxbps: while running INSTALL/REMOVE scripts, do not fail if a script
  returns ENOENT but the script exists; that means the script did not match
  the expected action on its switch statement and the fact can be simply
  ignored.

* libxbps: while upgrading packages and searching for obsolete files,
  do not remove the files that did not match previous SHA256 hash. Also,
  only remove obsolete dangling symlinks.
2010-05-18 07:46:27 +02:00
Juan RP
e22df5580b Bump XBPS_RELVER for last change. 2010-05-11 13:47:14 +02:00
Juan RP
17b7651137 libxbps: change the epoch char to ':' to differentiate the starting char in pkgname.
Added xbps_get_pkg_epoch(), to get the epoch version string.
2010-05-11 13:38:35 +02:00
Juan RP
b77bebe03a xbps_repository_register(): if repository already exists return EEXIST.
Bump XBPS_RELVER to 20100427.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100427160125-3vid17cb7fy4v3gd
2010-04-27 18:01:25 +02:00
Juan RP
9d4f44b776 Bump XBPS_RELVER to 20100420 for compressed gzip plist files support.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100420130449-wym9iuth418ysehp
2010-04-20 15:04:49 +02:00