Commit Graph

458 Commits

Author SHA1 Message Date
7d3e17b86b Document xbps_humanize_number() in the API.
--HG--
branch : progress_callback
2011-01-22 14:37:07 +01:00
0cc4ba224e Update API documentation for recent changes.
--HG--
branch : progress_callback
2011-01-22 14:24:51 +01:00
81b6b62aef xbps-bin/fetch.c: use else if conditionals.
--HG--
branch : progress_callback
2011-01-22 13:08:36 +01:00
9611f3e412 xbps_unpack_binary_pkg: rename fn callback arg to be shorter.
--HG--
branch : progress_callback
2011-01-22 12:56:33 +01:00
724c4a6f0a Added fetch.c for xbps-bin, with the fetch function callback.
--HG--
branch : progress_callback
2011-01-22 12:40:58 +01:00
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
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
ab857595d7 Check that return value of snprintf(3) is not negative, rather than only -1. 2011-01-21 00:32:46 +01:00
84b578b0e4 libxbps: modify xbps_get_binpkg_repo_uri() to accept repository URL as 2nd arg. 2011-01-20 16:41:49 +01:00
6f8b2ca33a libxbps: simplify how configuration files are handled, use cached values if possible. 2011-01-20 02:55:40 +01:00
0a66dbea5f NEWS: update with past days changes. 2011-01-19 17:17:39 +01:00
fcbe7f113b Don't build static bins with PIE, only for dynamic. 2011-01-19 16:52:55 +01:00
8dc6926664 configure: fixes for building with an installed static libxbps. 2011-01-19 14:45:58 +01:00
274c8c432b lib/Makefile: build libxbps with --export-dynamic. 2011-01-19 14:31:30 +01:00
3a303755c7 xbps_api.h: fix API comments for refcnts. 2011-01-19 11:32:20 +01:00
efea94bec6 Fixed API documentation comments for doxygen. 2011-01-19 00:31:22 +01:00
2adaf610e7 libxbps: xbps_yesno/noyes() are only used in xbps-bin(8), remove from API. 2011-01-18 23:45:12 +01:00
0a8fabbfac xbps-bin: remove spurios chars in two printf()s. 2011-01-18 23:42:51 +01:00
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
e2b55c90be regpkgdb_dictionary.c: bump copyright year for previous changes. 2011-01-18 20:21:35 +01:00
9180bfce23 libxbps: regpkgdb: use a mutex for {inc,dec}rementing the refcnt. 2011-01-18 20:18:27 +01:00
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
6d7121c5bd xbps_repository_get_pkg_plist_dict: use xbps_repository_pool_find_pkg(). 2011-01-18 15:19:27 +01:00
8e0a94d5cc xbps-repo: use xbps_repository_pool_find_pkg(). 2011-01-18 14:57:25 +01:00
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
1125963da8 libxbps: simplify the algorithm for sorting deps in the transaction.
Rather than using a SIMPLEQ to copy the package dictionary and later on
adding all items into the sorted array, just add the pkg dictionary
into the sorted array directly and removing it from the unsorted array.

This reduces memory usage and greatly sorts all packages that aren't
installed automatically in the correct order in the transaction.

Also added a large comment explaining how the algorithm works and
what it is supposed to do and when.
2011-01-17 17:17:02 +01:00
2845f49bf2 Added tag 0.7.3 for changeset b373dfd04ef2 2011-01-16 17:08:24 +01:00
d9fa6da693 NEWS, Changelog: update for 0.7.3. 2011-01-16 17:07:43 +01:00
3c4b375ecf Fixed a test in config file handling that made all conf_files not properly detected. 2011-01-16 16:55:01 +01:00
0fe503b7f4 configure: -Wformat-security and -Wformat-nonliteral are included in -Wformat=2. 2011-01-15 14:02:34 +01:00
de590b8457 lib/Makefile: build -Wno-error for included libfetch for now. 2011-01-15 13:37:16 +01:00
84f04fb6c4 configure: build with -O2 and -pipe if supported. 2011-01-15 13:36:46 +01:00
3482e68491 configure: make symbol visibility dependent in the configure test, misc changes. 2011-01-15 12:21:38 +01:00
6051eb29ab Added another bunch of compiler warnings and fix code. 2011-01-15 11:59:44 +01:00
d9001adbad configure: added --silent option to hide compilation details. 2011-01-15 10:49:35 +01:00
4420bd9427 Really enable the compiler detected flags into its correct var. 2011-01-15 10:41:35 +01:00
33c1a33912 Make configure detect required libraries to link. 2011-01-14 00:30:49 +01:00
57af8f9ee0 xbps_repository_get_pkg_plist_dict: avoid uninitialized var. 2011-01-12 17:15:23 +01:00
2206b27037 Added "--with-external-libfetch" to build against external libfetch. 2011-01-12 17:06:53 +01:00
cb8464bdc6 configure: respect CFLAGS/LDFLAGS passed via env. 2011-01-11 15:04:23 +01:00
2bd1629177 Update to 0.7.2. 2010-12-28 12:15:11 +01:00
7341920338 Added tag 0.7.2 for changeset 25a675190b31 2010-12-28 12:15:01 +01:00
d307226ee7 xbps_unpack_binary_pkg: fix a memleak and make all error paths go to a single point. 2010-12-25 02:38:30 +01:00
71878669da libxbps: fix a memleak when removing obsolete files in pkg upgrades. 2010-12-25 02:37:25 +01:00
057deb180c xbps-repo: report the errno string when a repository cannot be added and fix a NULL pointer deref. 2010-12-25 02:35:11 +01:00
5b101eae2b xbps-repo: fix a memleak in the 'add' target. 2010-12-24 05:43:00 +01:00
57453d1926 xbps-{bin,repo}: use strlcpy(). 2010-12-24 05:31:37 +01:00
45b4fada3d xbps-repo: fix a memleak in the 'show' target. 2010-12-24 05:29:39 +01:00
f2c33b0b08 xbps-repo: fix a memleak in the 'find-files' target. 2010-12-24 05:21:49 +01:00
a7886f62db xbps-bin: fix a memleak in the 'find-files' target. 2010-12-24 05:21:22 +01:00