Commit Graph

383 Commits

Author SHA1 Message Date
Juan RP
79fe312302 Gather proper transaction stats (take into account binpkgs in cachedir, and "preserved" pkgs). 2014-07-13 09:56:06 +02:00
Juan RP
e60677116d Fix #43 (xbps-install: unhelpful message for invalid dependency)
If a package that is going to be installed or updated contains invalid
dependencies return ENXIO and XBPS_STATE_INVALID_DEP xbps state to clients.

This improves the error messages returned to the clients when such
condition happens.
2014-07-02 10:59:25 +02:00
Juan RP
6bb61adb0e Enable syslog logging by default; updated API to use xbps_handle::flags. 2014-06-04 09:39:02 +02:00
Juan RP
776865b548 Added support for system/config virtualpkg.d directories.
The system virtualpkg directory set to <rootdir>/usr/share/xbps/virtualpkg.d contains
virtualpkg configuration files (.conf/.vpkg) that can be overrided by the admin
in <rootdir>/etc/xbps/virtualpkg.d bearing the same file name.

This obsoletes the "virtualpkgdir" keyword support from the xbps configuration file.
2014-05-31 07:05:57 +02:00
Juan RP
387987b146 Make system/config repo.d paths always relative to rootdir. 2014-05-31 06:44:07 +02:00
Juan RP
23fef46e9e Implemented GH #39
The system repository directory set to <prefix>/share/xbps/repo.d contains
system repository configuration files (.conf) that can be overrided by the admin
in <sysconfdir>/xbps/repo.d bearing the same file name.
2014-05-30 11:48:10 +02:00
Juan RP
bb491e2667 libxbps: detect and ignore incorrect deps of a pkg if those are virtual pkgs. 2014-04-20 16:54:50 +02:00
Juan RP
0416b067d0 Use a POSIX lock for pkgdb and only issue pkgdb writes in exact points.
- Rather than using a POSIX named semaphore use a POSIX lock (lockf(3))
for pkgdb for writers. Writers that cannot acquire the pkgdb lock will
get EAGAIN rather then being blocked.

- Due to using a file lock we cannot write the pkgdb every time a package
is being unpacked, configured or removed. Instead pkgdb is only written
at the end of a specific point in the transaction (unpack, configure, remove)
or via xbps_pkgdb_unlock().
2014-03-04 14:37:10 +01:00
Enno Boland
59ee6b6733 Adding xbps_fetch_file_dest().
This function is similiar to xbps_fetch_file(). In contrast to xbps_fetch_file()
xbps_fetch_file_dest has an extra paramenter which allow to define an output file
for the request.
2014-03-04 14:19:52 +01:00
Juan RP
b980e2109f include/xbps_api_impl.h: confuse.h is not necessary anymore. 2014-02-25 17:04:13 +01:00
Juan RP
f74bf1c1c8 New custom configuration file format that does not need confuse. 2014-02-25 16:42:52 +01:00
Juan RP
4d1cdcac0c Fix concurrency issues in pkgdb: only allow 1 write transaction at the same time.
This implementation relies on a POSIX named semaphore, which is also
required by xbps-rindex(8).
2014-02-23 08:23:14 +01:00
Juan RP
596a8c199f Improve two phase pkg removal: do the check for all entry types. 2014-02-09 12:53:15 +01:00
Juan RP
d08e76a386 Keep repo metadata if possible when updating repodata (xbps-rindex -a/-c).
API/ABI incompat changes, you've been warned.
2014-01-30 13:07:34 +01:00
Juan RP
5eea259c13 Remove the config.h kludge and override vasprintf detection via HAVE_VASPRINTF. 2014-01-20 18:50:33 +01:00
Juan RP
804a39c63b Added XBPS_ARCH environment var to override uname(2) machine result. 2014-01-09 11:41:25 +01:00
Juan RP
3042dcd7aa include/xbps_api_impl.h: remove __{BEGIN,END}_DECLS to make musl happy. 2014-01-07 21:19:03 +01:00
Juan RP
d3ffd0885b xbps.h: drop PATH_MAX completely and use our own definition. 2013-12-29 16:56:43 +01:00
Juan RP
8eb1d3889f Don't redefine _XOPEN_SOURCE and set it to 700 as previously. 2013-12-29 16:49:24 +01:00
Juan RP
1acce163ce xbps.h: define _XOPEN_SOURCE for PATH_MAX. 2013-12-29 16:45:53 +01:00
Juan RP
35e4182250 Fully remove the obsolete softreplace code. 2013-12-25 11:12:52 +01:00
Juan RP
ec0d38c469 Implement per pkg RSA signatures and on-demand repository access. 2013-12-24 10:43:55 +01:00
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
e64227b617 xbps.h: drop requirement of sys/queue.h. 2013-12-16 08:59:11 +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
1f16a22791 Add NDEBUG to CPPFLAGS if --enable-debug is unset. 2013-12-06 11:55:08 +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
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
2952c69c7a Define NDEBUG for assert() if --enable-debug is not specified. 2013-11-08 09:11:47 +01: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
0db47cff9c Always build with DEBUG and enable assertions. 2013-10-07 08:20:42 +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
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
24ff0472dd Use fs blksize from stat(2)ed file when reading archives. 2013-08-29 14:30:14 +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
1999fbd771 Relax libarchive version requirement to 2.8.0. 2013-08-16 10:26:36 +02:00
Juan RP
84d14286a8 More libarchive-2.x compat. 2013-08-15 11:55:20 +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
1d0a5faff0 include/xbps.h.in: xbps_api.h -> xbps.h 2013-06-29 06:46:46 +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
09e116b7f0 xbps_api.h -> xbps.h 2013-06-20 12:31:02 +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
4ef66d99bb Drop requirement of confuse header for the public API; it's only used by libxbps. 2013-06-19 11:29:04 +02:00
Juan RP
d419f8ac2a Move fetch.h to lib/fetch. 2013-06-19 11:03:03 +02:00
Juan RP
0d22fe362c Increase default libfetch cache limits. 2013-06-19 09:39:39 +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
5f2bba7f4e Move functionality to resolve revdeps from repos to libxbps. 2013-06-14 08:13:51 +02:00