Commit Graph

1387 Commits

Author SHA1 Message Date
Juan RP
be7d8cfaf1
Use shared LICENSE file for all xbps code. 2020-04-24 11:44:19 +02:00
Juan RP
530e79c7ee
Fix warnings detected by LTO. 2020-04-23 08:32:54 +02:00
Juan RP
c488b17ca9
xbps-query.1: new section: PACKAGE MODES.
- Fix mandoc(1) warnings.
- Document --list-repolock-pkgs.
2020-04-23 07:18:57 +02:00
Juan RP
3731f12c91
xbps-install.1: new section: PACKAGE MODES.
Fix mandoc(1) warnings as well.
2020-04-23 07:18:25 +02:00
Juan RP
7d8247ae56
Multiple changes to pkgs on hold mode.
- Added transaction stats for pkgs on hold.

- Always add packages on hold to the transaction dictionary,
  its type will be set to XBPS_TRANS_HOLD.

- Changed xbps_transaction_update_pkg() to have a new "force"
  bool argument to force an update with a pkg on hold.

- As discussed in #274 with @Duncaen the only way to update a
  pkg on hold is by using `-f`, i.e `xbps-install -f foo`.

Closes #265
Closes #274
2020-04-23 06:03:56 +02:00
Juan RP
9b695433a0
bin: sync usage and keep it consistent in all utils. 2020-04-20 21:25:14 +02:00
Juan RP
0b62ba8592
xbps-fbulk: fix usage. 2020-04-20 18:55:44 +02:00
Juan RP
1f4cfc377b
xbps-fbulk: misc changes (v3).
- Re-add original behaviour now I fixed the real issue for missing
  logs. Keep the build/run pipeline full as soon as possible.
- Added -s, --system. System build mode. To only build pkgs that
  are installed manually in your system.
- Added long options; sync usage.
- Restrict max jobs to ncores; there are issues with shared data,
  and until they are resolved this is the only way to make it work
  reliably.
2020-04-20 18:50:11 +02:00
Juan RP
a1d66032bd
xbps-uchroot: support long options; update usage. 2020-04-20 15:12:44 +02:00
Juan RP
213ce1a72b
xbps-rindex/remove-obsoletes.c: fix CID 284947 (Resource leak). 2020-04-20 10:34:08 +02:00
Juan RP
debfcf1273
Use xbps_repo_release() where applicable. 2020-04-19 11:09:05 +02:00
Duncan Overbruck
cb580a5c1a bin/xbps-query: use puts instead of printf("%s\n", ...) 2020-04-19 11:05:00 +02:00
Duncan Overbruck
910bb5674c bin/xbps-query: simplify list printing (with truncation) 2020-04-19 11:05:00 +02:00
Duncan Overbruck
a2c7f5fc29 bin/xbps-query: simplify search result printing (with truncation)
This should also fix a useless error from lgtm
2020-04-19 11:05:00 +02:00
Juan RP
b9fb5e1cc8 xbps-uchroot: support read-only bind mounts, misc improvements.
- Added -B src:dest (like -b) but this makes bind mounts in
  read-only mode.

- Get rid of setfsuid(), it's unnecessary.

- Make sure chrootdir is not '/', use realpath().

- Always set SECBIT_NOROOT, see capabilities(7).

- Do not mount recursively, right now this only mounts
  /dev (ro), /dev/shm (rw), /sys (ro) and /proc (ro).
  Previously any mount below any specific mount were recursively
  mounted in chrootdir.
2020-04-14 20:01:44 +02:00
Juan RP
ae87662547 xbps-fbulk.1: sync with reality. 2020-04-14 19:57:23 +02:00
Juan RP
da2c104d16 xbps-fbulk: calloc -> malloc.
No need to use calloc here because its members are initialized
later on.
2020-04-14 19:57:23 +02:00
Juan RP
5d81aec07f xbps-fbulk: create log files with txt extension. 2020-04-14 19:57:23 +02:00
Juan RP
4f8e07aa64 xbps-fbulk: parallel working implementation.
- Removed -a, this won't work due to dependency cycles between
  host/target.
