Commit Graph

204 Commits

Author SHA1 Message Date
classabbyamp
1271a3dbed bin/: use xbps logging functions more 2023-02-11 14:23:51 +01:00
classabbyamp
06fbbba2e5 manpages: small formatting improvements
- use `.Os` to show "Void Linux" in the footer
- use `Aq Mt` to display email addresses
- use `.Lk` for the bug link
- remove unnecessary use of `.Nm <name>` when already defined
- add xbps-alternatives(1) to SEE ALSO where missing
- bump date
2023-02-10 21:33:51 +01:00
Duncan Overbruck
a1a0167d80
add XBPS_SYSLOG environment variable to overwrite configuration 2022-12-24 14:29:24 +01:00
Duncan Overbruck
de484e9369
lib: change xbps_dbg_printf to not require xbps_handle
This allows to simplify a lot of code by not having to pass around
the xbps handle everywhere just to print some debug information.
2022-12-24 14:29:23 +01:00
Michal Vasilek
d3b55df51b xbps-install: fflush before asking for confirmation
Closes #469
2022-06-21 13:39:31 +00:00
Érico Nogueira
587856eb89 xbps-install.1: improve description for -y.
It is a common confusion that --yes should also accept new signing keys;
it really shouldn't, so document that explicitly. Also explain how to
tell XBPS about trusted keys.
2021-06-28 00:25:18 +02:00
Duncan Overbruck
02367e3c00
lib: run pre-remove and pre-install scripts before unpacking 2021-06-26 18:41:37 +02:00
Piotr Wójcik
379cd4da2c
xbps-install: in dry run mode, print transaction even when disk is full
Closes: #322 [via git-merge-pr]
2021-06-26 16:51:43 +02:00
Duncan Overbruck
5dbe040b75
xbps-install.1: fix lint warnings 2021-06-26 16:43:07 +02:00
Alexis
c797c7fbc4
xbps-install.1: Add further details about -n.
Closes: #281 [via git-merge-pr]
2021-06-26 16:29:41 +02:00
Piotr Wójcik
b26f4068b7
xbps-install: list reinstalled packages
Before, they weren't printed at all.
Additionally, this matches count from compute_transaction_stats.

Closes: #321 [via git-merge-pr]
2021-02-04 23:16:50 +01:00
Duncan Overbruck
44cd938115
Revert "Use shared LICENSE file for all xbps code."
This reverts commit be7d8cfaf1.

This commit missed some previous copyrights mentioned,
in general I think its better to have this per-file to
follow who wrote what and when.
2020-04-29 14:12:10 +02:00
Juan RP
be7d8cfaf1
Use shared LICENSE file for all xbps code. 2020-04-24 11:44:19 +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
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
4d40179a8a
bin/xbps-install: fix regression in small transaction stats
fixes #242
2020-03-04 12:46:48 +01:00
Juan RP
57bf913d6c
xbps-install.1: document TIMEOUT_CONNECTION. 2020-03-03 08:26:29 +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
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
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
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
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
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
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
Mohamad Barbar
66b856fa77 xbps-install: don't prompt when all pkgs on hold. 2019-12-14 13:23:31 +01: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
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
Juan RP
b12b72e151
xbps-install/state_cb.c: minor tweaks. 2019-06-18 21:17:44 +02:00
Duncaen
a19c659616 bin/xbps-install: add the transaction_file states 2019-06-18 19:54:22 +02:00
Juan RP
5f68687cbb bin/xbps-install/main.c: fix dead assignment.
Found by clang-analyzer.

Bug Summary

File: bin/xbps-install/main.c
Warning: line 246, column 5
Value stored to 'rv' is never read
2019-06-18 18:49:29 +02:00
Juan RP
daf65b0767 bin/xbps-install/main.c: fix dead assignment.
Found by clang-analyzer.

Bug Summary

File: bin/xbps-install/main.c
Warning: line 259, column 5
Value stored to 'rv' is never read
2019-06-18 18:49:29 +02:00
Duncaen
8018833010 lib/fetch: add FORCE_IPV{4,6} environment variables 2019-06-15 19:19:40 +02:00
Juan RP
8cea3e351b xbps-fetch(1): new utility that replaces 'xbps-uhelper fetch'.
xbps-install(1): document all libfetch env vars.

Signed-off-by: Juan RP <xtraeme@gmail.com>
2019-06-12 18:07:24 +02:00
Juan RP
9cda7ef72a xbps-digest(1): new utility that replaces "xbps-uhelper digest".
See the manual page:

XBPS-DIGEST(1)              General Commands Manual             XBPS-DIGEST(1)

NAME
     xbps-digest - XBPS utility to generate message digests

SYNOPSIS
     xbps-digest [OPTIONS] [FILE] [FILE+N]

DESCRIPTION
     The xbps-digest utility generates message digests for specified FILE or
     stdin if unset.

OPTIONS
     -m, --mode mode
         Sets the message digest mode. Supported: sha256.  If unset, defaults
         to sha256.

     -h, --help
         Show the help message.

     -V, --version
         Show the version information.

SEE ALSO
     xbps.d(5), xbps-checkvers(1), xbps-create(1), xbps-dgraph(1),
     xbps-fbulk(1), xbps-install(1), xbps-pkgdb(1), xbps-query(1),
     xbps-reconfigure(1), xbps-remove(1), xbps-rindex(1), xbps-uchroot(1),
     xbps-uunshare(1)

AUTHORS
     Juan Romero Pardines <xtraeme@gmail.com>

BUGS
     Probably, but I try to make this not happen. Use it under your own
     responsibility and enjoy your life.

     Report bugs at https://github.com/void-linux/xbps/issues

                                 June 12, 2019

Signed-off-by: Juan RP <xtraeme@gmail.com>
2019-06-12 16:15:18 +02:00
human
56aa77d51b xbps-install: make question() read the whole input line
reading only the first character would answer the next question()
with the next character (unless you just pressed enter)
2019-06-07 19:38:51 +02:00
Duncaen
d57a39ef4a bin/xbps-install: don't overwrite action with downgrade if its on hold
Fixed #65
2019-04-14 11:53:07 +02:00