Commit Graph

1100 Commits

Author SHA1 Message Date
Juan RP
27723e94ff Optimize repository API functions.
- Remove xbps_repo_get_plist() and try to internalize all members at
  xbps_repo_open() time.

- Added xbps_repo_open_idxfiles() to also internalize the index-files
  plist from repository, which is really huge and must only be internalized
  when needed.

- Improve how signed and verified repositories are detected.

- Misc optimizations and small performance improvements.

Bump XBPS_API_VERSION.
2013-10-07 10:19:04 +02:00
Juan RP
c69134f851 xbps_repository_is_remote: optimize and check for http:// first. 2013-10-07 09:23:25 +02:00
Juan RP
8d5c48b861 Added support for the long awaited feature: RSA signed repositories. 2013-10-05 11:38:04 +02:00
Juan RP
192ffa2d58 Update API documentation and dot files. 2013-09-25 11:15:04 +02:00
Juan RP
5e1432f418 Added support to specify multiple repositories via cmdline (close #17). 2013-09-18 16:45:05 +02:00
Juan RP
023484ca0b Introduce xbps_{array,pkgdb}_foreach_cb_multi() and use it where appropiate.
In some tasks the single threaded implementation outperms the multithreaded
one. Use it where it really makes a difference. The _multi() routines do not
spawn any thread if _SC_NPROCESSORS_ONLN == 1.

Bump XBPS_API_VERSION.
2013-09-17 16:30:13 +02:00
Juan RP
fce411bac6 xbps_rpool_foreach: ignore invalid repos. 2013-09-17 16:24:19 +02:00
Juan RP
e6aade53a0 xbps_repo_get_pkg_revdeps: ignore invalid repos. 2013-09-17 16:19:56 +02:00
Juan RP
12546e4b70 Revert "lib/repo_pkgdeps.c: check for wrong dependencies earlier."
This reverts commit eed9c89375.
2013-09-17 09:04:01 +02:00
Juan RP
ac158ec2f6 lib/transaction_sortdeps.c: fix a comment. 2013-09-16 11:31:56 +02:00
Juan RP
eed9c89375 lib/repo_pkgdeps.c: check for wrong dependencies earlier. 2013-09-16 11:28:55 +02:00
Juan RP
3f376998c2 lib/plist_find.c: remove a noisy/useless dbg printf. 2013-09-16 11:24:09 +02:00
Juan RP
4057e4961c Use C99 for loop initializers.
That means that a C99 compiler is now mandatory.
2013-09-15 10:06:49 +02:00
Juan RP
571d8748b4 lib/package_unpack.c: fix a double free. 2013-08-30 15:34:29 +02:00
Juan RP
010e5df415 lib/transaction_commit.c: add missing arg to xbps_dbg_printf(). 2013-08-29 15:49:23 +02:00
Juan RP
f4dc832229 Revert "lib/package_config_files.c: fixed a memleak."
This reverts commit c04d54f020.
2013-08-29 15:30:14 +02:00
Juan RP
24ff0472dd Use fs blksize from stat(2)ed file when reading archives. 2013-08-29 14:30:14 +02:00
Juan RP
1bea5725ae lib/package_script.c: misc cleanups. 2013-08-29 12:13:59 +02:00
Juan RP
20fb38142b lib/package_unpack.c: fixed two memleaks. 2013-08-29 12:06:04 +02:00
Juan RP
c04d54f020 lib/package_config_files.c: fixed a memleak. 2013-08-29 12:05:59 +02:00
Juan RP
71a602fd27 lib/archive.c: fixed memleaks in error paths; misc cleanups. 2013-08-29 11:57:57 +02:00
Juan RP
6795e840d6 lib/plist_find.c: fix a memleak, misc cleanups. 2013-08-29 11:51:42 +02:00
Juan RP
a039330f3c Misc cleanups: use __attribute__((__unused__)); remove dead code. 2013-08-29 10:45:30 +02:00
Juan RP
789165339a Drop useless/unused xbps_add_obj_to_{array,dict} functions. 2013-08-18 10:25:17 +02:00
Juan RP
11fbffa241 Fix #14 from github (Removing recursively does not respect manual installation mode for dependencies). 2013-08-17 09:50:19 +02:00
Juan RP
84d14286a8 More libarchive-2.x compat. 2013-08-15 11:55:20 +02:00
Juan RP
776b94e6bc Remove PackagesOnHold from xbps.conf; use xbps-pkgdb -m hold|unhold instead.
To put a package on hold mode:
	$ xbps-pkgdb -m hold foo

To unhold the package:
	$ xbps-pkgdb -m unhold foo

To list packages on hold mode:
	$ xbps-query -H

This also close #12 from github.
2013-08-12 14:46:54 +02:00
Juan RP
49fa951836 xbps_array_foreach_cb: replace an assertion with a real test, for non working repos. 2013-07-27 20:01:23 +02:00
Juan RP
0c7701f2bc Introduce xbps_array_foreach_cb() and use it in random code.
This routine will spawn a thread per core to process N items stored
in the specified array, the last thread gets the remainder of items left.

Results have shown that xbps benefits if there is a considerable amount
of items and number of threads being spawned.

Use it in xbps_pkgdb_foreach_cb(), xbps-pkgdb(8), xbps-query(8)
and xbps-rindex(8).

On UP systems there's no overhead because pthread(3) is not used at all.

WIP! investigate if it can be used in libxbps (xbps_rpool_foreach()),
and finish conversion of xbps-rindex(8) -c.
2013-07-27 09:47:16 +02:00
Juan RP
432067de48 Remove three unused API functions. 2013-07-27 06:12:59 +02:00
Juan RP
20f2d10527 xbps-query(8): -L now prints all repos, including non working repos (close #11). 2013-07-26 11:42:52 +02:00
Juan RP
db7dd3fd9b lib/repo_pkgdeps.c: print correctly missing dependencies. 2013-07-16 08:00:42 +02:00
Juan RP
7941b225fb rpool: no need to add repository object; it's already set by the repo code. 2013-07-07 09:58:30 +02:00
Juan RP
ecd15b7d57 Check if an update for conflicting pkg is in the transaction for revdeps in vpkgs. 2013-07-05 10:09:32 +02:00
Juan RP
42ba861e21 lib/fetch: ignore -Wformat-nonliteral with clang. 2013-07-02 08:54:02 +02:00
Juan RP
789c756854 xbps_transaction_revdeps: properly print the broken revdeps on real deps. 2013-07-02 00:47:16 +02:00
Juan RP
47eed214a6 xbps_repo_get_pkg_revdeps: don't continue if arg is a virtual pkg. 2013-06-27 18:14:38 +02:00
Juan RP
505a933097 Added support to verify reverse dependencies in a transaction.
See https://plus.google.com/106812073015308749022/posts/ZXMHimd8iKd
2013-06-27 16:52:31 +02:00
Juan RP
4494e0554d lib/plist_find.c: typo in comment. 2013-06-27 16:26:19 +02:00
Juan RP
52fc384e4e Fixed some issues/warnings found by clang-analyzer. 2013-06-20 11:25:43 +02:00
Juan RP
42c0766c00 Get rid of libfetch and proplib external dependencies.
The list of required external deps is now confuse, libarchive and openssl.

libxbps now includes a wrapper for proplib prefixed with xbps_ rather than prop_.
2013-06-20 10:26:12 +02:00
Juan RP
31efece727 Hide libfetch symbols if using the internal copy. 2013-06-19 11:57:25 +02:00
Juan RP
d419f8ac2a Move fetch.h to lib/fetch. 2013-06-19 11:03:03 +02:00
Juan RP
ee9b799822 Make sure that only 1 thread can inject the vpkg config files. 2013-06-14 12:31:43 +02:00
Juan RP
9d80524a34 Minor optimization: no need to check if obj is NULL, prop_object_type() does that already. 2013-06-14 12:22:29 +02:00
Juan RP
3abe48b68a Introduce xbps_repo_get_pkg_plist() and use it in xbps-query -R. 2013-06-14 10:22:10 +02:00
Juan RP
2c03e1c9a8 Read virtual pkg config files only when it's necessary. 2013-06-14 10:00:33 +02:00
Juan RP
5f2bba7f4e Move functionality to resolve revdeps from repos to libxbps. 2013-06-14 08:13:51 +02:00
Juan RP
db1efb3aa6 Relax memory requirements on 64bit platforms; fix two memleaks. 2013-06-12 10:04:10 +02:00
Juan RP
99be698979 Use a single file to store repository data.
This is just the starting point to extend repositories with PGP signatures.
2013-06-10 10:28:39 +02:00
Juan RP
c22dfa8d52 Make sure that pkg meta plist are always created, even in pkgs without files. 2013-05-17 09:17:32 +02:00
Juan RP
769205db0c Before unpacking pkg files, first create the pkg metafile (temp fix for #7). 2013-05-17 08:24:47 +02:00
Juan RP
7da5f6e8f7 lib/package_unpack.c: remove extra arg in xbps_set_cb_state(). 2013-05-15 12:45:35 +02:00
Juan RP
5fd7565e6c xbps-install(8): -R now overrides the repository list set in a configuration file.
Now -R can be used independently if a configuration file exists or not.
2013-04-18 18:17:14 +02:00
Juan RP
80de70d0cf lib/transaction_dictionary.c: get installed_size obj from pkg metadata correctly.
This lead to incorrect sizes or no size when computing freed/installed size
in the transaction dictionary.
2013-04-04 10:40:32 +02:00
Juan RP
ef4e43931b lib/rindex_sync.c: remove extra parameter in a variadic function. 2013-04-04 10:18:10 +02:00
Juan RP
6fdb2e322d lib/package_unpack.c: remove extra parameter in a variadic function. 2013-04-04 10:15:32 +02:00
Juan RP
dc900353e4 lib/initend.c: xbps_end: remove bogus assignment. 2013-04-04 10:07:19 +02:00
Juan RP
1741019b90 lib/transaction_sortdeps.c: remove bogus assignment in pkgdep_release(). 2013-04-04 09:57:59 +02:00
Juan RP
c753eae9f7 lib/package_unpack.c: fix two possible memleaks. 2013-04-04 09:55:35 +02:00
Juan RP
dbf4bb184e xbps_transaction_remove_pkg: fix uninitialized argument value reported by scan-build. 2013-04-04 09:22:40 +02:00
Juan RP
0a1ea51e4e lib/package_unpack.c: fix a meamleak in error path. 2013-04-04 09:17:32 +02:00
Juan RP
e844bc1ad5 xbps_callback_array_iter_reverse: initialize rv (fixes garbage return value). 2013-04-04 09:13:52 +02:00
Juan RP
e4a3342c39 xbps_entry_install_conf_file: pass correct number of args to xbps_set_cb_state(). 2013-03-27 17:22:44 +01:00
Juan RP
7c4f20ba89 lib/transaction_commit.c: fix a use-after-free in state cb (found by ojab). 2013-03-26 10:35:20 +01:00
Juan RP
8d6f3b5029 unpack: use lchown(2) to set proper uid/gid to symlinks. 2013-03-17 17:13:07 +01:00
Juan RP
57bb7baf5e unpack: use archive_entry_{filetype,uid,gid,mode} rather than stored struct stat. 2013-03-15 13:18:30 +01:00
Juan RP
b5d141e28c When checking for obsolete files ignore unexistent files. 2013-03-13 22:08:13 +01:00
Juan RP
5efa1de8d5 lib/package_unpack.c: no need to use a var just to check lstat() rval. 2013-03-11 14:06:47 +01:00
Juan RP
a92863cb62 xbps_find_pkg_orphans: remove workaround for target pkgs; ignore unknown pkgs. 2013-03-11 12:13:42 +01:00
Juan RP
0845d6cae3 xbps_transaction_remove_pkg: handle correctly target pkg. 2013-03-11 12:13:02 +01:00
Juan RP
b9888fd7be xbps_match_virtual_pkg_in_dict: add support to match vpkgs with exact version. 2013-03-10 10:07:54 +01:00
Juan RP
8fce81cc9f pkgdb: do not add dups in revdeps generation; remove old code. 2013-03-10 08:58:37 +01:00
Juan RP
356f451d17 Renameed lib/package_remove_obsoletes.c -> package_find_obsoletes.c. 2013-03-09 17:21:27 +01:00
Juan RP
fe922ace4c Merge portable proplib 0.6.3. 2013-03-09 16:41:40 +01:00
Juan RP
84745dfe33 xbps_file_hash: remove madvise usage (no gain irl). 2013-03-09 16:22:41 +01:00
Juan RP
b976a45aed New code to find pkg obsolete files, with a proper kyua test.
Previous code incorrectly found obsolete files in this case:

(curpkg) - in files: /etc/foo.conf
(newpkg) - in conf_files: /etc/foo.conf

and removed this file because the code couldn't find it in the same
array. The new code fixes this case and compares the whole pkg filelist.
2013-03-09 13:30:56 +01:00
Juan RP
e2b303363b lib/package_unpack.c: fix a memleak. 2013-03-09 11:07:14 +01:00
Juan RP
5885543728 xbps_rindex_sync: simplify. 2013-03-09 10:43:50 +01:00
Juan RP
f9fc39fcdc Repair xbps_find_pkg_orphans() after pkgdb 0.21 format switch.
The problem was that pkgdb is now a dictionary, thus this contains
an unordered set of objects, therefore we cannot depend in the order
anymore.
2013-03-09 09:56:36 +01:00
Juan RP
c504a73f08 Re-use pkgname from unpack to handle config files. 2013-03-08 10:11:16 +01:00
Juan RP
faacbd4a96 lib/package_unpack.c: fix xbps_entry_install_conf_file() args. 2013-03-08 10:07:48 +01:00
Juan RP
50ea03df2a Revert code to update xbps independently; I'll use another way to implement this. 2013-03-08 09:44:57 +01:00
Juan RP
f5f6f50e27 lib/external/fexec.c: add some parens so that expression is evaluated correctly. 2013-03-07 20:15:16 +01:00
Juan RP
5eddf04898 Ignore executing install/remove scripts if XBPS_TARGET_ARCH is set.
Instead a two stage approach is necessary when packages for target arch
are installed:

	- XBPS_TARGET_ARCH=arch xbps-install foo <- only unpack
	- xbps-reconfigure -a <- configure natively or via an emulator
2013-03-07 18:08:12 +01:00
Juan RP
fd7153fe5c lib/external/fexec.c: error out if chroot/chdir fails, ignore target_arch. 2013-03-07 18:07:47 +01:00
Juan RP
bcae7e83aa lib/package_unpack.c: pass pkgver to xbps_pkg_exec_buffer() not pkgname. 2013-03-07 12:01:07 +01:00
Juan RP
98adbf34a1 xbps_pkg_exec_buffer: pass correct args to the install/remove scripts. 2013-03-07 11:56:08 +01:00
Juan RP
7e2d5344d3 lib/package_unpack.c: pass correct number of args to xbps_set_cb_state(). 2013-03-07 11:52:47 +01:00
Juan RP
0a1859987a Respect automatic-install mode from pkgdb in transaction updates.
Also simplify register/unregister and remove useless state definitions.
2013-03-07 10:03:59 +01:00
Juan RP
90b6803825 Introduce XBPS_STATE_CONFIGURE_DONE and use it in xbps-reconfigure(8). 2013-03-07 09:24:04 +01:00
Juan RP
37263d63c9 lib/transaction_ops.c: only call xbps_pkg_name() when it's really necessary. 2013-03-07 09:12:47 +01:00
Juan RP
5409e51822 lib/package_conflicts.c: adapt to pkgdb 0.21 format. 2013-03-06 12:55:00 +01:00
Juan RP
301dfe0043 xbps_configure_pkg: fail gracefully if metadata cannot be read. 2013-03-05 17:20:29 +01:00
Juan RP
e36bedb036 Fix regressions in xbps_unpack_binary_pkg(). 2013-03-05 06:42:25 +01:00
Juan RP
7c1a0ac3e8 New pkgdb (0.21) and repo index (1.7) format, see NEWS for info. 2013-03-05 04:08:42 +01:00
Juan RP
42274f939c Set _BSD_SOURCE before including string.h to get strlc{at,py} with musl. 2013-03-03 08:21:00 +01:00
Juan RP
8b5f6d7b65 When running scripts exit from child with errno from execv(). 2013-02-26 09:12:44 +01:00
Juan RP
26778964a4 When executing scripts don't chroot if XBPS_TARGET_ARCH is set. 2013-02-25 23:00:20 +01:00
Juan RP
e525e2c251 Drop posix_fadvise(3) completely before unpacking.
Some systems with small memory might fail to make the preallocation,
as seen in the rpi. It doesn't give us too much gain anyway.
2013-02-20 12:59:11 +01:00
Juan RP
ae7b76e245 xbps_fetch_file: don't fsync(3) before closing fd; slowdowns considerably slow storage. 2013-02-20 10:46:21 +01:00
Juan RP
eb61aabca8 xbps_remove_pkg: fix a double free. 2013-02-19 14:58:56 +01:00
Juan RP
2b5d3bb8f4 libxbps: when resolving deps, ignore all of them that depend on the origin pkg. 2013-02-07 18:50:55 +01:00
Juan RP
178a6b58ae Remove another transaction obj from pkgdb and make xbps-pkgdb catch it. 2013-02-07 17:49:28 +01:00
Juan RP
d8769c4873 Workaround fix for 'xbps-install -yf xbps <-> xbps-git'. 2013-02-05 12:10:24 +01:00
Juan RP
6c96fe32cc lib/initend.c: print dbg msg about successful vpkg conf files read. 2013-02-05 09:32:43 +01:00
Juan RP
a8e8e8fd5d xbps_remove_pkg: ignore ELOOP in realpath() when checking symlinks.
Probably it is a broken symlink, so we don't have to care about it.
2013-02-04 16:35:15 +01:00
Juan RP
90cde72283 Add support to switch arch via XBPS_TARGET_ARCH env var. 2013-02-03 09:45:03 +01:00
Juan RP
0812ef2c35 Properly fix fa1d543dfa. 2013-02-02 18:15:00 +01:00
Juan RP
5eb6206c12 Fix inverted test in previous commit... sigh. 2013-02-02 14:45:47 +01:00
Juan RP
fa1d543dfa Ignore package conflicts against themselves, due to virtual packages. 2013-02-02 14:34:55 +01:00
Juan RP
5c1688944d xbps-install: make -f preserve conf files; use it twice to overwrite all files. 2013-02-02 11:30:42 +01:00
Juan RP
7d8f0bb686 lib/compat/vasprintf.c: make this build and fix sign-compare warnings. 2013-02-02 01:31:20 +01:00
Juan RP
bdcdb9f1a0 xbps_fetch_file: don't check for file truncation if server answers with invalid info. 2013-02-01 13:40:27 +01:00
Juan RP
42e0f19bbe Fix package conflicts detection (regression from b9136c61c9). 2013-02-01 12:41:27 +01:00
Juan RP
9cf104498e lib/initend.c: convert a noisy printf to dbg_printf. 2013-01-31 09:42:22 +01:00
Juan RP
7360a6fca3 Fix previous; only use arg0 in client cb. 2013-01-31 09:41:43 +01:00
Juan RP
d2178b70e3 xbps_rindex_sync: pass correct file to the state cb. 2013-01-31 09:33:06 +01:00
Juan RP
e75fcdd567 xbps_fetch_file: avoid copying from a NULL pointer. 2013-01-15 15:55:18 +01:00
Juan RP
3139f822da lib/pkgdb.c: print to stderr a meaningful msg on error. 2013-01-15 13:14:30 +01:00
Juan RP
71430b1566 lib/initend.c: print to stderr a meaningfull msg on error. 2013-01-15 13:14:06 +01:00
Juan RP
b5bb1debe4 Partial revert of 5d59a15faf.
Error out if "pre-remove" script action fails, otherwise package is
removed but its files are still there (ouch).
2013-01-14 14:01:35 +01:00
Juan RP
2f3913f3aa lib/fetch/common.c: merge 2.34 and backport a patch for select(2) and SSL. 2013-01-13 21:09:15 +01:00
Juan RP
336897d964 xbps_fetch_file: simplify and use libfetch support for If-Modified-Since. 2013-01-13 16:27:59 +01:00
Juan RP
ea2f2c7297 Silence -Wformat-nonliteral warning with clang. 2013-01-04 10:35:00 +01:00
Juan RP
5d59a15faf libxbps: even if executing a pre-remove action fails, continue removing pkg.
This is no reason to stop removing a pkg, so just continue and fully
remove the pkg.
2012-12-29 07:13:49 +01:00
Juan RP
0f22579a34 libxbps: fixed regression executing "pre-remove" action in installed pkgs. 2012-12-28 10:42:13 +01:00
Juan RP
9489f8a3dc Do not configure pkg if there's an update in transaction.
This fixes the following problem:

 - pkg is installed with state "unpacked".
 - There's an update of pkg in transaction.
 - xbps tries to configure the pkg because its state is "unpacked",
   therefore ignoring the update.
2012-12-20 12:08:55 +01:00
Juan RP
66cf15f1c2 Update API docs. 2012-12-19 01:01:27 +01:00
Juan RP
6a60bceb54 xbps_configure_pkg: set pkg state in our pkg dictionary from pkgdb.
Replacing a dictionary while the iterator is held invalidates this iterator, thus
breaking the loop.

Thanks to pancake for finding this issue.
2012-12-17 11:27:10 +01:00
Juan RP
b75cd05c37 Use posix_fadvise(2) only if it's available. 2012-12-15 10:47:30 +01:00
Juan RP
5dab658d09 xbps_unpack_binary_pkg: use posix_fadvise(2). 2012-12-15 09:51:44 +01:00
Juan RP
e1fc085915 xbps_file_hash: use madvise(2). 2012-12-15 09:51:05 +01:00
Juan RP
4095290189 xbps_fetch_file: use O_CLOEXEC. 2012-12-15 09:50:37 +01:00
Juan RP
22adf99e40 Faster generation of dynamic reverse dependencies and do this exactly once. 2012-12-15 07:33:49 +01:00
Juan RP
1d42986b75 libxbps: finish support for rindex 1.6. 2012-12-07 17:11:52 +01:00
Juan RP
305659644f xbps_rindex_sync: check that downloaded repo index is a dictionary. 2012-12-07 08:34:45 +01:00
Juan RP
3e3073e44c xbps_rpool_init: relax an assertion and skip invalid repos gracefully. 2012-12-07 08:31:47 +01:00
Juan RP
2c1e4e502d XBPS can now be built on NetBSD (and probably any other BSD variant). 2012-12-06 12:58:17 +01:00
Juan RP
2e2da80cfc find_repo_deps: find pkgd from pkgdb by name as it checks for version later. 2012-12-02 16:34:01 +01:00
Juan RP
0e40a2dbba xbps_pkgdb_get_pkg_revdeps: make sure to not have dup entries. 2012-12-01 08:10:47 +01:00
Juan RP
8c84e22b94 xbps_transaction_sort: do not sort removed pkgs; just add them to head. 2012-12-01 08:10:15 +01:00
Juan RP
f45352dbf8 Added support for dynamic generation of revdeps for installed packages. 2012-11-30 17:40:52 +01:00
Juan RP
731c903026 libxbps: do not insert/delete while traversing a (double) locked iterator. 2012-11-30 10:04:36 +01:00
Juan RP
b9136c61c9 Use prop iterators when needed to retain the obj.
This could explain the strange issues seen in buildbot builds that
have been happening since 0.18; this should fix completely this.
2012-11-30 09:49:09 +01:00
Juan RP
9715d8a6a1 rindex_pkgdeps.c: simplify and reduce (a bit). 2012-11-30 08:21:20 +01:00
Juan RP
8345070884 Bump libxbps soname major version. 2012-11-30 07:18:46 +01:00
Juan RP
63c1883201 Major API/ABI cleanup bringing performance improvements and fixes.
These are the core interfaces in the new API:

rpool - Interface to interact with the repository pool.
rindex - Interface to interact with repository indexes.
pkgdb - Interface to interact with local packages.
transaction - Interface to interact with a transaction.

This also brings new repository index format, making the index file
per architecture and being incompatible with previous versions.

The transaction frequency flush option has been removed, and due to
the nature of package states it was causing more harm than good.

More changes coming soon, but the API shall remain stable from now on.
2012-11-30 07:11:51 +01:00
Juan RP
16e18313da xbps_transaction: return proper errors if pkg is missing from repos. 2012-11-28 17:35:03 +01:00
Juan RP
85c0641cc8 xbps_{configure,remove}_pkg: do not use meta cache when executing scripts.
This fixes executing INSTALL/REMOVE scripts with the right version currently
installed, i.e kernel post-install failed to execute correctly its kernel
hooks due to passing a wrong version.
2012-11-26 23:25:41 +01:00
Juan RP
7f577e005c metadir: replace uthash simply with a dictionary. 2012-11-21 23:07:38 +01:00
Juan RP
bdd93b7aa7 Introduce xbps_pkgdb_get_virtualpkgd() and use in xbps_metadir_get_pkgd(). 2012-11-19 21:46:54 +01:00
Juan RP
5de4fb1f0a xbps-install: -f will also overwrite pkg files. 2012-11-19 20:50:58 +01:00
Juan RP
d92c87dbf3 xbps_fetch_file: don't error out if restart and tempfile doesn't exist. 2012-11-19 16:40:27 +01:00
Juan RP
a311294f0a libxbps: added support to "inject" vpkg config files at initialization time. 2012-11-19 15:42:24 +01:00
Juan RP
4f9ff2746e xbps_pkg_exec_buffer: chdir to rootdir before creating fd. 2012-11-19 14:59:42 +01:00
Juan RP
0edba07106 xbps_remove_pkg: fix dbg printf args. 2012-11-19 14:45:09 +01:00
Juan RP
34ae90f1c3 xbps_remove_pkg: force pkgdb flush after unregister. 2012-11-19 14:40:41 +01:00
Juan RP
e861cb5331 xbps_transaction_commit: add a dbg printf. 2012-11-19 14:38:06 +01:00
Juan RP
5397dd4937 xbps_remove_pkg: handle all cases where pkg meta plist is unavail. 2012-11-19 14:08:01 +01:00
Juan RP
1147e7ce3c xbps_find_pkg_orphans: there's no need to check pkg state, any state is ok. 2012-11-19 14:07:05 +01:00
Juan RP
556bbd495e xbps_remove_pkg: recover from an assertion if pkg meta plist doesn't exist. 2012-11-19 13:29:09 +01:00
Juan RP
bf2d97a067 xbps_init: simplify previous and use xbps_xasprintf(). 2012-11-19 12:15:32 +01:00
Juan RP
b894a5eca3 Accept relative rootdir via xbps_handle::rootdir (found by pancake). 2012-11-19 12:12:38 +01:00
Juan RP
37b7cccc83 pkg_metadir: this must use HASH_ADD_STR instead! 2012-11-18 17:08:45 +01:00
Juan RP
6094bbc6ea pkg_metadir: fix some issues I've found while finding obsolete files. 2012-11-18 12:07:43 +01:00
Juan RP
e08c258967 xbps_remove_pkg: no need to release pkgd from metadir. 2012-11-18 12:06:46 +01:00
Juan RP
235416b48f pkg_metadir: redo previous without memleaks. 2012-11-18 04:06:13 +01:00
Juan RP
8d9f5b65e3 pkg_metadir: make sure to return a valid pkgd from the hash table. 2012-11-18 03:49:29 +01:00
Juan RP
46f7a808b4 xbps_metadir: use an hash table (via uthash): 15s vs 1m10s. 2012-11-18 02:38:24 +01:00
Juan RP
fcdb6b0930 unpack: use pkg dictionary from metadir to find obsoletes! 2012-11-17 15:14:11 +01:00
Juan RP
cc99e887a2 xbps_pkg_exec_buffer: if rootdir != / create tmp files on rootdir. 2012-11-17 12:08:25 +01:00
Juan RP
0a082a82c3 xbps_file_exec: don't fail if chroot(2) fails (due to EPERM). 2012-11-17 11:44:14 +01:00
Juan RP
bc894aae1d xbps_metadir_release: don't release obj already released. 2012-11-17 10:53:06 +01:00
Juan RP
b0fab7a3ee Implemented a cache to get pkg dicts from metadir.
This improves xbps-pkgdb -a marginally, but still seems to be a bit slow.
2012-11-16 21:50:52 +01:00
Juan RP
34bd49f85a New pkg metadata structure for 0.18. See the NEWS file for info. 2012-11-16 16:55:35 +01:00
Juan RP
db4b542d40 unpack: typo in previous. 2012-11-15 09:27:41 +01:00
Juan RP
1b217d1906 transaction_ops: shortest static function name. 2012-11-15 09:25:59 +01:00
Juan RP
ce2f45a3df unpack: don't extract pkg props.plist, we use pkg data from repo index. 2012-11-15 09:25:31 +01:00
Juan RP
5c0abc9754 libxbps: remove old code and return early if pkg has no rundeps. 2012-11-15 01:37:09 +01:00
Juan RP
ce3d4f1764 unpack: externalize pkg props dictionary from index. 2012-11-13 14:41:04 +01:00
Juan RP
4945755d53 unpack: don't assert if target file of a symlink doesn't exist, it may happen. 2012-11-12 17:10:02 +01:00
Juan RP
2703b55f99 xbps_dictionary_from_archive_entry: faster when plist is already uncompressed. 2012-11-11 16:57:23 +01:00
Juan RP
58333419a0 Shell wildcard patterns can now be used in the PackagesOnHold option. 2012-11-11 16:11:40 +01:00
Juan RP
a77727887d Improvements for xbps_fetch_file and xbps_repository_sync_index.
xbps_fetch_file:
	- A temp file is created with .part extension to improve resuming.
	- Files are downloaded in cwd.
	- Switch to futimens(2) and fsync(2).

xbps_repository_sync_index:
	- Do not create local repodir in metadir if it already exists.
	- Simplify the code thanks to new xbps_fetch_file().
2012-11-11 11:29:49 +01:00
Juan RP
f81d8ac1f0 xbps_pkgdb_update: if pkgdb cannot be internalized, create it to simplify code. 2012-11-11 10:03:14 +01:00
Juan RP
df0d5d7330 Get rid of pkg state half-unpacked; not-installed state is good enough. 2012-11-11 09:42:30 +01:00
Juan RP
d6735d5685 xbps_xasprintf: do not return NULL anymore; remove checks for this. 2012-11-11 09:37:27 +01:00
Juan RP
0ab60b24c5 xbps_fetch_file: enable fetchRestartCalls. 2012-11-08 09:49:03 +01:00
Juan RP
05984a31b1 xbps_rpool_sync: new arg to specify the file; bump XBPS_API_VERSION. 2012-11-07 10:37:58 +01:00
Juan RP
4e15230c93 repository_sync_index: fix swapped args passed to XBPS_STATE_REPOSYNC. 2012-11-07 10:18:58 +01:00
Juan RP
45b872f75e repository_sync_index: use arg[0-1] in XBPS_STATE_REPOSYNC. 2012-11-07 10:13:54 +01:00
Juan RP
ca095df52f libxbps: some tweaks for struct xbps_state_cb_data.
- Renamed args pkgname/version to arg0/arg1 to make them generic.
- Update bins with this and make some tweaks in state_cb.

Bumped API version.
2012-11-07 10:11:06 +01:00
Juan RP
310e619ea3 Remove unnecessary variable assignments reported by cppcheck. 2012-11-06 09:28:34 +01:00
Juan RP
03567ecb70 unpack: correctly take into account rootdir while checking symlinks. 2012-10-27 10:36:39 +02:00
Juan RP
978013bfbf unpack: match correctly symlinks with absolute path. 2012-10-27 09:42:26 +02:00
Juan RP
264c704529 unpack: do not use realpath(3) on uninstalled symlinks. 2012-10-27 09:36:28 +02:00
Juan RP
c28f882d5c unpack: misc improvements for previous. 2012-10-26 14:32:04 +02:00
Juan RP
c58ca952a8 unpack: convert printf added in previous to xbps_dbg_printf. 2012-10-26 14:22:18 +02:00
Juan RP
7fdae2d6dc unpack: handle another case of relative symlink. 2012-10-26 14:17:31 +02:00
Juan RP
d31a3d205a unpack: use lstat() for symlinks, respect uid/gid if euid == 0, some fixes. 2012-10-26 11:25:17 +02:00
Juan RP
e3d876ade0 pkgdb: some fixes for e545429fa1. 2012-10-26 11:05:17 +02:00
Juan RP
4023c8115b unpack: improvements to handle more cases of modified files.
- Do not unpack unmodified symlinks.
- Do not unpack files that only differ in mode, just chmod(2) new perms.
- Do not create pkg's metadata dir if this already exists.
2012-10-26 10:27:24 +02:00
Juan RP
e545429fa1 pkgdb: if plist from storage and memory do not differ do not flush to storage. 2012-10-26 10:25:14 +02:00
Juan RP
3e7f35bed1 xbps_configure_pkg: do not flush pkgdb if state hasn't been changed. 2012-10-26 10:24:26 +02:00
Juan RP
89dadb0f20 While checking conf files and there were no changes, do not unpack file from binpkg. 2012-10-26 10:23:12 +02:00
Juan RP
d99c505811 requiredby: skip adding same entry if already exists. 2012-10-26 09:44:07 +02:00
Juan RP
9e11ea950a Do not inherit unneeded objs from trans dictionary onto pkg's pkgdb dictionary. 2012-10-25 09:29:56 +02:00
Juan RP
863f12e349 Improved finding obsolete files while upgrading pkgs. 2012-10-24 07:45:00 +02:00
Juan RP
22a86d82f8 Added support for installing exact dependencies, i.e pkg X depends on 'Y-1.0_1'. 2012-10-09 07:35:59 +02:00
Juan RP
ebc0f27ae1 Do not add to the queue a pkgdep that has been already added via a vpkg.
The problem was after merging udev into systemd, udev is now a virtual pkg
and another dependency was requiring it and added systemd (real pkg) to
the list, but later in the sorting phase systemd was added again breaking
the dependency order.
2012-10-06 10:34:29 +02:00
Juan RP
c158acefac Revert "transaction: keep last dep and remove dup matches while sorting deps."
This reverts commit b764f8e19a.
2012-10-06 10:01:37 +02:00
Juan RP
b764f8e19a transaction: keep last dep and remove dup matches while sorting deps.
This bug has been uncovered due to udev -> systemd merge.
2012-10-06 09:21:26 +02:00
Juan RP
d38dfdd19a libxbps: unpack: before extracting re-set entry_pname. 2012-10-01 16:41:50 +02:00
Juan RP
bdeeaa46b8 libxbps: unpack: simplify file hash matching code. 2012-09-30 17:07:51 +02:00
Juan RP
7909f597cb xbps_path_from_repository_uri: do not look for binpkgs in repo arch dirs anymore. 2012-09-30 10:13:06 +02:00
Juan RP
5228b3fbf3 remove_obsoletes: deal with unexistent arrays in both dictionaries. 2012-09-30 08:57:57 +02:00
Juan RP
f7a4718de9 xbps_rpool_dictionary_metadata_plist: do not release dictionary without refcounts! 2012-09-30 08:10:49 +02:00
Juan RP
9c15f103e1 lib/package_unpack: simplify and externalize pkg's plists uncompressed. 2012-09-29 20:49:51 +02:00
Juan RP
092be04783 pkgdb: flush uncompressed pkgdb for performance reasons. 2012-09-29 20:28:39 +02:00
Juan RP
2f13afe7a6 lib/package_unpack.c: fixed build error caused by cherry-pick conflict. 2012-09-29 19:18:32 +02:00
Juan RP
54b6cc7ec1 xbps-{bin,repo}: add -B flag to set default repo if xbps.conf not found.
(cherry picked from commit 75eac1a1426040a833e0b10e208f2e55fa359532)
2012-09-29 19:10:48 +02:00
Juan RP
15e43e550b xbps_rpool_release: fix a memleak found by valgrind.
(cherry picked from commit 90e24f4b18fdde44958584cdc038ff8a88e919a0)
2012-09-29 19:10:28 +02:00
Juan RP
e370ff0625 libxbps: use a new bool in struct xbps_handle to track successful initialization.
(cherry picked from commit 03374950680f6a839b1ee2df8e3a4e1dfb110fa8)
2012-09-29 19:09:03 +02:00
Juan RP
9e5c7de33b xbps_dictionary_from_archive_entry: fixed internalizing uncompressed dictionaries.
(cherry picked from commit 2debc5c5ee6db1a197fe3afebaa9463934707b10)
2012-09-29 19:05:33 +02:00
Juan RP
0f17197627 libxbps: use a struct allocated from stack for the unpack cb.
(cherry picked from commit a658586f27fd0a0c2c78ea96f89b54055e1e73be)
2012-09-29 19:00:04 +02:00
Juan RP
01915e3030 xbps_transaction_update_packages: make packages on hold work (duh!).
(cherry picked from commit aa154199a6d7d89bfe040755be289b1d827c5727)
2012-09-29 18:58:21 +02:00
Juan RP
f7a5c55bc7 libxbps: xbps_pkg_arch_match: fix conditional tests. 2012-07-21 21:49:37 +02:00
Juan RP
a756060d38 libxbps: [unpack] fixed passing dangling pointer to unpack cb. 2012-07-21 10:41:19 +02:00
Juan RP
3339d0cd25 libfetch: fix warnings. 2012-07-19 18:00:31 +02:00
Juan RP
9edd60c3a7 libxbps: extend the list of symlinks in rootdir to be ignored. 2012-07-14 12:11:55 +02:00
Juan RP
2f1e975607 Added "install-date" object to pkg's pkgdb dictionary, make xbps-bin(8) print it. 2012-07-11 12:19:39 +02:00
Juan RP
11ecf5438f Import proplib-0.6.1. 2012-07-10 23:33:19 +02:00
Juan RP
34697e8022 libxbps: improve matching obsolete files, skip matches by hash and filename.
Don't remove top level symlinks (/bin, /sbin and /lib) if they were found
as obsoletes. This is a workaround for the system transition to /usr.
2012-07-10 23:22:25 +02:00
Juan RP
172435bd7e xbps_check_is_installed_pkg_by_pattern: do not reset errno, leave it as is. 2012-07-04 12:59:40 +02:00
Juan RP
94238302f2 transaction_ops: in update, check if curpkg has been previously added. 2012-07-04 11:56:01 +02:00
Juan RP
e879c71a02 transaction_sortdeps: check if dep is installed by pattern. 2012-07-04 11:55:51 +02:00
Juan RP
dfb45f27ef xbps_transaction_package_replace: misc cosmetic changes to dbg printfs. 2012-07-04 11:54:37 +02:00
Juan RP
abdf6e710d xbps_remove_pkg: do not pass dangling pointers to state cb after removing pkgdict. 2012-07-04 09:52:51 +02:00
Juan RP
54bc92bd97 xbps_dictionary_from_archive_entry: simplify and sync zlib code with proplib. 2012-06-20 09:26:00 +02:00
Juan RP
8abd275bfb libxbps: xbps_rpool_release: don't release repo_pool, it's already released. 2012-06-18 10:49:36 +02:00
Juan RP
c24ce8e4da libxbps: use memcpy in critical paths for performance, fixed some memleaks. 2012-06-18 10:43:05 +02:00
Juan RP
0f3d4f4a19 libxbps: hide compat symbols. 2012-06-18 09:52:19 +02:00
Juan RP
974b2fe8ad libxbps: simplify pkgdb_get_pkgd and find_pkg_dict_installed internals.
There's no need to prop_dictionary_copy the returned dictionary to
later have to free it again, just return directly the dictionary and
avoid the free(3)s.
2012-06-16 09:02:07 +02:00
Juan RP
068cab8d20 libxbps: performance improvements by caching the most accessed paths.
1- We can cache the result of the first xbps_pkgdb_init() when it fails
   and avoid the malloc/free/access from it.
2- We cache the uname(2) result into a private var in xbps_handle and
   use it in xbps_pkg_arch_match().

This improves performance by ~5% approx and it's close as it was before
introducing the repository index format 1.5.
2012-06-15 15:33:11 +02:00
Juan RP
506625a716 libxbps: also match vpkgs in previous commit. 2012-06-14 12:12:05 +02:00
Juan RP
302b216d8d libxbps: do not add dups to transaction dictionary due to virtual pkgs. 2012-06-14 11:53:27 +02:00
Juan RP
3e9e87fc2a libxbps: require a pointer to xbps_handle in functions that need it.
This removes 2 global vars from lib/initend.c and easier to know
what functions require access to xbps_handle.
2012-06-14 08:22:11 +02:00
Juan RP
a3adbcda95 libxbps: use prop_array_get_cstring_nocopy(). 2012-06-13 09:23:48 +02:00
Juan RP
412d4b7280 libxbps: switch to archive_read_{close,free}. 2012-06-12 22:22:46 +02:00
Juan RP
c61ba8dfcc Added support for package conflicts. 2012-06-11 16:14:03 +02:00
Juan RP
81610697df xbps_transaction_install_pkg: proper pkg find order in rpool.
Previously it was preferring virtual packages from
configuration file before real packages.
2012-06-09 10:09:46 +02:00
Juan RP
20bb1af589 xbps_remove_pkg: return proper error if metadata files cannot be removed. 2012-06-09 10:05:29 +02:00
Juan RP
e75a524ee3 xbps_transaction_install_pkg: on exact match properly detect if it's installed. 2012-06-05 22:54:46 +02:00
Juan RP
efefa000b2 xbps_dictionary_metadata_plist_by_url: only accept exact matches. 2012-06-05 20:53:15 +02:00
Juan RP
a0f91f3342 xbps_file_hash_check_dictionary: fixed for rootdir != /. 2012-06-05 20:51:00 +02:00
Juan RP
a00a450fe0 unpack: make sure to use exact file when checking for hash matches. 2012-06-05 20:23:12 +02:00
Juan RP
84c6850c28 xbps_file_hash_dictionary: only process exact matches. 2012-06-05 20:22:47 +02:00
Juan RP
cc30039c60 xbps_unpack_binary_pkg: handle ARCHIVE_{EOF,FATAL,RETRY} and use archive_read_{close,free}. 2012-06-05 16:46:50 +02:00
Juan RP
c37026d4c6 libxbps: require an underscore in strings to detect correctly pkgname/version. 2012-06-05 10:58:39 +02:00
Juan RP
9441f9f14b libxbps: multiple random changes for overall performance increase. 2012-06-04 23:22:33 +02:00
Juan RP
fa73de309f libxbps: remove xbps_find_pkg_dict_from_plist_by_xxx (unused). 2012-06-04 21:34:21 +02:00
Juan RP
e9945dc345 Before unpacking pkg files always remove INSTALL/REMOVE scripts (if they exist). 2012-06-04 14:14:46 +02:00
Juan RP
7265ea0e4e trans: do not increase download_size if binpkgs are in local repos. 2012-06-04 10:09:46 +02:00
Juan RP
34c1269504 Fixed installing exact pkg versions on pkgs with hyphens, we use equal sign as delimiter now. 2012-06-03 07:26:48 +02:00
Juan RP
f9c72e1d06 xbps_transaction_install_pkg: properly fix previous commit. 2012-06-02 17:39:36 +02:00
Juan RP
bd3a8982cc xbps-bin: added support to install exact pkg version, i.e 'foo-1.0'. 2012-06-02 17:35:21 +02:00
Juan RP
40864bcdce Improve xbps_transaction_update_pkg/packages and misc cosmetic changes. 2012-06-02 16:52:01 +02:00
Juan RP
c7e4630056 xbps_rpool_sync: ignore fetch errors, they will be reported by state_cb. 2012-06-01 16:04:47 +02:00
Juan RP
642e6fca3a xbps_rpool_sync: also fetch repository files index, removed accidently in previous. 2012-06-01 15:45:49 +02:00
Juan RP
981b13bd5a xbps-repo: 'sync' and 'pkg-list' target now accept a repository URI argument.
If set, only the matching repository will be used for the task.
2012-06-01 15:02:06 +02:00
Juan RP
652e9afcef libxbps: fixed xbps_remove_pkg_from_array_by_{name,pattern,pkgver}.
The correct index wasn't being passed to prop_array_remove.
2012-06-01 10:53:28 +02:00
Juan RP
7289547432 Welcome "repository index format 1.5". See NEWS for information. 2012-05-31 16:29:56 +02:00
Juan RP
1bfb1ae028 libxbps: move xbps_pkgpattern_match to util.c and simplify. 2012-05-30 22:38:35 +02:00
Juan RP
27aacf97f4 xbps_file_exec: simplify and don't chroot when rootdir == /.
Before that change we were chroot(2)ing even when rootdir was set to /.
2012-05-30 17:44:39 +02:00
Juan RP
a94dd5dbfa Revert "libxbps: implement xbps_file_exec() with posix_spawn()."
This reverts commit 5aa05f4c72.
2012-05-30 17:26:25 +02:00
Juan RP
5aa05f4c72 libxbps: implement xbps_file_exec() with posix_spawn(). 2012-05-30 14:45:47 +02:00
Juan RP
c93d1637ae lib/package_unpack.c: remove dead assignments found by clang-analyzer. 2012-05-30 14:22:16 +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
bbd0d893d0 xbps_repository_sync_index: print the plist file being downloaded in cb. 2012-05-06 09:10:25 +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
934bc4869e rpool: make xbps_handle::repo_pool array immutable after initialization. 2012-04-13 10:06:08 +02:00
Juan RP
8b2c4ed47e xbps_dictionary_from_metadata_plist: if vpkg not found, look for a real pkg. 2012-04-13 09:23:35 +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
53d28fcb35 rpool: miscellaneous improvements to _init() and _release().
xbps_repository_pool_init:
 - Avoid unnecessary extra access(2) syscall when internalizing
   repository index plist files.
xbps_repository_pool_release:
 - Make sure to release internalized repository index arrays.
2012-04-12 11:54:11 +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
4511e581b2 xbps_configure_pkg: improve error messages. 2012-03-31 10:08:52 +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
48c36602a5 Simplify even more previous commit. 2012-03-11 17:26:41 +01:00
Juan RP
35b1932416 Apply correctly fix to match_any_virtualpkg_in_rundeps(). 2012-03-11 17:18:33 +01:00
Juan RP
ca03127a82 Revert "xbps_match_any_virtualpkg_in_rundeps: break correctly from inner loop on match."
This reverts commit 31b1975b1e.

Revert experimental changes to repository_finddeps.c.
2012-03-11 17:16:58 +01:00
Juan RP
31b1975b1e xbps_match_any_virtualpkg_in_rundeps: break correctly from inner loop on match. 2012-03-11 17:15:49 +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
af9bd15af7 xbps_init: set xhp->conffile to NULL if conf file cannot be read. 2012-03-05 17:33:36 +01:00
Juan RP
4b02a75629 xbps_init: fix a typo when checking for the configuration file. 2012-03-05 17:29:02 +01:00
Juan RP
216673aa4a Fixed 'xbps-bin reconfigure all' regression added in 0.13. 2012-02-28 21:16:41 +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
001947d9bb Only enable support for gzip, bzip2 and xz compression formats.
After looking at profiling output I saw that a not so small of time spent
was in libarchive trying to know if archive is zip compressed... so
I've enabled the three compression formats supported by xbps-src.
2012-02-22 04:16:36 +01:00
Juan RP
485a62e221 Simplify xbps_repository_pool_find_pkg internals for best match case. 2012-02-22 03:58:41 +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
a5c0513686 portableproplib: fix gzFile to make it work with zlib-1.2.6. 2012-02-16 08:51:00 +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
d8e7ed0a23 xbps_repository_pool_foreach: simplify internals. 2012-02-01 02:30:23 +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
cfae783f64 xbps_init: avoid using a global var. 2012-01-26 11:43:35 +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
7dfc01b7a6 Calculate required/freed size for updates in transactions too. 2012-01-25 05:10:24 +01:00
Juan RP
1a73b93d63 Calculate properly required/freed size in transactions. 2012-01-25 04:56:54 +01:00
Juan RP
ff0b9b9b59 transaction_find_pkg: warning due to uninitialized var. 2012-01-25 02:18:15 +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
ec764ffec8 xbps_transaction_package_replace: improved debug output. 2012-01-24 18:43:43 +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
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
4758635f15 xbps_find_pkg_orphans: make returned array immutable. 2012-01-21 10:21:01 +01:00
Juan RP
1781231454 xbps_repository_pool_init: make registered index arrays immutable. 2012-01-21 10:20:45 +01:00
Juan RP
8c8273d3ed pkgdb: update copyright year, shorter conditional. 2012-01-20 18:37:08 +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
3f9477417b xbps_set_cb_xxx: simplify by using vars on the stack. 2012-01-20 12:29:14 +01:00
Juan RP
d075411049 Improve API documentation round 1. 2012-01-20 12:17:27 +01:00
Juan RP
6057bd83b3 Update pkgdb dot file with latest changes. 2012-01-20 11:16:07 +01:00
Juan RP
8d23ace0da Rename lib/regpkgdb_dictionary.c to lib/pkgdb.c. 2012-01-20 11:12:53 +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