summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2021-03-01Update copyright yearAllan McRae181-187/+187
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-02-24pacman-key: --refresh-keys queries WKD before keyserverMorten Linderud1-4/+29
With the recent outages of the keyservers there is a possibility of `--refresh-keys` failing to fetch new keys. A lot of current key distribution is done over WKD these days, and `pacman-key` has the ability to use it for `--recv-key`. There was a hope `gpg` would end up supporting WKD for the refresh functionality, but this seems to be limited to expired keys fetched through WKD. Since this functionality isn't yet available it makes sense to stuff it into `pacman-key`. The current implementation looks over all available keyids in the keyring, attempts to fetch over WKD and then fall backs to keyservers if no email has a valid WKD available. The downside of this approach is that it takes a bit longer to refresh the keys, but it should be more robust as the distribution should be providing their own WKDs. Co-authored-by: Jonas Witschel <diabonas@archlinux.org> Signed-off-by: Morten Linderud <morten@linderud.pw> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-02-24libmakepkg: Support zstd decompression for sourcesMorten Linderud2-1/+7
This enables us to extract files in the source array and ensures that we can decompress files if the uncompressed signature is served. Signed-off-by: Morten Linderud <morten@linderud.pw> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-02-08Revert "ci: cache packages"Emil Velikov1-13/+3
This reverts commit e348ba38814c9cc7c1c9892d0451096234dc39ab. With the above commit we started caching the downloaded packages. Based on some testing and, it saves ~30s in the "step_script" stage while adding 18s for "Restoring/Saving cache". A net saving of ~10s. With earlier commit, we no longer use an ancient image which also pulls base-devel - thus the packages we have to download is minimal. Now comparing the uncached "step_script", vs the cached one - it is slowed by 2-3 seconds (1:01 -> 1:03), while we eliminate the 18s (and growing) caching. Tl:Dr: With up-to date image, package caching in not worth it - be that time, disk or network wise. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-02-08ci: use official imageEmil Velikov1-2/+2
The archlinux/base have been deprecated. Since we depend on base-devel simply use archlinux:base-devel Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-02-08makepkg: Don't double-layer distcc on ccacheMatti Niemenmaa1-1/+3
buildenv is set once for build() and a second time for package(). When using both distcc and ccache, this lead to CCACHE_PREFIX="distcc distcc" in package(), which breaks PKGBUILDs that execute the compiler in package() because distcc complains: distcc[383041] (main) CRITICAL! distcc seems to have invoked itself recursively! Avoid causing this error by only adding "distcc" to CCACHE_PREFIX if it's not yet there. Signed-off-by: Matti Niemenmaa <matti.niemenmaa+git@iki.fi> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-02-08doxygen: fix missing parameter nameEli Schwartz1-1/+1
This was raising a warning during the build. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-02-08support xattr when extracting packagesEli Schwartz1-0/+1
This permits storing the result of setcap during package() and applying the resulting capabilities to the installed program. Formerly, it was necessary to edit the binary after the fact (and thus dirty the file according to -Qkk) by using an install scriptlet. One problem that needs to be solved before this is useful, is preventing the strip routine from destroying xattrs. This is taken care of in the previous patch. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-02-08makepkg: don't let the strip routine mess up file attributesEli Schwartz1-2/+9
It updates the stripped/objcopied file by creating a temp file, chown/chmodding it, and replacing the original file. But upstream binutils has CVE-worthy issues with this if running strip as root, and some recent versions of strip don't play nicely with fakeroot. Also, this has always destroyed xattrs. :/ Sidestep the issue by telling strip/objcopy to write to a temporary file, and manually dump the contents of that back into the original binary. Since the original binary is intact, albeit with different contents, it retains its correct attributes in fakeroot. Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-21libalpm: fix total download reporting wrong totalmorganamilo1-9/+7
When a package does not need to be downloaded but a signature does, total download didn't count that towards the total. Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-21add --upgrade download testsAndrew Gregory4-0/+137
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-21pmtest: add ability to spawn simple http serversAndrew Gregory3-0/+135
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-21pmdb: add option to skip populating file:// serverAndrew Gregory3-8/+9
Populating a file:// Server prevents any manually registered HTTP servers from ever being used. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-21add CACHE_FEXISTS and CACHE_FCONTENTS test rulesAndrew Gregory1-0/+10
The existing CACHE_EXISTS rule takes a package, which is not suitable for -U tests that need to be able to check for specific files. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-21gitlab-ci: print output and logs for failed testsAndrew Gregory3-0/+33
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-21pactest.py: read options from PACTEST_OPTSAndrew Gregory1-1/+2
Makes it easier to pass options when not running pactest directly. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-21pacman: add -w to -UAndrew Gregory2-10/+10
Mostly for testing. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-21pacman: correct length of ".files.sig" stringPascal Ernster1-1/+1
Running "pacman -Sc" deletes /var/lib/pacman/sync/*.files.sig due to a wrong string length being used when checking filename suffixes in that directory. In turn, these missing signature files cause both the corresponding "*.files" files and their signatures being forcibly re-downloaded again when "pacman -Sy" is executed. Since official Arch Linux repos don't use signed database files yet, this only affects people who use custom repos with signed database files, for which they have set the "SigLevel" directive to "Required" or "DatabaseRequired" in /etc/pacman.conf. Fixes FS#66472 Signed-off-by: Pascal Ernster <pacman-dev@hardfalcon.net> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-19do not try to download an empty db listAndrew Gregory1-0/+4
Starting the download process, even if there is nothing to actually download, causes an error when pacman is built without curl and has no XferCommand defined (like our test suite). Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-19make alpm download config accessible without curlAndrew Gregory2-13/+2
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-19sighandler: initialize sigaction fieldsAndrew Gregory2-0/+3
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-19fully free error list in check_keyringAndrew Gregory1-1/+2
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-19plug memory leaks in _alpm_key_importAndrew Gregory1-1/+4
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-19pacman-conf: free rootdir before replacingAndrew Gregory1-0/+1
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-19pacman: indicate --overwrite takes a globAndrew Gregory1-1/+1
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-11pacman-key: Close msg string in generate_master_keyMorten Linderud1-1/+1
In 19980a61e9ed9b9a57520aaa919c40a4b5311f87 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-11mailmap additionAllan McRae1-0/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-11Read targets from stdin before chrootingmorganamilo1-6/+6
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-11pacman: add file checksum validation against mtreeEmil Velikov1-7/+67
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-11doc: move missed sections from alpm_ to libalpm_Allan McRae1-19/+23
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-09doc: reference all libalpm sections within libalpm man pageAllan McRae1-5/+10
Also, fix minor typo. Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-09doc: rename libalpm-list man page for consistencyAllan McRae1-1/+1
All other libalpm man pages are in the form libalpm_<name>. Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-08doc: change group names to libalpm_*morganamilo2-36/+23
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-08libalpm: const annotate struct db_operationsEmil Velikov2-2/+2
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-08libalpm: const annotate struct pkg_operationsEmil Velikov5-6/+6
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-08get_file_pkg_ops: update commentAllan McRae1-3/+2
2021-01-08libalpm: introduce get_sync_pkg_ops() helperEmil Velikov1-2/+17
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-08pacman: total download show how many packages have been downloadmorganamilo1-4/+21
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-08Remove unused SYMHIDDEN macrosEmil Velikov3-3/+0
The macro hasn't been used since 2007 with commit 7f7da2b5fc01f46d28236384540c7ecfdac16a63. 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-08meson: use hidden symbol visiblity by defaultEmil Velikov1-0/+2
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-08meson: pacman-conf add missing libcommon linkEmil Velikov1-1/+1
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-08libalpm: pass the number of packages being downloaded in totaldlcbmorganamilo4-4/+10
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-08libalpm: don't use curl's deprecated functionsmorganamilo3-9/+8
This bumps the minimun curl version from 7.32.0 to 7.55.0. Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-08pacman: clean filename for downlaodsmorganamilo1-12/+26
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-08libalpm: remove useless ifmorganamilo1-4/+0
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-03doc: fix typosmorganamilo1-9/+9
Signed-off-by: Allan McRae <allan@archlinux.org>
2021-01-03pacman-key: warn about time taken for master key generationAllan McRae1-0/+2
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>
2020-12-29doc: make doxygen build from any directoryEli Schwartz2-2/+3
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-29Move hex_representation() to src/commonEmil Velikov3-24/+27
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-29Remove pre libarchive 3.0 codeEmil Velikov1-20/+0
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>