Commit Graph

348 Commits

Author SHA1 Message Date
Juan RP
5aa05f4c72 libxbps: implement xbps_file_exec() with posix_spawn(). 2012-05-30 14:45:47 +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
f7f4e0bec0 Extend 'soft replace' and also remove obsolete files. 2012-05-25 22:44:58 +02:00
Juan RP
da9b6774c3 Fix previous: propagate "softreplace" obj to pkg being replaced. 2012-05-25 17:58:36 +02:00
Juan RP
6a4de0127d libxbps: introduce the concept of "soft replace"; see the NEWS file. 2012-05-25 17:24:36 +02:00
Juan RP
d075f7182a When removing pkg files, remove only dangling symlinks after regular files.
This is required for the upcoming eglibc package.
2012-05-25 14:31:42 +02:00
Juan RP
9acec7883b xbps_remove_pkg: do not error out if files.plist not found, just continue. 2012-05-21 23:03:29 +02:00
Juan RP
28767f2ea8 Added support to put packages "on hold". 2012-05-08 09:19:43 +02:00
Juan RP
5e0b06dc00 xbps-bin: improve def unpack cb to print more meaningful messages. 2012-05-06 16:48:47 +02:00
Juan RP
8a4b143bf3 Show a proper error message if download of a binpkg fails in a transaction. 2012-05-06 09:09:09 +02:00
Juan RP
83bda174ab libxbps: make xbps_find_virtualpkg_* only look for virtual pkgs.
Before this commit they also looked for non virtual packages, which
is not what it was meant when those functions were added.
2012-04-12 11:57:21 +02:00
Juan RP
bfe7ab1c5a xbps_configure_pkg: simplify and remove "version" arg (API change).
The "version" argument (being optional) clearly is not needed and it
can be fully removed. This simplifies the internal implementation as well
as the API.
2012-04-10 10:02:27 +02:00
Juan RP
ef6d1adf91 xbps_set_pkg_state_installed: simplify (API change).
The third optional argument "pkgver" clearly is useless because we can
create it internally with "pkgname" and "version" arguments instead.

Also make the "version" argument mandatory.
2012-04-10 09:43:59 +02:00
Juan RP
732ce45b86 libxbps: new function xbps_pkgdb_get_pkgd_by_pkgver().
Finds a pkg dictionary in pkgdb by matching its pkgver object.
2012-04-05 10:57:15 +02:00
Juan RP
feacc506de When reinstalling existing pkgs, remove previous entry in pkgdb's requiredby. 2012-04-04 10:20:29 +02:00
Juan RP
8e0612bb46 A bugfix while sorting dependencies in a transaction (thanks dave). 2012-03-30 01:39:13 +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
e698acf440 Make xbps_find_virtualpkg_conf_xxx private again, unused in test suite now. 2012-03-13 11:37:50 +01:00
Juan RP
9bada162a1 New "metadir" member in xbps_handle to override default metadata dir. 2012-03-13 10:22:35 +01:00
Juan RP
749e03aa29 Make xbps_find_virtualpkg_conf_in_xxx_by_xxx part of the API and add kyua tests. 2012-03-12 17:51:50 +01:00
Juan RP
715990a1e5 Make xbps_find_virtualpkg_in_dict_by_xxx part of the API and add kyua tests. 2012-03-12 16:36:46 +01:00
Juan RP
35c2e2a75d Enable assertions by default, even with --debug disabled. 2012-03-12 11:22:18 +01:00
Juan RP
06745b70ae Fixed issue 22: always set perms from binpkg to existing files while unpacking. 2012-03-07 12:00:08 +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
c965c27dfb Skip removing obsolete files in some cases. 2012-02-20 20:23:33 +01:00
Juan RP
6e50919d2b xbps_repository_pool_dictionary_metadata_plist: make it accept a pkgpattern. 2012-02-16 08:55:07 +01:00
Juan RP
cbf7417d1d xbps_transaction_install_pkg: return EEXIST if pkg already installed. 2012-02-14 00:34:26 +01:00
Juan RP
9a23c2a356 xbps_api.h: fix xbps_transaction_install_pkg doc mismatch. 2012-02-06 13:50:53 +01:00
Juan RP
f48ab4a686 Fixed a bug in rpool to find best pkg available. 2012-01-29 12:12:00 +01:00
Juan RP
b7da3464dd xbps_repository_sync_pkg_index: update for index 1.4 format. 2012-01-25 06:02:38 +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
e8071802d1 xbps_api.h: fix xbps_handle::flags possible values. 2012-01-22 11:35:26 +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
c884634a62 xbps_api.h: fix some defs. 2012-01-22 10:24:37 +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
38db570c19 pkgdb: foreach_xxx_pkg_cb -> foreach_xxx_cb. 2012-01-21 10:30:20 +01:00
Juan RP
99f5549a29 xbps_pkgdb_replace_pkgd: fix bool vs int confusion in returned value. 2012-01-20 12:38:24 +01:00
Juan RP
d075411049 Improve API documentation round 1. 2012-01-20 12:17:27 +01:00
Juan RP
6940505de9 regpkgdb rototill: renamed to pkgdb, improve the public API. 2012-01-20 11:10:52 +01:00
Juan RP
9a088937b5 Repository index 1.4 -- see NEWS file for info. 2012-01-19 12:26:40 +01:00
Juan RP
dfc7ff4232 API break: simplify xbps_repository_pool_find_virtualpkg(). 2012-01-18 08:25:28 +01:00
Juan RP
d0e1477eeb Simplify xbps_end() and don't continue if xbps_init() did not succeed. 2012-01-17 16:56:17 +01:00
Juan RP
f2b05d6438 Improved pkg best matching in rpool, and support for exact pkgver matches.
- xbps_repository_pool_find_pkg in best match case, now returns the
  newest package version available in rpool.