- Do the process in two steps: collect deps and then build.
- Cleaned up the whole code.
2020-04-14 19:57:23 +02:00
Juan RP
743e76938f
xbps-install: fix regression in stats.
Updated packages will also be configured, so take this into
account in the stats.
2020-03-31 17:26:38 +02:00
Duncan Overbruck
b0904b32d2
bin/xbps-fetch: fix output when not using shasum mode 2020-03-05 12:53:48 +01:00
Duncan Overbruck
4d40179a8a
bin/xbps-install: fix regression in small transaction stats
fixes #242
2020-03-04 12:46:48 +01:00
Juan RP
7f0a5b5c38
xbps-fetch.1: bump date 2020-03-03 08:27:11 +01:00
Juan RP
57bf913d6c
xbps-install.1: document TIMEOUT_CONNECTION. 2020-03-03 08:26:29 +01:00
Piotr Wójcik
5737d9a941 xbps-fetch: TIMEOUT_CONNECTION to customize time waiting for response 2020-03-03 08:15:00 +01:00
Roman Neuhauser
f477465803 xbps-install: -R/--repository usage string format
same as in other options that take arguments
2020-02-28 09:37:53 +01:00
Roman Neuhauser
d282016c3e xbps-install.1: fix docs for -R
previous text seems to have been copypasted from xbps-query.1
2020-02-28 09:37:53 +01:00
Duncan Overbruck
b8e611a149 bin/xbps-fbulk: port to uthash 2020-02-23 22:18:34 +01:00
Juan RP
6236d7ae41 xbps-query/search.c: use unsigned int and remove wrong cast. 2020-02-22 14:25:22 +01:00
Juan RP
68747a12e4
xbps-query: make -S (show mode) print all properties.
run_depends was being skipped, but there's not any reason
to skip this even if there's -x.

Just print any property available in its pkgdb dictionary.
2020-02-22 11:39:29 +01:00
Juan RP
bc9fab5ee8
bin: use unsigned int rather than size_t.
unsigned int is a 32-bit value both on 32/64-bit targets.
2020-02-22 11:29:18 +01:00
Juan RP
c031ee6945 bin: use size_t where applicable.
To make sure we don't get a negative value due to overflowing.
2020-02-22 11:18:57 +01:00
Juan RP
5a6709b560
xbps-install/transaction: fix for all_pkgs_on_hold.
If all pkgs are on hold in transaction skip stats
and return early.
2020-02-22 10:51:27 +01:00
Juan RP
0788cd1f42 xbps-{create,rindex}: use zstd by default.
Closes #35
2020-02-22 09:27:46 +01:00
Juan RP
06c9891ae3 xbps_transaction_*: multiple performance improvements (v2).
This commit implements multiple performance improvements
to the transaction code:

- Don't process xbps_pkg_name() N times each time we access
  its package dictionary (via pkgdb or rpool), just do it once
  at xbps_pkgdb_init() time. At pkgdb init time, it just creates
  a property in pkgdb, "pkgname". At rpool time, each time a
  package is accessed, the "pkgname" string property is added.

- The package transaction dictionary contains the "transaction"
  object to know what's the pkg type. This has been changed to an
  uint8, this simplifies the logic and it's faster than checking
  a string object. See xbps_trans_type_t and xbps_transaction_pkg_type().

- Fixed the issue that was marked with XXX in transaction shlibs
  checking code. This has been fixed and improved and resources are
  now just freed as expected.

- Simplified random code all over the place, avoiding unnecessary
  allocations or operations.

- Rename some transaction files to have a better description.

This is my first rototill to the code in 2020.
2020-02-21 09:37:32 +01:00
sineemore
701132071d xbps-install: show overall download progress 2020-02-19 00:28:40 +01:00
Juan RP
28154f488c xbps-uchroot: fix indentation 2020-02-13 09:06:29 +01:00
Juan RP
6ccee8fd5e xbps-uchroot: overlayfs fixes v2.
- Do not use nftw(3), this won't clean up the tree properly.
  Rather use scandir(3) with alphasort, like xbps-create(1).

- Don't drop privs in the parent to make sure that the
  temp overlayfs tree can be removed properly.

This fixes the issues while building go modules and others
with xbps-src.
2020-02-13 09:06:29 +01:00
Duncan Overbruck
0d90534236
libxbps: ABI/API break due to hash function changes 2020-02-10 13:32:17 +01:00
Juan RP
71a594f681
Revert "xbps-uchroot: make sure to cleanup tempdir with overlayfs."
This reverts commit f6a6385b42.

Does not work as expected, and does not fix the real issue
which is still not understood.
2020-02-08 20:43:23 +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
7d934c9290
xbps-create: fix two issues detected by lgtm 2020-02-07 17:16:47 +01:00
Juan RP
3a0ca77264
xbps-uchroot: stop remounting / unnecessarily.
The remount is done to use nosuid, but we can get
rid of the remount just because of this specific
option that does not have too much value for our
general usage (xbps-src).
2020-02-06 08:50:12 +01:00
Juan RP
f6a6385b42
xbps-uchroot: make sure to cleanup tempdir with overlayfs.
Go modules seem to have too restrictive permissions on
its builddir, making xbps-uchroot(1) unable to remove
its directory tree due to insufficient permissions.

