Commit Graph

204 Commits

Author SHA1 Message Date
3acf91bb15 xbps-bin: unpack_progress_cb_verbose printf to stdout for consistency. 2011-02-21 13:53:08 +01:00
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
078f9f1cda Fixed finally another real case when updating and replacing pkgs. 2011-02-18 16:39:42 +01:00
b90c815e80 Minor nits to the xbps-{bin,repo}.8 manpages. 2011-02-05 17:32:14 +01:00
d5c2a3266f Rename the transaction object key to "transaction" rater than "trans-action". 2011-02-05 12:21:04 +01:00
14d3fe8aa7 xbps-bin: shorter informative messages for transactions. 2011-02-05 11:47:02 +01:00
2e140cde7b xbps-bin.8: fix typo. 2011-02-05 11:29:18 +01:00
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
d25bc35711 xbps-bin::show_pkg_info() remove useless prop_object_type_t member. 2011-02-04 18:00:47 +01:00
097b50b3c2 Fix all warnings found by clang analyzer as reported by ojab in issue 3. 2011-02-03 17:49:43 +01:00
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
fca3d6b9bf Use xbps_{error,warn}_printf() everywhere. 2011-01-30 18:23:33 +01:00
243685507a xbps-bin: some cosmetic informative printfs. 2011-01-30 12:40:16 +01:00
89faf75db4 xbps-bin/remove.c: fix some comments. 2011-01-30 12:12:49 +01:00
f27b7557bc xbps-bin: there's no need to add objs in inverted order for -R. 2011-01-30 08:22:58 +01:00
7da33469cc xbps-bin(8): added -R option to recursively remove pkgs that were instaled automatically. 2011-01-30 08:08:34 +01:00
03b1b254cc xbps-bin::check.c: reset a var to avoid false positives. 2011-01-28 12:18:17 +01:00
080334da8b xbps-bin: make 'list' target without arguments to only show pkgs in "installed" state. 2011-01-27 14:45:40 +01:00
255f229a78 xbps-bin.8: fix a typo. 2011-01-27 14:44:39 +01:00
c952337fd4 xbps-bin(8): added -D option to only show the URL to download binary packages. 2011-01-27 14:36:33 +01:00
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
628a6cebf7 Rename xbps_find_orphan_packages() to xbps_find_pkg_orphans(). 2011-01-27 12:19:05 +01:00
bc259ae720 xbps-{bin,repo}: use static const tables to parse objs in XBPS_PKGPROPS files. 2011-01-26 16:34:26 +01:00
ada7820312 xbps-bin: reset some static vars for correct indentation in output. 2011-01-25 17:52:04 +01:00
be5ff1d934 Don't build code with _GNU_SOURCE, use _XOPEN_SOURCE=500 instead.
_GNU_SOURCE is only now for xbps_xasprintf() if vasprintf is found,
and only for <stdio.h>, it's unset immediately once the header is included.
2011-01-25 13:00:23 +01:00
fd30feadcb xbps-bin/check.c: save some lines by using prop_object_type() directly. 2011-01-25 03:33:51 +01:00
082efc3535 Added xbps_callback_array_iter() and use it in xbps-bin to list missing pkgdeps. 2011-01-25 02:55:34 +01:00
6b4c6970a3 xbps-bin/question.c: use sizeof(). 2011-01-24 19:26:52 +01:00
72d82a3a26 Simplify and share common code in xbps_repository_{update,install}_pkg(). 2011-01-24 18:49:24 +01:00
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
81b6b62aef xbps-bin/fetch.c: use else if conditionals.
--HG--
branch : progress_callback
2011-01-22 13:08:36 +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
84b578b0e4 libxbps: modify xbps_get_binpkg_repo_uri() to accept repository URL as 2nd arg. 2011-01-20 16:41:49 +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
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
6051eb29ab Added another bunch of compiler warnings and fix code. 2011-01-15 11:59:44 +01:00
57453d1926 xbps-{bin,repo}: use strlcpy(). 2010-12-24 05:31:37 +01:00
a7886f62db xbps-bin: fix a memleak in the 'find-files' target. 2010-12-24 05:21:22 +01:00
4f6e20c431 xbps-bin: zero out allocated mem to avoid garbage in the 'list' target. 2010-12-04 10:30:01 +01:00
237991fd79 xbps-bin: added -F flag for the remove target.
Unless it's set, packages that are dependencies of other installed packages
won't be removed. This flag overrides this behaviour and forces the package removal.

While being here, misc cleanups.
2010-12-03 17:36:07 +01:00
b3c8a8ef5c Backed out changeset e82cc0e4b779
Otherwise the refcount in repository pool will initialize/release on every op.
2010-11-25 21:33:14 +01:00
c7f6f9f44a xbps-bin: there's no need to init repository pool. 2010-11-25 16:23:49 +01:00
2c72c81db0 xbps-bin: always check if the there are missing deps regardless of the errno value. 2010-11-25 10:58:44 +01:00
278a37a24a xbps-bin: fix for previous. 2010-11-24 16:39:14 +01:00
940e077fb4 Improvements for xbps-{bin,repo}.
- Indent properly with the longest "pkgver" object while listing or searching
  for packages.
- Also match strings in the short description object while searching for
  packages in xbps_repo.
2010-11-24 16:37:30 +01:00
d2be842ce5 Fix and improve when there are missing deps in the transaction dictionary. 2010-11-23 23:17:04 +01:00