- Added xbps_repository_pool_find_pkg_exact that returns a package
  by exact matching a pkgver.
- Removed xbps_handle_alloc(), the user is free to use memory
  allocated from heap or stack.
- Improved API documentation in preparation for 0.12.

Bumped XBPS_API_VERSION again.
2012-01-17 16:17:03 +01:00
Juan RP
beb7284681 xbps-repo: faster 'genindex' target implementation for index-files.plist. 2012-01-17 10:50:35 +01:00
Juan RP
4164573b35 Added xbps_match_pkgdep_in_array() to match a pkgdep against pkgpatterns.
This fixes xbps_match_pkgpattern_in_array() which had the args swapped
in xbps_pkgpattern_match() resulting in inverted results while resolving
virtual packages in a transaction.
2012-01-16 15:50:06 +01:00
Juan RP
ffa48b2cf3 Fix xbps_configure_packages() by avoiding proplib iterators. 2012-01-16 14:41:16 +01:00
Juan RP
2186e16a5e Fixed issue 21 "xbps-repo find-files is awfully slow" reported by ojab. 2012-01-15 14:24:44 +01:00
Juan RP
c83a77c1b5 Fixed issue 19 "xbps-src cannot fetch source with unknown Content-Length". 2012-01-05 12:26:57 +01:00
Juan RP
ab6d4a19f1 xbps_configure_packages: fix flush arg confusion. 2012-01-04 17:59:49 +01:00
Juan RP
a31c20e52a Make xbps_configure_pkg/packages accept a flush bool arg for frontends. 2012-01-04 17:41:36 +01:00
Juan RP
bae664c639 xbps_match_pkgpattern_in_array: fix swapped args resulting in non matches. 2011-12-29 16:35:56 +01:00
Juan RP
f4f995574c xbps_remove_pkg_from_dict_by_name: make this work correctly again. 2011-12-28 09:44:25 +01:00
Juan RP
caaba09295 xbps_register_pkg: fix by adding pkgd into regpkgdb array. 2011-12-28 09:21:01 +01:00
Juan RP
a7f3a56e19 Make xbps_(un)register_pkg() accept a boolean arg to flush regpkgdb on success. 2011-12-28 05:57:04 +01:00
Juan RP
b64fb39701 xbps_remove_pkg_from_dict_by_name: simplify. 2011-12-24 16:37:25 +01:00
Juan RP
5a1ab26972 Introduce xbps_regpkgdb_remove_pkgd, and use regpkgdb funcs to make xbps-uhelper work. 2011-12-24 16:09:30 +01:00
Juan RP
3b7491d29b Merged purge code in remove, configurable transaction regpkgdb flushing.
See the NEWS file for info.
2011-12-24 01:05:26 +01:00
Juan RP
d7a32a7eca Introduce regpkgdb_foreach_reverse_pkg_cb, switch to regpkgdb_foreach_xxx. 2011-12-23 08:16:25 +01:00
Juan RP
ca0905925f xbps_end: don't continue if we don't have a valid xbps_handle pointer. 2011-12-22 16:55:35 +01:00
Juan RP
3d81d497bd Redo xbps_repository_pool internals, it's a bit faster now. 2011-12-22 16:38:05 +01:00
Juan RP
7bfcdee791 Introduce xbps_regpkgdb_foreach_pkg_cb() and use it in xbps-bin check. 2011-12-22 14:25:27 +01:00
Juan RP
c40c40e08e Always preserve current conffiles while installing new packages. 2011-12-19 11:20:27 +01:00
Juan RP
1a4c13e1bf xbps_remove_pkg: fix path to REMOVE script. 2011-12-16 10:34:05 +01:00
Juan RP
450bf2713d Also purge packages to replaced in transaction. 2011-12-16 10:21:51 +01:00
Juan RP
32fdb35c56 libxbps: make xh->cachedir to always use a full path after xbps_init(). 2011-12-15 14:24:10 +01:00
Juan RP
70e95786dc libxbps: pass xhp->conffile as last argument when execing INSTALL/REMOVE scripts. 2011-12-15 12:24:59 +01:00
Juan RP
b0ceeaa58e New configuration file via confuse: xbps.conf. 2011-12-15 11:19:20 +01:00
Juan RP
3f45f563be xbps-bin: syslog support, enabled by default. 2011-12-06 13:02:49 +01:00
Juan RP
43d85c76b3 xbps-repo: implement new target 'pkg-list' to list pkgs from target repo. 2011-12-03 10:37:31 +01:00
Juan RP
e7562fa72d libxbps: make xbps_find_*pkg_dict_installed only accept {INSTALL,UNPACK}ED states as valid ones. 2011-11-30 11:11:15 +01:00
Juan RP
9d731ffe09 Introduce xbps_transaction_remove_pkg() and use it for xbps-bin(8). 2011-11-27 09:05:18 +01:00
Juan RP
0ff0aee226 libxbps: added xbps_transaction_autoremove_pkgs(bool purge).
This is to add package orphans into the transaction dictionary.
2011-11-25 11:20:03 +01:00
Juan RP
bbfd2813b2 libxbps: renamed xbps_repository_{install,update}_xxx to xbps_transaction_xxx. 2011-11-25 10:12:03 +01:00
Juan RP
f3099fa2c6 Added success states for state_cb, move some descriptions to the client cb. 2011-11-25 09:44:49 +01:00
Juan RP
ab17573692 Split XBPS_FLAG_FORCE into CONFIGURE and REMOVE_FILES, bump XBPS_API_VERSION. 2011-11-24 11:50:53 +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
19664f624a libxbps: return success when requiredby entry already exists. 2011-11-17 12:57:43 +01:00
Juan RP
86f1f18571 libxbps: revamped trans states/cb to be more generic, not just for transactions. 2011-11-11 09:41:48 +01:00
Juan RP
c2eed68471 libxbps: add xbps_repository_pool_sync, to sync repoidx from all remotes. 2011-11-10 23:14:50 +01:00
Juan RP
de4504c248 Update refs to pkg-index, which aren't true anymore. 2011-11-10 09:21:17 +01:00
Juan RP
e46dd09127 Faster binary package unpacking, see the NEWS file for info. 2011-11-09 21:01:25 +01:00
Juan RP
662b5acc08 Implemented "New repository scheme and configuration file" from issue 16. 2011-11-07 20:28:35 +01:00
Juan RP
7b251477e5 Bump XBPS_API_VERSION for recent changes. 2011-10-31 21:30:08 +01:00
Juan RP
cf1b893995 libxbps: there's no need to look for vpkgs in xbps_repository_update_*(). 2011-10-31 21:01:53 +01:00
Juan RP
c5d6ccde46 libxbps: make check_is_installed_pkg_* use only find_virtualpkg_dict_installed.
xbps_find_virtualpkg_dict_installed() also finds real packages, so there's no
need to use both in xbps_check_is_installed_pkg_by_{name,pattern}.

