Commit Graph

895 Commits

Author SHA1 Message Date
Juan RP
2a21354a1c Make some reorganization in struct xbps_handle.
The variables to set cachedir, rootdir and metadir have been
changed to "array of chars", this way there are no extra allocations.

Update clients accordingly and bump API version.
2013-12-16 11:46:39 +01:00
Juan RP
2c16e23646 lib/transaction_sortdeps.c: bump copyright year. 2013-12-16 09:18:54 +01:00
Juan RP
a84d7c0199 lib/transaction_sortdeps.c: remove dead code. 2013-12-16 09:18:19 +01:00
Juan RP
67cfc4ebad rpool: switch "struct xbps_repo" to be part of the rpool simpleq.
The previous internal "struct rpool" was an extra structure that
can be avoided by just using "struct xbps_repo" directly.

This makes rpool use (at least) 4KB less per repository and 1
extra allocation.
2013-12-16 08:49:33 +01:00
Juan RP
b1309644e5 lib/transaction_sortdeps.c: there's no need to use TAILQ_FOREACH_SAFE. 2013-12-16 08:44:14 +01:00
Juan RP
851eb26596 xbps_repo_open: fix f7b4587 and really pass the correct size this time. 2013-12-16 07:45:51 +01:00
Juan RP
f7b4587e11 xbps_repo_open: pass the correct size to realloc(). 2013-12-16 07:31:15 +01:00
Juan RP
cc19818680 Improve stats in the transaction dictionary. 2013-12-16 07:24:17 +01:00
Juan RP
ec6f7a3013 lib/transaction_dictionary.c: modify how transaction stats are computed. 2013-12-14 04:54:52 +01:00
Juan RP
2ab90bdc09 Fixed issue #26 (Replacing an installed pkg multiple times). 2013-12-12 18:24:24 +01:00
Juan RP
865dffde58 xbps_repo_open: switch to archive_read_data_block() and misc tweaks. 2013-12-12 00:18:08 +01:00
Juan RP
4f6fb2ff67 lib/rpool_get.c: move asserts to the parent function. 2013-12-08 08:08:26 +01:00
Juan RP
d95d5ba113 xbps_array_foreach_cb_multi: remove useless mutex. 2013-12-08 08:07:45 +01:00
Juan RP
2c9ab6a1f2 xbps_pkgdb_get_pkg_metadata: avoid an extra function call. 2013-12-08 08:07:10 +01:00
Juan RP
2d5a8dee19 xbps_find_pkg_orphans: minor optimizations. 2013-12-08 08:06:28 +01:00
Juan RP
e23c64bc84 lib/portableproplib: fixes to allow building with NDEBUG (assert()s disabled). 2013-12-06 11:54:34 +01:00
Juan RP
ae9363b620 lib/plist_fetch.c: fix a memleak in error path. 2013-12-05 16:55:26 +01:00
Juan RP
4403caa434 Add repos set in xbps_handle::repositories to the top of the list.
That means that now xbps-install(8) and xbps-query(8) --repository
option does not override the repository list of a configuration file.
2013-12-04 16:59:15 +01:00
Juan RP
d98468515a Fix #25 correctly: compare against repo->signature. 2013-11-30 08:30:25 +01:00
Juan RP
dce26db1de libxbps: pkg remove: never remove base symlinks in the root directory.
The /bin, /sbin, /lib, /lib32, /lib64, /var/run symlinks should never be removed
in Void, so be safe and ignore the removal of them.

Added another test to the testsuite to verify its correctness.
2013-11-28 10:27:36 +01:00
Juan RP
4e427ded92 xbps_file_hash: simplify and use read(2). 2013-11-26 13:08:44 +01:00
Juan RP
a30623c65c Revert "lib/util_hash.c: xbps_file_hash: remove unnecessary memset() call."
This reverts commit febc673f1e.
2013-11-26 10:40:53 +01:00
Juan RP
5a7eb2255d Revert "lib/download.c: xbps_fetch_file: remove unnecesary memset() calls."
This reverts commit 74970f2e92.
2013-11-26 10:31:16 +01:00
Juan RP
79bf795e1a lib/package_unpack.c: make clang stfu due to -Wmissing-field-initializers. 2013-11-19 10:39:46 +01:00
Juan RP
8d7c899d48 lib/package_unpack.c: initiliaze struct rather than memset. 2013-11-18 18:23:31 +01:00
Juan RP
74970f2e92 lib/download.c: xbps_fetch_file: remove unnecesary memset() calls. 2013-11-18 18:20:41 +01:00
Juan RP
febc673f1e lib/util_hash.c: xbps_file_hash: remove unnecessary memset() call. 2013-11-18 18:12:58 +01:00
Juan RP
ef67a79419 lib/repo_keys.c: remove unnecessary OpenSSL_add_all_xxx() calls. 2013-11-18 17:35:09 +01:00
Juan RP
8882b0215f Redo how the repository keys are stored.
- Repository keys are now stored in a new directory on metadir (/var/db/xbps):

	<metadir>/key>

