Commit Graph

63 Commits

Author SHA1 Message Date
Duncan Overbruck
0d90534236
libxbps: ABI/API break due to hash function changes 2020-02-10 13:32:17 +01:00
Juan RP
6010a24de6 libxbps: ABI/API break due to xbps_pkg{,pattern}_name changes.
The funcs xbps_pkg_name() and xbps_pkgpattern_name() were
using malloc(3) to return the result, until now.

They now have been changed to not allocate the result
via malloc, the caller is responsible to provide a buffer
at least of XBPS_NAME_SIZE (64).

If for whatever reason the pkgname can't be guessed,
returns false. This should avoid lots of small allocs
around libxbps.

New functions have the following prototype:

bool xbps_pkg_name(char *dst, size_t len, const char *pkg)
bool xbps_pkgpattern_name(char *dst, size_t len, const char *pkg)

as suggested by @duncaen.
2020-02-08 19:49:57 +01:00
Juan RP
b4fdc39e67
Revert "Sign repodata"
This reverts commit 04194f44c8.
2020-01-06 14:31:40 +01:00
Juan RP
d1c93bed52
xbps-rindex: stop adding the "build-date" pkg obj.
This was just setting the current date when the pkg
is being added to the repository index.

It does not make any sense, so get rid of it completely.

This "build-date" string obj needs to be added via
xbps-create(1) not xbps-rindex(1)!