Bump XBPS_API_VERSION.
2011-10-30 16:24:56 +01:00
Juan RP
2a8b74484e libxbps: improve xbps_purge_pkg() in case that metadata dir doesn't exist. 2011-10-30 11:12:03 +01:00
Juan RP
858e616f41 libxbps: preserve config file if they exist for replaced pkgs. 2011-10-30 10:32:56 +01:00
Juan RP
1c4d486396 xbps-{bin,repo}: new -o flag for the 'show' target, to print specific objs value. 2011-10-29 08:17:54 +02:00
Juan RP
9034df9bc2 libxbps: added xbps_match_any_virtualpkg_in_rundeps(array rundeps, array provides).
Matches any pkgdep from provides array in the rundeps array with
pkgpatterns. True on match, false otherwise.
2011-10-27 18:48:59 +02: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
c6636d1b79 libxbps: xbps_pkgpattern_xxx extend set of chars to be detected. 2011-10-24 10:03:45 +02:00
Juan RP
9281e9625f libxbps: xbps_pkgpattern_{name,version}: match for dewey and glob patterns.
The match code used by libxbps now will only match for dewey patterns
and glob patterns (fnmatch).

Bumped XBPS_API_VERSION due to changed behaviour.
2011-10-24 09:28:43 +02:00
Juan RP
5ade2f37c7 libxbps: xbps_configure_pkg: ignore pkgs in config-files state. 2011-10-20 16:13:16 +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
0a041cdd2e libxbps: new func xbps_array_replace_dict_by_name(array, dict, pkgname)
This function replaces a dictionary in an array matched by pkgname,
with the dictionary passed in as 2nd argument.
2011-10-19 00:37:36 +02:00
Juan RP
931a03b806 New configuration schemas changes, round 3.
struct xbps_handle::conffile has been renamed to confdir, and it now
expects the path to a directory, where the configuration files are
stored.

