Commit Graph

139 Commits

Author SHA1 Message Date
Juan RP
36026451ce Fix some insecure temporary files reported by Coverity. 2015-07-26 09:02:04 +02:00
Juan RP
ffbdfeef63 xbps-rindex/index-clean: fix a minor resource leak (CID #98689). 2015-07-26 08:38:12 +02:00
Juan RP
582de078f4 xbps-rindex/sign: ignore fstat(2) return value (CID #98679). 2015-07-26 08:21:00 +02:00
Juan RP
5f56b130fc xbps-rindex/index-clean: fix a resouce leak (CID #98689). 2015-07-26 08:17:17 +02:00
Juan RP
7d7f08b559 xbps-rindex/sign: fix a resource leak (CID #98687). 2015-07-26 08:12:22 +02:00
Juan RP
9d70fcd8d0 xbps-rindex/index-clean: handle possible NULL pointer derefs (CID #98685). 2015-07-26 08:06:38 +02:00
Juan RP
97c8eb0c36 xbps-rindex: fix a double close (CID #98694). 2015-07-26 07:59:16 +02:00
Juan RP
d86cece411 xbps-rindex(1): add support to sign specific pkgs, not the whole repo.
See NEWS for more information.
2015-06-04 16:01:43 +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
fcdd71aac4 Move xbps utils manpages to the section 1 (user commands). 2015-05-16 09:46:10 +02:00
Juan RP
3ef9350787 xbps-rindex/clean: simplify. 2015-04-09 12:14:03 +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
927254c43e xbps-rindex(8): fix -s short option (omitted in shortopts). 2015-03-03 16:10:03 +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
395e147c6c xbps.d(5) - XBPS configuration directory 2014-12-09 11:41:35 +01:00
Juan RP
c8d91348a1 xbps-rindex.8: improve -s --sign mode. 2014-12-06 11:23:41 +01:00
Juan RP
a71e428610 xbps-rindex.8: clarify abs paths, detail -f with -a. 2014-11-29 08:27: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
51ec53846c xbps-rindex: added 'd' to shortopts. 2014-11-06 11:14:29 +01:00
Juan RP
40c3e048b0 xbps-rindex: added -d/--debug option. 2014-11-06 10:54:52 +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
4a188a433a bin/xbps-rindex/index-clean.c: CID 62708 (NULL pointer dereference) 2014-10-07 07:50:03 +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
b96d1c9f4e bin/xbps-rindex/sign.c: CID 62699 (dereference NULL return value) 2014-10-05 13:20:18 +02:00
Juan RP
d006d60497 bin/xbps-rindex/index-clean.c: use-after-free (CID 62752) 2014-10-05 09:47:48 +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
b5713ecf12 bin/xbps-rindex/remove-obsoletes.c: resource leak (CID 62695) 2014-10-05 07:40:18 +02:00
Juan RP
73e81addba bin/xbps-rindex/remove-obsoletes.c: resource leak (CID 62707) 2014-10-05 07:34:15 +02:00
Juan RP
62cb6f14e6 bin/xbps-rindex/index-add.c: resource leak (CID 62718) 2014-10-05 07:31:07 +02:00
Juan RP
966718bb7d bin/*/*.8: fixed mdoc errors/warnings reported by mandoc -Wall. 2014-09-30 11:36:08 +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
567382c3a2 xbps-rindex: fix musl build: needs -lcrypto explicitly. 2014-09-14 20:01:05 +02:00
Juan RP
287665009b Drop unused headers. 2014-09-13 08:54:12 +02:00
Juan RP
d7d749312d xbps-rindex: use xbps_binpkg_{arch,pkgver} for -r (remove-obsoletes).
This is magnituds faster than before; some results:

$ for f in 1 2 3; do time xbps-rindex -r /var/cache/xbps/ &>/dev/null; done

real 0m0.624s
user 0m2.163s
sys 0m0.032s

real 0m0.590s
user 0m2.159s
sys 0m0.023s

real 0m0.584s
user 0m2.144s
sys 0m0.039s

$ for f in 1 2 3; do time LD_PRELOAD=$PWD/lib/libxbps.so.2.0.0 ./bin/xbps-rindex/xbps-rindex -r /var/cache/xbps &>/dev/null; done

real 0m0.037s
user 0m0.030s
sys 0m0.010s

real 0m0.036s
user 0m0.032s
sys 0m0.007s

real 0m0.037s
user 0m0.035s
sys 0m0.006s
$
2014-09-05 21:07:07 +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
8939e8697d bin/*/*.8: add missing End-List macros (.El). 2014-08-23 09:26:02 +02:00
Juan RP
43090cef2a Xref xbps-uchroot(8) 2014-04-21 10:58:09 +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
8244f57320 bin/*: update manpages with Xref xbps-checkvers(8). 2014-04-07 12:22:55 +02:00
Juan RP
ee9479cc57 xbps-rindex: --sign bugfix to avoid garbage in the PEM RSA public key buffer. 2014-03-31 12:00:08 +02:00