Another step towards reproducability (#55)
2019-12-29 09:57:54 +01:00
Piotr Wójcik
04194f44c8 Sign repodata 2019-11-02 11:53:14 +01:00
Juan RP
0677678387 Added LTO support and fix warnings (maybe-uninitialized). 2019-06-27 18:09:26 +02:00
Juan RP
6c1759862e
xbps-rindex: added --compression option and set zstd by default.
Multiple compression formats are now supported for repodata,
none, gzip, bzip2, xz, lz4 and zstd.
2019-06-17 07:24:05 +02:00
Enno Boland
a717e53ee7 xbps-rindex: fix staging deadlock. 2018-06-28 13:30:14 +02:00
Duncaen
81673d69c7 bin/xbps-rindex: fix memleaks in index_add 2016-09-25 21:27:38 +02:00
Enno Boland
ba2074a1cc xbps-rindex: use consistent output format 2016-03-31 08:10:14 +02:00
Enno Boland
855bc915e5 xbps-rindex: replace puts calls with printf 2016-03-22 09:47:25 +01:00
Enno Boland
4d1ee3b01d xbps-rindex: check for consistent shlibs
When adding packages to the index, xbps-rindex will check if the
consistency of shlibs is broken by a package. If so, rindex will create
a stage file and commit the packages there. Once the consistency is restored,
rindex -a will commit the stage area back to the public repo and delete the
stage file.
2016-03-21 08:31:18 +01:00
Enno Boland
897ac238c4 Revert "xbps-rindex: check for consistent shlibs"
This reverts commit 5f4e1ad43e which was
accidently checked in in the master branch.
2016-03-20 21:40:22 +01:00
Enno Boland
5f4e1ad43e xbps-rindex: check for consistent shlibs
When adding packages to the index, xbps-rindex will check if the
consistency of shlibs is broken by a package. If so, rindex will create
a stage repository and commit the packages there. Once the consistency
is restored, rindex -a will commit the stage area back to the public
repo and delete the stage file.
2016-03-20 21:36:30 +01:00
Enno Boland
69ee33c592 xbps-rindex: set build-date from mtime in repository-index. 2015-09-03 09:20:04 +02:00
Juan RP
b459e4542f xbps-rindex: eliminate locking and update repo index immutable dicts. 2015-05-22 12:20:49 +02:00
Juan RP
9a16283575 Introduce xbps_repo_{un,}lock() to serialize write access to repodata.
We use a simple file lock that is created with O_CREAT|O_EXCL.
This should fix the concurrency issues with multiple processes
running xbps-rindex -a/-c on the same repository/arch combo.
2015-03-25 12:00:59 +01:00
Juan RP
b23855f692 xbps_repo_close: only unlock the file lock if repo was opened as such.
If xbps_repo_open() was called with the lock arg set, xbps_repo_close()
will now unlock the repo file lock, without the need to set it.

This avoids the need to always unlock the file lock even if it wasn't
locked previously. This also introduceds an ABI/API break, but this
way it's cleaner.
2015-01-11 09:11:38 +01:00
Juan RP
925ec15c3d xbps-rindex: do not add "packaged-with" obj to the index.
With our current xbps-src it's unnecessary because the current git
revision is already recorded in "source-revisions".
2014-12-09 12:41:33 +01:00
Juan RP
1789e527a9 Gratuitous ABI break: xbps_binpkg_get_xxx() -> xbps_archive_fetch_xxx(). 2014-11-21 09:51:57 +01:00
Juan RP
a6516505e9 xbps-query(8: added --cat=FILE mode support.
- This mode prints to stdout the matching FILE stored in a binary package.
- ABI break: renamed xbps_get_pkg_plist_from_binpkg() xbps_binpkg_get_plist().
- Added xbps_binpkg_get_file() as a generic way to get pkg file contents.
- Removed useless comments from xbps_api_impl.h.
2014-11-17 15:45:46 +01:00
Juan RP
3afb9d709d Get rid of repodata index-files; the archive is now 8x smaller.
See the NEWS file for more information.
2014-11-13 17:09:43 +01:00
Juan RP
84be0dcd8b xbps-rindex: use correct argv index. 2014-11-06 11:33:04 +01:00
Juan RP
d4374fb9af xbps-rindex: fix CID 62741 correctly (untrusted value as argument) 2014-10-07 10:11:14 +02:00
Juan RP
5bec421726 bin/xbps-rindex/index-add.c: add assertions to make coverity happy (CID 62741) 2014-10-06 17:13:06 +02:00
Juan RP
54b72d8f81 bin/xbps-rindex/index-add.c: fix CID 62685 correctly. 2014-10-05 09:35:42 +02:00
Juan RP
3b0917c24a bin/xbps-rindex/index-add.c: use-after-free (CID 62764) 2014-10-05 09:23:03 +02:00
Juan RP
ced1ce4b40 bin/xbps-rindex/index-add.c: resource leak (CID 62685) 2014-10-05 08:06:12 +02:00
Juan RP
62cb6f14e6 bin/xbps-rindex/index-add.c: resource leak (CID 62718) 2014-10-05 07:31:07 +02:00
Enno Boland
78203c1735 bin/xbps-rindex: fix adding packages with reverts. 2014-09-23 19:14:45 +02:00
Enno Boland
50fb6c1605 rename xbps_pkgver_is_reverted to xbps_pkg_reverts 2014-09-23 13:54:06 +02:00
Enno Boland
ebd614dff6 bin/xbps-rindex: take the revert field in account.
- if the user wants to add a package which is older than the
  one in the index, xbps-rindex will check if the package
  reverts the one on the index. If so the package will be added
  regardless of its version

- if the user wants to add a package which is newer than the
  one on the index, xbps-rindex will check if the package on the
  index reverts the one the user wants to add. If so the package
  will be skipped regardless of its version.
2014-09-23 13:54:06 +02:00
Juan RP
dee7852af8 xbps-rindex: fix -a/--add mode repodata archive permissions.
The repodata archive wasn't group writable, resulting in a new archive
created from scratch if the fd wasn't writable.

repodata archives are now created with 0664 mode, this way its main group
also can write to it.
2014-09-15 12:15:42 +02:00
Juan RP
013731c502 Acquire/release a POSIX file lock on repository archives.
- xbps_repo_open() accepts a third argument (bool) to acquire a POSIX file
lock on the repository archive.
- xbps_repo_close() accepts a second argument (bool) to release a POSIX file
lock on the repository archive.

This avoids the issue of multiple xbps-rindex(8) processes being blocked
even for different repositories on the same architecture, resulting in
unnecessary contention.
2014-09-05 12:26:42 +02:00
Juan RP
119d059c9b bin/xbps-rindex/index-add.c: fix a mistake in previous cleanups. 2014-04-20 10:36:17 +02:00
Juan RP
dacbb2f22f Fixed some warnings reported by clang. 2014-04-20 10:02:54 +02:00
Juan RP
4f7385e4a6 xbps-rindex: switch named semaphore only for the target architecture. 2014-01-31 18:44:24 +01:00
Juan RP
f5e1fff93a xbps-rindex: use a POSIX named semaphore to avoid concurrency issues. 2014-01-31 11:35:31 +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
3ca442eb3d xbps-rindex: [add] re-add all package objects to the index. 2013-12-30 10:27:54 +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
7c57918950 xbps-rindex(8): fix #24 and added an ATF test case. 2013-11-29 17:30:45 +01:00
Juan RP
ae8925d907 xbps-rindex: in add mode also remove old entry from index-files. 2013-11-25 11:03:51 +01:00
Juan RP
ab5b356b5b xbps-rindex: initialize idxfiles in repo to access to it. 2013-10-18 09:36:25 +02:00
Juan RP
f3b0b19258 xbps-rindex: remove -c --clean mode and adapt to the new libxbps API.
- Removed -c --clean mode. It's not too useful and adds a considerable
  amount of gratuitous code. It takes almost the same time than
  adding all pkgs from scratch.

- When creating the repository data always add the meta plist at the
  2nd position in the archive, to optimize its access.

- Misc improvements.
2013-10-07 10:23:14 +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
af4e90aae8 xbps-rindex: register pkgs in index-files by pkgname and use xbps_array_foreach_cb().
This simplifies accessing/removing pkgs in this dictionary.
2013-09-16 10:41:42 +02:00
Juan RP
98e1687ef5 Re-add all pkg metadata objects to the repository index. 2013-09-16 09:09:56 +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
09e116b7f0 xbps_api.h -> xbps.h 2013-06-20 12:31:02 +02:00