Change xbps-bin(8) and xbps-repo(8) along with its manpages to mention
that -C expects a directory.
2011-10-17 15:11:54 +02:00
Juan RP
08f7169eff New configuration scheme changes, round 2 (virtual pkgs).
- XBPS now expects to read individual virtual pkg settings from
  .plist files in PREFIX/etc/xbps/virtualpkg.d.wants.

This really implements the missing part in issue #12 in
googlecode: http://code.google.com/p/xbps/issues/detail?id=12
2011-10-17 14:24:30 +02:00
Juan RP
5642ffa86e New configuration scheme changes, round 1.
- Configuration file 'xbps-conf.plist' has been splitted off into
  two files: conf.plist and repositories.plist. By default they
  are stored in etc/xbps.
- Changed some members in xbps_handle struct, mostly to make it easy
  to change its value in {cache,root}dir and conffile.
- Made xbps_init() release proplib objects as soon as we don't need
  them, that way it uses 35% less of memory or in some cases even more.

There will be another commit that will implement to read new virtualpkg
settings by the user, as specified in:

	http://code.google.com/p/xbps/issues/detail?id=12
2011-10-17 12:37:15 +02:00
Juan RP
b6da7393c1 libxbps: make the xbps_find_*pkg_dict_installed work as expected.
Bump XBPS_API_VERSION due to semantics change in virtual and non virtual
functions.
2011-10-16 17:21:43 +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
104bec27e5 libxbps: handle the case to replace a vpkg with a pkg with same name.
This for example fixes reinstalling jpeg and libjpeg-turbo multiple
times. Also if the "automatic-install" obj is in the pkg to be
replaced, copy it to the new pkg to be preserved.

Bumped XBPS_API_VERSION.
2011-10-16 10:28:03 +02:00
Juan RP
ead8d2460f libxbps: respect reqdby obj when replacing a pkg with a virtual pkg.
Reverse dependencies weren't respected when replacing a pkg with
another pkg that is providing a virtual pkg for the former.

This resulted in reversedeps being completely lost when new pkg
is installed.
2011-10-15 16:43:27 +02:00
Juan RP
c3395a2f3b Bump XBPS_API_VERSION for last libxbps change. 2011-10-12 09:28:50 +02:00
Juan RP
3c61de45aa xbps_api.h: fix xbps_transaction_cb_data::repourl descr. 2011-08-18 10:42:37 +02:00
Juan RP
ba5913cbb9 libxbps: [unpack] only extract files if they have been modified. 2011-08-01 12:35:47 +02:00
Juan RP
2857214afa libxbps: improve returned errnos for repository API functions.
- xbps_repository_update_packages: return ENOENT if regpkgdb is NULL
  (no packages currently registered).
- xbps_repository_update_packages: return EEXIST if no updates are
  available.
- xbps_repository_pool: return ENOTSUP if no repositories were
  registered.