Run nftw() twice, the first run to set chmod 755, and
second run to remove the file.

Fixes `xbps-src -t` with any pkg that uses `build_style=go`.

This should avoid lots of temp dirs in the buildbot
builders while building go modules and others.
2020-02-04 13:17:26 +01:00
Piotr Wójcik
4a06cb41b1 bin/xbps-checkvers: mistake in manpage 2020-01-30 08:01:12 +01:00
Piotr Wójcik
2d3ed8db19 bin/xbps-checkvers: align help text with spaces 2020-01-25 13:21:18 +01:00
Piotr Wójcik
cd0f81d68c bin/xbps-checkvers: list removed templates 2020-01-25 13:21:18 +01:00
Juan RP
bda4452016
xbps-install: improved -D,--download-only support.
Added support to download all dependencies even
if the euid does not have write perms to rootdir.

In this mode we only care if cachedir is writable,
rootdir access is not necessary.

This is really useful to download all binary packages
required by any number of packages as any regular
user to later perform off-line installations, i.e:

```
$ xbps-install -c $PWD/cachedir -yD xbps
...
$ tree cachedir
cachedir/
├── acl-2.2.53_1.x86_64-musl.xbps
├── acl-2.2.53_1.x86_64-musl.xbps.sig
├── attr-2.4.48_1.x86_64-musl.xbps
├── attr-2.4.48_1.x86_64-musl.xbps.sig
├── bzip2-1.0.8_1.x86_64-musl.xbps
├── bzip2-1.0.8_1.x86_64-musl.xbps.sig
├── ca-certificates-20190110_1.noarch.xbps
├── ca-certificates-20190110_1.noarch.xbps.sig
├── libarchive-3.4.1_1.x86_64-musl.xbps
├── libarchive-3.4.1_1.x86_64-musl.xbps.sig
├── libcrypto45-3.0.2_2.x86_64-musl.xbps
├── libcrypto45-3.0.2_2.x86_64-musl.xbps.sig
├── liblz4-1.9.2_1.x86_64-musl.xbps
├── liblz4-1.9.2_1.x86_64-musl.xbps.sig
├── liblzma-5.2.4_2.x86_64-musl.xbps
├── liblzma-5.2.4_2.x86_64-musl.xbps.sig
├── libressl-3.0.2_2.x86_64-musl.xbps
├── libressl-3.0.2_2.x86_64-musl.xbps.sig
├── libssl47-3.0.2_2.x86_64-musl.xbps
├── libssl47-3.0.2_2.x86_64-musl.xbps.sig
├── libtls19-3.0.2_2.x86_64-musl.xbps
├── libtls19-3.0.2_2.x86_64-musl.xbps.sig
├── libxbps-0.57.1_8.x86_64-musl.xbps
├── libxbps-0.57.1_8.x86_64-musl.xbps.sig
├── libzstd-1.4.4_1.x86_64-musl.xbps
├── libzstd-1.4.4_1.x86_64-musl.xbps.sig
├── musl-1.1.24_1.x86_64-musl.xbps
├── musl-1.1.24_1.x86_64-musl.xbps.sig
├── run-parts-4.9.1_1.x86_64-musl.xbps
├── run-parts-4.9.1_1.x86_64-musl.xbps.sig
├── xbps-0.57.1_8.x86_64-musl.xbps
├── xbps-0.57.1_8.x86_64-musl.xbps.sig
├── xbps-triggers-0.113_3.noarch.xbps
├── xbps-triggers-0.113_3.noarch.xbps.sig
├── zlib-1.2.11_3.x86_64-musl.xbps
└── zlib-1.2.11_3.x86_64-musl.xbps.sig

0 directories, 36 files
$
```

Inpired by #213
Closes #213
2020-01-25 13:05:46 +01:00
Duncan Overbruck
c98d732d9c
bin/xbps-fetch: add a mode that prints sha256sums of downloaded files 2020-01-18 16:44:31 +01:00
Duncan Overbruck
6794077efd
Add noextract configuration option
Closes #208
Fixes #165
2020-01-18 15:51:13 +01:00
Juan RP
850ba2d416
Revert the repodata signature stuff. 2020-01-06 14:56:01 +01:00
Juan RP
10b2f7b425
Revert "Preserve meta-index data on change of signing key"
This reverts commit ae26a83ad2.
2020-01-06 14:46:12 +01:00
Juan RP
2884fc3ab7
Revert "Don't assume repodata is signed when has index-meta.plist"
This reverts commit 4e3d4d2287.
2020-01-06 14:45:57 +01:00
Juan RP
68113a8fc0
Revert "Sign index-meta"
This reverts commit 381b7b7600.
2020-01-06 14:44:22 +01:00
Juan RP
b4fdc39e67
Revert "Sign repodata"
This reverts commit 04194f44c8.
2020-01-06 14:31:40 +01:00
Juan RP
d68ff7ebf0
xbps-install: fix --reproducable.
The 'repository' obj also needs to be skipped to be fully
reproducable between different repositories.

