Commit Graph

60 Commits

Author SHA1 Message Date
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
04194f44c8 Sign repodata 2019-11-02 11:53:14 +01:00
0677678387 Added LTO support and fix warnings (maybe-uninitialized). 2019-06-27 18:09:26 +02:00
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
a717e53ee7 xbps-rindex: fix staging deadlock. 2018-06-28 13:30:14 +02:00
81673d69c7 bin/xbps-rindex: fix memleaks in index_add 2016-09-25 21:27:38 +02:00
ba2074a1cc xbps-rindex: use consistent output format 2016-03-31 08:10:14 +02:00
855bc915e5 xbps-rindex: replace puts calls with printf 2016-03-22 09:47:25 +01:00
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
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
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
69ee33c592 xbps-rindex: set build-date from mtime in repository-index. 2015-09-03 09:20:04 +02:00
b459e4542f xbps-rindex: eliminate locking and update repo index immutable dicts. 2015-05-22 12:20:49 +02:00
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
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
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
1789e527a9 Gratuitous ABI break: xbps_binpkg_get_xxx() -> xbps_archive_fetch_xxx(). 2014-11-21 09:51:57 +01:00
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
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
84be0dcd8b xbps-rindex: use correct argv index. 2014-11-06 11:33:04 +01:00
d4374fb9af xbps-rindex: fix CID 62741 correctly (untrusted value as argument) 2014-10-07 10:11:14 +02:00
5bec421726 bin/xbps-rindex/index-add.c: add assertions to make coverity happy (CID 62741) 2014-10-06 17:13:06 +02:00
54b72d8f81 bin/xbps-rindex/index-add.c: fix CID 62685 correctly. 2014-10-05 09:35:42 +02:00
3b0917c24a bin/xbps-rindex/index-add.c: use-after-free (CID 62764) 2014-10-05 09:23:03 +02:00
ced1ce4b40 bin/xbps-rindex/index-add.c: resource leak (CID 62685) 2014-10-05 08:06:12 +02:00
62cb6f14e6 bin/xbps-rindex/index-add.c: resource leak (CID 62718) 2014-10-05 07:31:07 +02:00
78203c1735 bin/xbps-rindex: fix adding packages with reverts. 2014-09-23 19:14:45 +02:00
50fb6c1605 rename xbps_pkgver_is_reverted to xbps_pkg_reverts 2014-09-23 13:54:06 +02:00
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
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
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
119d059c9b bin/xbps-rindex/index-add.c: fix a mistake in previous cleanups. 2014-04-20 10:36:17 +02:00
dacbb2f22f Fixed some warnings reported by clang. 2014-04-20 10:02:54 +02:00
4f7385e4a6 xbps-rindex: switch named semaphore only for the target architecture. 2014-01-31 18:44:24 +01:00
f5e1fff93a xbps-rindex: use a POSIX named semaphore to avoid concurrency issues. 2014-01-31 11:35:31 +01:00
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
3ca442eb3d xbps-rindex: [add] re-add all package objects to the index. 2013-12-30 10:27:54 +01:00
ec0d38c469 Implement per pkg RSA signatures and on-demand repository access. 2013-12-24 10:43:55 +01:00
7c57918950 xbps-rindex(8): fix #24 and added an ATF test case. 2013-11-29 17:30:45 +01:00
ae8925d907 xbps-rindex: in add mode also remove old entry from index-files. 2013-11-25 11:03:51 +01:00
ab5b356b5b xbps-rindex: initialize idxfiles in repo to access to it. 2013-10-18 09:36:25 +02:00
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
8d5c48b861 Added support for the long awaited feature: RSA signed repositories. 2013-10-05 11:38:04 +02:00
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
98e1687ef5 Re-add all pkg metadata objects to the repository index. 2013-09-16 09:09:56 +02:00
4057e4961c Use C99 for loop initializers.
That means that a C99 compiler is now mandatory.
2013-09-15 10:06:49 +02:00
09e116b7f0 xbps_api.h -> xbps.h 2013-06-20 12:31:02 +02:00
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
02a11ed08c xbps-rindex: add: remove unused headers; prop_array_count checks for NULL pointers. 2013-06-19 09:20:44 +02:00
db1efb3aa6 Relax memory requirements on 64bit platforms; fix two memleaks. 2013-06-12 10:04:10 +02:00