Commit Graph

1300 Commits

Author SHA1 Message Date
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