Commit graph

6997 commits

Author SHA1 Message Date
Andrew Gregory
79227dabe0 make alpm download config accessible without curl
Download-related config options are currently limited to builds with
curl.  This causes compilation errors when those options are used
without an appropriate guard which often goes unnoticed because we all
use curl.  Front-ends providing their own download callback may also
want to use these settings.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-19 12:39:10 +10:00
Andrew Gregory
8ed98023b4 sighandler: initialize sigaction fields
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-19 12:38:57 +10:00
Andrew Gregory
a493170420 fully free error list in check_keyring
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-19 12:38:34 +10:00
Andrew Gregory
5151de3011 plug memory leaks in _alpm_key_import
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-19 12:38:02 +10:00
Andrew Gregory
5d21b2d44c pacman-conf: free rootdir before replacing
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-19 12:37:24 +10:00
Andrew Gregory
4311cc3648 pacman: indicate --overwrite takes a glob
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-19 12:03:08 +10:00
Morten Linderud
8566cd9be9 pacman-key: Close msg string in generate_master_key
In 19980a61e9 there was a msg added which
didn't get the string closed.

Signed-off-by: Morten Linderud <morten@linderud.pw>
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-11 11:11:06 +10:00
Allan McRae
57a75dedb1 mailmap addition
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-11 11:11:06 +10:00
morganamilo
e9cc95f372 Read targets from stdin before chrooting
Operations involving --sysroot and reading targets from stdin were
failing due to attempting to read targets after chrooting.  Move the
chroot to happen after targets are read.

Fixes FS#68630

Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-11 11:11:06 +10:00
Emil Velikov
8f7415c41b pacman: add file checksum validation against mtree
With libarchive v3.5.0 we have API to fetch the digest from the mtree.
Use that to validate if the installed files are modified or not.

As always, a modified backup file will trigger a warning but will not
result in an actual failure.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-11 11:11:06 +10:00
Allan McRae
3f5125e47c doc: move missed sections from alpm_ to libalpm_
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-11 11:10:55 +10:00
Allan McRae
4cdbbcfc34 doc: reference all libalpm sections within libalpm man page
Also, fix minor typo.

Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-09 09:19:50 +10:00
Allan McRae
c1d23c0ff2 doc: rename libalpm-list man page for consistency
All other libalpm man pages are in the form libalpm_<name>.

Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-09 09:19:03 +10:00
morganamilo
8fda300e06 doc: change group names to libalpm_*
Also change the group's title to point to the group's man page.

This makes generated man pages be named libalpm_* which is more
consistent with what library man pages are usually called.

Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-09 00:15:18 +10:00
Emil Velikov
45a648961b libalpm: const annotate struct db_operations
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-09 00:15:14 +10:00
Emil Velikov
1d2dd9a128 libalpm: const annotate struct pkg_operations
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-09 00:15:04 +10:00
Allan McRae
f8614d8c5b get_file_pkg_ops: update comment 2021-01-09 00:14:58 +10:00
Emil Velikov
027d76b9f5 libalpm: introduce get_sync_pkg_ops() helper
Currently default_pkg_ops is accessed in two different ways.

There is get_file_pkg_ops (in be_package.c) creating a local once-off
'tweaked' copy. As well as load_pkg_for_entry (be_sync.c) which modifies
in-place and uses default_pkg_ops.