Updated the test case accordingly.
2019-12-29 16:31:23 +01:00
Juan RP
b05f4b4db5 xbps-install: added --reproducible long option.
If set, enables reproducible mode in pkgdb.

Added a new test case.
2019-12-29 11:02:51 +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
Juan RP
6210955010 xbps-create: fix memleak introduced in 0f3ed2067c 2019-12-27 23:15:21 +01:00
Juan RP
67707657a4 xbps-create: always sanitize gathered symlinks.
Added a new test case.

Close #199
2019-12-27 23:15:21 +01:00
Juan RP
166caab986 Do not silently update xbps on any install/update transaction.
When there's a new xbps update, xbps-install(1) will now return
EBUSY (16) and a message (if dry-run disabled) explaining
how to proceed.

If there's an update and transaction does not contain xbps, it will
error out unless the 'xbps' pkg is the only target pkg, i.e:

	# xbps-install -Su
	# echo $?
	16

To update xbps, the only way to proceed is to explicitly declare
it as an update, i.e:

	# xbps-install -u xbps

The dry-run mode will still show there's an xbps update.

Modified the existing test cases to satisfy the new behaviour.

Closes #166
Closes #142
2019-12-27 21:35:40 +01:00
Juan RP
34a1ab51d0
xbps-checkvers: version cache file.
We do not want obsolete files from previous versions, so that
we version the filename of that working version.
2019-12-27 18:23:46 +01:00
Juan RP
64aeabf3f6
xbps-checkvers: restore previous behaviour after 7a220b37db.
The '%n' pkgname fmt option still needs to be the sourcepkg
for xbps-src to work with no additional changes.

This restores previous behaviour, and uses binpkg's pkgname
while checking for pkgdb/repo.
2019-12-27 18:04:53 +01:00
Juan RP
7a220b37db xbps-checkvers: use binpkg's pkgname rather than srcpkgs.
Up until now `xbps-checkvers` would only check for the
real sourcepkg, this broke detection of binary packages
that are subpkgs.

Added a new test case.

Close #192
2019-12-27 12:24:16 +01:00
Juan RP
0e1482917a
Fix maybe-uninitialized warnings detected by LTO. 2019-12-27 10:53:10 +01:00
Mohamad Barbar
66b856fa77 xbps-install: don't prompt when all pkgs on hold. 2019-12-14 13:23:31 +01:00
Doan Tran Cong Danh
36a7ddd4ae xbps-uchroot: document end of options argument
Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>
2019-11-24 12:28:45 +01:00
Doan Tran Cong Danh
be06a3b578 xbps-uunshare: document end of options argument
Signed-off-by: Doan Tran Cong Danh <congdanhqx@gmail.com>
2019-11-24 12:28:45 +01:00
Piotr Wójcik
ae26a83ad2 Preserve meta-index data on change of signing key 2019-11-02 11:53:14 +01:00
Piotr Wójcik
4e3d4d2287 Don't assume repodata is signed when has index-meta.plist 2019-11-02 11:53:14 +01:00
Piotr Wójcik
381b7b7600 Sign index-meta 2019-11-02 11:53:14 +01:00
Piotr Wójcik
b4e93a95bf Turn off repodata signing 2019-11-02 11:53:14 +01:00
Piotr Wójcik
04194f44c8 Sign repodata 2019-11-02 11:53:14 +01:00
Juan RP
9ebe82fdc3
xbps-checkvers: fix a warning with glibc.
found by @q66