- Repository keys are stored with the hex fingerprint of its RSA
  public key in a plist dictionary:

	<metadir>/keys/xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.plist

- Drop xbps-rkeys(8) and merge its functionality into xbps-install(8) and
  xbps-query(8).

- xbps-query(8) -vL now shows some more details of remote repositories:

 3134 http://localhost:8000 (RSA signed, verified)
      Signed-by: Void Linux
      4096 60:ae:0c:d6:f0:95:17:80:bc:93:46:7a:89:af:a3:2d
   16 http://localhost:8000/nonfree (RSA signed, verified)
      Signed-by: Void Linux
      4096 60:ae:0c:d6:f0:95:17:80:bc:93:46:7a:89:af:a3:2d

Bump XBPS_API_VERSION.
2013-11-18 16:05:46 +01:00
Juan RP
c9825feb29 util.c: add stricter checks for pkgver conformance (v2).
There was another case where it now was failing: "fs-utils-v1.00_1".

Previous code didn't take into account that a valid version might also
contain a non digit after '-'.

Added more tests to the testsuite to verify its correctness.
2013-11-17 12:25:02 +01:00
Juan RP
c44d7070a4 util.c: add stricter checks for pkgver conformance.
Make xbps_pkg_{name,version} return NULL if next character
after the last '-' character is not a digit, and if there's a digit
make sure that there exists a '_' character too.

Added more tests to the testsuite to catch this. With these changes
'python-e_dbus' is properly detected and validated.
2013-11-17 11:34:14 +01:00
Juan RP
d0380d5cd2 lib/package_remove.c: add a bit of debugging if pkg wasn't found in pkgdb. 2013-11-17 11:33:16 +01:00
Juan RP
44533f9f57 lib/package_unpack.c: compute unpack cb stats only once. 2013-11-15 10:36:31 +01:00
Juan RP
6d9bb47fba unpack: make sure to remove only on-disk files if file type does not match.
Added another ATF test-case to make sure it works properly.
2013-11-09 08:59:02 +01:00
Juan RP
efdb0eb5a4 lib/pubkey2fp.c: style tweak. 2013-11-08 12:28:01 +01:00
Juan RP
53ecaf9819 Remove xbps_print_hexfp() from API and move it xbps-rindex, where it belongs. 2013-11-08 09:12:29 +01:00
Juan RP
0909c81cdb xbps_pubkey2fp: simplify and eliminate the extra copy of returned data type. 2013-11-08 09:10:40 +01:00
Juan RP
89ab9a4b0c xbps_repo_key_import: check that returned hex fingerprint is not NULL. 2013-11-08 09:09:35 +01:00
Juan RP
8f36f8e638 Make sure that configuration files are properly kept or unpacked.
Added two new test cases to verify it works as advertised.
2013-11-06 10:45:33 +01:00
Juan RP
c1fafcd339 Fix #20 and added an ATF test-case. 2013-11-05 09:56:36 +01:00
Juan RP
f09eab62cd Fix #18. An ATF test-case will be imported in a while. 2013-11-01 18:05:11 +01:00
Juan RP
747f250202 unpack: apply correctly file permissions to existent files.
Will be backported to the 0.26.x branch.
2013-10-30 12:02:16 +01:00
Juan RP
0247b49f86 xbps_repo_key_import: ignore local repos. 2013-10-28 12:51:03 +01:00
Juan RP
aad0502b95 xbps_repo_key_import: also print repourl in state cb. 2013-10-15 09:58:51 +02:00
Juan RP
a5ecaa493f New utility: xbps-rkeys(8) to manage RSA public keys. 2013-10-09 10:13:07 +02:00
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