This seems rather misleading and fragile approach. Introduce a helper
for the second use-case so that default_pkg_ops is handled consistently
and essentially remains unchanged throughout.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-09 00:14:56 +10:00
morganamilo
4472ce55d7 pacman: total download show how many packages have been download
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-09 00:14:52 +10:00
Emil Velikov
b9ab7790d5 Remove unused SYMHIDDEN macros
The macro hasn't been used since 2007 with commit
7f7da2b5fc. Although it was still copied
over into alpm_list.c an year or so later with commit ca1a1871 ("More
cleanup to alpm_list")

Just remove all instances of it.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-09 00:14:50 +10:00
Emil Velikov
67a42b9549 meson: use hidden symbol visiblity by default
All the required public API is annotated with SYMEXPORT, so we can just
add the meson notation, to hide all the symbols by default.

Thus we no longer spill all the internal API into the global namespace.

This is effectively a regression from the autotools build, which used
hidden and internal for DARWIN and others respectively.

The use of hidden is considered sufficient, considering:
 - internal was introduced with commit 920b0d20 ("Update usage of gcc
   __attribute__ flags"), referencing the GCC manual and potential
   optimisations, although
 - the details about the optimisations or respective benefits are close
   to non-existent,
 - the code/data size of the binaries is identical across hidden and
   internal. While the latter produces slightly larger overall binaries.
 - Internal is not widely supported - missing on Darwin, the CMake build
   system lacks a wrapper (unlike for hidden)
 - Internal is not widely used in projects.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-09 00:14:42 +10:00
Emil Velikov
d53ba019f5 meson: pacman-conf add missing libcommon link
Currently, we are erroneously exporting all the symbols via the
libalpm.so. As such, the libcommon dependency is resolved.

The libalpm.so exports are about to be resolved shortly, yet that
exposed that pacman-conf is missing a link against libcommon.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-09 00:14:33 +10:00
morganamilo
793e2097a6 libalpm: pass the number of packages being downloaded in totaldlcb
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-09 00:12:32 +10:00
morganamilo
f5b373788f libalpm: don't use curl's deprecated functions
This bumps the minimun curl version from 7.32.0 to 7.55.0.

Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-09 00:12:19 +10:00
morganamilo
bc1591a0b8 pacman: clean filename for downlaods
The progress bar already did this. But the init event and up to date
message printed the full file name.  Unify these for consistency.

Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-09 00:12:08 +10:00
morganamilo
7cc8e0181f libalpm: remove useless if
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-09 00:11:44 +10:00
morganamilo
8e291e6f4b doc: fix typos
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-03 11:24:24 +10:00
Allan McRae
19980a61e9 pacman-key: warn about time taken for master key generation
Generating the pacman master key can take some time on systems
without enough entropy. Warn the user that the generation may
take some time.

Fixes FS#30286.

Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-03 11:19:21 +10:00
Eli Schwartz
a023565ed3 doc: make doxygen build from any directory
In the autotools build, it only built in-tree, from cwd = doc/ and
resolving doc/../lib/libalpm

In the meson build, this accidentally worked if cwd =
pacman/builddir/ and resolved to builddir/../lib/libalpm/

But... this should always have been configured with the actual path to
the inputs. So, we will now proceed to do so.

Fixes building man3 if your out of tree builddir doesn't happen to be a
direct subdirectory of the source root.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-29 13:15:40 +10:00
Emil Velikov
ccdd1e3fd9 Move hex_representation() to src/common
We'll reuse the function in pacman with a later commit.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-29 12:38:23 +10:00
Emil Velikov
831fc568fc Remove pre libarchive 3.0 code
Pacman has required libarchive 3.0 or later for quite some time mow.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-29 12:37:45 +10:00
morganamilo
95ffdd68b2 doc: remove old libalpm man file
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 12:03:51 +10:00
morganamilo
e67c306f91 doc: add extra documentation to the man page
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 12:01:58 +10:00
morganamilo
ea975c328d doc: rename alpm_api group to alpm
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 12:01:58 +10:00
morganamilo
50c9c338fb doc: update doxyfile
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 12:01:58 +10:00
morganamilo
6ed82820fe doc: configure doxygen
- only document public alpm items (alpm_*)
- hide typedef'd structs (_alpm_pkg_t shows as alpm_pkg_t)
- enable inline struct definitions (this stops having a man page for
  every single struct)

Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 12:01:58 +10:00
morganamilo
1e8816f13d doc: move top level items into groups
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 12:01:58 +10:00
morganamilo
2a16434bfd doc: move alpm_api group to top of file
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 12:01:58 +10:00
morganamilo
4613527738 doc: document options
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 12:01:58 +10:00
morganamilo
7b06b5407b doc: document alpm_list
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 12:01:57 +10:00
morganamilo
50d2171ef0 doc: document misc
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 11:55:46 +10:00
morganamilo
a321e1f8a5 doc: document transactions
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 11:55:46 +10:00
morganamilo
3d60a829e1 doc: document files and groups
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 11:55:45 +10:00
morganamilo
5901ac9cb2 doc: document packages
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 11:55:45 +10:00
morganamilo
af7a1e834f doc: document logging
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 11:55:45 +10:00
morganamilo
55efa43f23 doc: document databases
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 11:55:45 +10:00
morganamilo
e9ac13776e doc: document callbacks
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 11:55:45 +10:00
morganamilo
bf26b6bbf7 doc: document depends
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 11:55:44 +10:00
morganamilo
5e9635317b doc: document signatures
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 11:51:07 +10:00
morganamilo
ab431f6810 doc: document handle
Signed-off-by: Allan McRae <allan@archlinux.org>
2020-12-21 11:51:07 +10:00