main.c:195:8: error: ignoring return value of 'fread', declared with attribute warn_unused_result [-Werror=unused-result]
2019-10-27 09:13:46 +01:00
Duncan Overbruck
7b4a925302 bin/xbps-rindex: better error handling for writing repodata archives
This fixes issues when writes fail (as example if the disk is full),
where xbps would create empty repodata or stagedata archives.
2019-10-25 23:36:44 +02:00
Duncan Overbruck
04d5554ed2 bin/xbps-create: better error handling for writing archives
This fixes issues where if xbps-create creates a new archive on a full
disk, it will write an incomplete archive and then later fails to be
read by xbps-rindex.
2019-10-25 23:36:44 +02:00
Duncan Overbruck
1d460bc793 bin/xbps-checkvers: make distdir absolute
Fixes void-linux/xbps#133
2019-08-05 15:36:27 +02:00
Juan RP
d927517327
xbps-fbulk: do not make assert() change program behaviour.
... otherwise if NDEBUG is set chdir() is skipped completely.
2019-07-06 08:37:47 +02:00
Juan RP
702d64c517
xbps-checkvers/Makefile: re-add -Wno-deprecated-declarations.
... it's still necessary due to readdir_r() with glibc.
2019-07-03 02:15:41 +02:00
Juan RP
9addb5e64e
Get rid of some old disabled warnings. 2019-07-03 01:26:07 +02:00
Juan RP
0677678387 Added LTO support and fix warnings (maybe-uninitialized). 2019-06-27 18:09:26 +02:00
Juan RP
bb96486b12
xbps-install: make sure to call xbps_end() before exiting. 2019-06-27 08:02:19 +02:00
Johannes Brechtmann
44692f28d8 bin/xbps-install: update_pkg return EEXIST if package is up to date
makes 58509996aa work for
xbps-install -u <pkg>
2019-06-27 07:54:11 +02:00
Duncaen
7b728f5ac0 bin/xbps-remove: fix skipping executing orphans transaction 2019-06-26 22:24:47 +02:00
Juan RP
83aa486f6b
xbps-remove: skip trans if all pkgs were not found.
Restores behaviour with xbps<0.54.
2019-06-25 10:32:02 +02:00
Juan RP
41b2cec356
xbps-*: use xbps_pkgdb_update() correctly.
xbps-{alternatives,pkgdb,reconfigure}: xbps_pkgdb_update()
has been fixed to flush when told so, and we don't need
to update the in-memory copy because we are exiting.
2019-06-22 18:50:40 +02:00
Juan RP
58509996aa
xbps-install: skip trans if all pkgs are installed or uptodate.
Fixes an issue pointed out by @Johnnynator
2019-06-21 19:19:09 +02:00
Juan RP
13172c22fc
xbps-install: only print num of downloaded pkgs with -D. 2019-06-21 16:26:08 +02:00
Juan RP
589a96a50e
xbps-install: with -D there are no pkgs to install/update/configure/remove. 2019-06-21 16:06:42 +02:00
Juan RP
fe943eb7d2
xbps-install(1): added -D, --download-only.
Added `-D, --download-only` flag to allow downloading
packages to the cache without attempting to install them.

Contributed by Toyam Cox via #9

Adapted to master by yours truly.

Close #9
2019-06-21 15:57:25 +02:00
Juan RP
4f717dc597 xbps-install(1): added -I, --ignore-file-conflicts.
If set it will continue with the transaction and will
just print what are the conflicting files without returning
EEXIST.

This is a temporary solution for void where there are still
some packages with conflicting files (qt5-host-tools vs qt5-tools-devel).

With input by @duncaen
2019-06-21 15:31:04 +02:00
Juan RP
288cff37f8
xbps-install: return 0 if pkg is already installed or uptodate.
Before this change xbps-install could return EEXIST
when the package is already installed, or already up-to-date.

Return 0 if such condition happens, and only return EEXIST
if there's a file conflict.

Close #51
2019-06-21 11:06:45 +02:00
Duncaen
9c300a93d1 bin/xbps-checkvers: fix --format long form 2019-06-21 00:32:30 +02:00
Juan RP
2c6e0c28d4
xbps-checkvers.1: tweaks 2019-06-20 15:25:14 +02:00
Juan RP
071db09d3e
xbps-alternatives.1: proper credit. 2019-06-20 12:56:17 +02:00
Juan RP
6390817d7e
xbps-rindex.1: proper credit. 2019-06-20 11:44:45 +02:00
Juan RP
2df0778fcd
xbps-pkgdb.1: proper credit. 2019-06-20 11:42:30 +02:00
Juan RP
b0abcd4997
xbps-checkvers.1: proper credit. 2019-06-20 11:42:09 +02:00
Duncaen
ebb61edb16 bin/xbps-fetch: restore old behaviour for output file 2019-06-20 11:32:12 +02:00
Juan RP
e7738555b2
xbps-uhelper: restore compat.
Add 'digest' and 'fetch' actions again for compatibility,
but don't mention them in usage().

This way previous versions of xbps-src (that don't require xbps-0.54)
still work without changes.
2019-06-20 10:53:30 +02:00