- make xbps-{bin,repo} handle ENOTSUP errors.
2011-07-29 11:17:34 +02:00
Juan RP
5e390b8839 Introduce new pkg state: half-unpacked.
Packages in this state shall be re-installed and re-unpacked because its
files weren't unpacked properly.
2011-07-28 16:25:01 +02:00
Juan RP
6f783389dd Share transaction callbacks for xbps-{bin,repo}, reposync cb support. 2011-07-28 09:25:30 +02:00
Juan RP
d7d077a377 xbps_api.h: fixed some comments. 2011-07-27 23:18:25 +02:00
Juan RP
508f119bc9 Moved install transaction code to libxbps, see NEWS file. 2011-07-27 17:13:54 +02:00
Juan RP
e26b6e23e6 xbps-bin(8): make 'show{,-deps,-revdeps}' target work with virtual pkgs. 2011-07-25 16:40:34 +02:00
Juan RP
59ddc58187 xbps_api.h: fix descr in xbps_cmpver(). 2011-07-22 18:05:21 +02:00
Juan RP
17829cd6b4 libxbps: add xbps_find_virtualpkg_in_array_by_{name,pattern} and use it. 2011-07-15 18:45:38 +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
f6476e210c libxbps: do not loop forever on errors while syncing a remote repo. 2011-07-14 00:13:25 +02:00
Juan RP
0a2abb3f3d xbps-repo(8): 'search' target is now case insensitive.
Along with this change, compat code has been added (from NetBSD)
for systems that don't have it. The compat code has been reorganized
to be in a common place and its prototypes in compat.h.

The configure scripts checks if strcasestr() is available, and
uses compat code if not found.

This fixes issue #2 on github.com/vanilla/xbps.
2011-07-09 10:50:44 +02:00
Juan RP
f897ffa431 Do not redefine strlc{at,py} prototypes. 2011-06-29 12:16:04 +02:00
Juan RP
74ce033d45 Don't initialize repository pool via xbps_init, instead in repository_pool public funcs.
That way we can avoid having to sync all remote repositories for any code
using xbps_init()!
2011-06-22 11:55:02 +02:00
Juan RP
fbfa9c5960 New option in conffile to set libfetch's limit (seconds) in timed out connections. 2011-06-22 09:53:44 +02:00
Juan RP
0bc77f86fa xbps_pkg_epoch is not supported anymore with NetBSD's dewey. 2011-06-14 11:26:00 +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
2d6140f65b Rename: xbps_read_dict_from_archive_entry() -> xbps_dictionary_from_archive_entry(). 2011-06-02 09:54:59 +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
cfa637db48 Repository package index format 1.2.
The pkg index now stores all package objects from props.plist, so that
xbps-repo(8) doesn't have to access the target binpkg anymore.
2011-05-27 17:32:42 +02:00
Juan RP
1f998e246f Bump XBPS_RELVER for previous change. 2011-04-11 15:18:44 +02:00
Juan RP
ef28101203 xbps_register_pkg: remove 'automatic' boolean argument.
It should be provided in the proplib dictionary with key 'automatic-install'.
This fixes a regression not respecting the 'automatic-install' value stored
in regpkgdb.
2011-04-11 14:42:06 +02:00
Juan RP
8191a1511c Make it possible to overwrite the "automatic-install" pkg object via xbps_init().
Two new booleans were added to struct xbps_handle: install_reason_{auto,manual}.
The backend is able to force auto or manual installation for a package (and
dependencies that were installed/updated) by setting to true any of those
booleans. Bump XBPS_RELVER.
2011-02-26 11:11:45 +01:00
Juan RP
7e4118a6e2 Added xbps_get_file_hash_from_dict(), returns the sha256 string obj in a dictionary. 2011-02-24 00:21:40 +01:00
Juan RP
a306cebc96 xbps_set_pkg_state_installed: added two new optional arguments: version and pkgver.
This can be used to avoid some rare cases where the pkg dictionary is regpkgdb
is in a state where code can be faulty if those objects are not found.
2011-02-22 11:09:39 +01:00
Juan RP
c4db906a1f xbps_api.h: fix some comments. 2011-02-21 18:00:44 +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
8d5a1ad0a3 xbps_api_impl.h: remove function name arguments in prototypes. 2011-02-21 14:04:57 +01:00
Juan RP
afe0f3e2f0 Make the xbps_handle struct const internally. 2011-02-21 14:03:08 +01:00
Juan RP
7ddd409b90 xbps_api.h: fix a comment. 2011-02-21 13:42:36 +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
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
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
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