Commit graph

7214 commits

Author SHA1 Message Date
Allan McRae
2c45e854ab Disable brittle valgrind test in CI
Signed-off-by: Allan McRae <allan@archlinux.org>
2023-05-22 19:32:47 +10:00
Allan McRae
a81ec016d7 Update pactest README
Signed-off-by: Allan McRae <allan@archlinux.org>
2023-05-22 19:25:23 +10:00
Allan McRae
55da1a01b6 makepkg.conf.in: strip leading slash from LIB_DIRS
Signed-off-by: Allan McRae <allan@archlinux.org>
2023-05-22 18:55:23 +10:00
Allan McRae
5e94752434 makepkg.conf.5: correction option name
Also fix typo "librarys"

Signed-off-by: Allan McRae <allan@archlinux.org>
2023-05-22 18:54:01 +10:00
Allan McRae
262aa6c24e Fix comment
Signed-off-by: Allan McRae <allan@archlinux.org>
2023-02-13 12:09:11 +00:00
Allan McRae
3323662ee0 makepkg: do not recurse into LIB_DIRS when looking for library provides
We should only find library provides in the configured directories, and
not their subdirectories.

Signed-off-by: Allan McRae <allan@archlinux.org>
2023-02-13 12:09:11 +00:00
Allan McRae
6c913af95d Add the -pedantic' compiler flag back to our debug builds
This was lost in the transition from autotools to meson. No additional
warnings are given with current gcc and clang.

Signed-off-by: Allan McRae <allan@archlinux.org>
2023-02-13 22:07:32 +10:00
Allan McRae
71764b6d4c makepkg.conf: allow configuration additions via a subdirectory
Move rust related buildflags to their own configuration file to
provide an example of how other languages could be supported.

Signed-off-by: Allan McRae <allan@archlinux.org>
2023-01-17 10:26:07 +10:00
Allan McRae
e0bbfb5682 libmakepkg: ensure clearing of buildflags happens first
When 'options=('!buildflags') is used, we want to ensure our
buildflags are cleared first. Currently this happens due to luck
of alphabetical ordering, but this could change with libmakepkg
drop-ins.

Signed-off-by: Allan McRae <allan@archlinux.org>
2023-01-13 11:35:42 +10:00
Allan McRae
09e82f01ea libmakepkg: move rust buildenv handling to separate file
This serves as a demonstration for how other languages could drop
in support into libmakepkg.

Signed-off-by: Allan McRae <allan@archlinux.org>
2023-01-13 11:35:35 +10:00
Stefan Weil
d35728f924 pacman-key: Fix shell syntax
Fixes: 3f8029af92 ("pacman-key: Use ngettext for plurals")
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2023-01-01 15:54:48 +01:00
Allan McRae
3f8029af92 pacman-key: Use ngettext for plurals
There are two strings that may be singular or plural in pacman-key.
Use ngettext to handle these strings correctly, and provide a fallback
function if it is not available.

Fixes FS#70556.

Signed-off-by: Allan McRae <allan@archlinux.org>
2023-01-01 13:41:52 +10:00
Allan McRae
6344aab3bd zsh: make names unique to avoid clashes
The function _keys is a bit generic and can result in clashes.  Change
other functions starting with _key_ to be _pacman_key_ as well.

Fixes FS#74507.

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-12-24 00:55:30 +10:00
morganamilo
52eb094aa2 Fix repo-add
Commit 4f43ce3e4a broke repo-add by
switching to parseopts without accounting for the added "--". This caused
the dbname to always be read as "--".

Accounts for "--" and makes repo-add respect "--" as end of opts.
2022-12-19 10:08:57 +10:00
Allan McRae
a194197369 makepkg.conf: clarify PKGEXT and SRCEXT
Mention valid suffixes should start with .pkg or .src

Fixes FS#64749.

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-12-19 09:56:29 +10:00
Ziemowit Laski
f4f66fcca7 Bump required GPGME version to 1.12.0
GPGME_KEYLIST_MODE_LOCATE was introduced in 1.12.0

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-12-13 11:46:18 +10:00
Allan McRae
bb035eba4c gitlab CI: use "meson setup" everywhere
Avoids a warning from meson.

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-12-13 10:00:13 +10:00
Allan McRae
fcb1d4f87e makepkg: package debug source files with options 'debug' and '!strip'
When package software with debug symbols without stripping, we should
still process the files with debugedit and include the needed source
files in the package.

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-12-13 10:00:13 +10:00
Allan McRae
471a030466 Avoid NULL deference in curl_check_finished_download
We have not set handle in the function at this stage, so we can not
assign an error to it.  Pass the handle to the function to avoid
waiting until the payload is retrieved.

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-12-13 10:00:13 +10:00
Allan McRae
775d511f42 load_packages: fix memory leak on error
The memory assigned in _alpm_pkg_load_internal was not freed on
error.

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-12-13 10:00:13 +10:00
Allan McRae
19a8587459 _alpm_pkg_load_internal: prevent double closing file descriptor
Move closing of the file descriptor until the end of the function, as
any following error will lead to a "goto error" that attempts to close
it again.

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-12-13 10:00:13 +10:00
Allan McRae
ea83fd3927 Catch possible error in archive_entry_pathname when extracting files
Prevents a null deference on error.

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-12-13 10:00:13 +10:00
Allan McRae
0fe764a253 Fix memory leak when setting up download bars
Signed-off-by: Allan McRae <allan@archlinux.org>
2022-12-13 10:00:13 +10:00
Allan McRae
3436bc6c3e Finish comparing all pairs of filenames for duplicates before erroring
This also prevents a use-after-free issue where we free the list we
are interating over and the do i->next.

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-12-13 10:00:13 +10:00
Allan McRae
0e938f1886 libmakepkg: fix compatibility with bash-5.2 patsub_replacement
Bash-5.2 introduced the patsub_replacement shell option, which is enabled
by default.  Apparently is it supposed to handle a sed-like idiom, but
what it does achieve is making any substitution involving a "&" requiring
special care.

For makepkg's DLAGENTS, we replace "%o" and "%u" if present.  Any "&" in
the replacement fields triggers patsub_replacement unless quoted.  This is
particularly important for the URL field.

Add relevant quotes to avoid issues.

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-12-12 18:37:59 +10:00
Allan McRae
1327ce7bd8 makepkg: remove md5sums from generated mtree file
md5sums are cryptographically broken and we supply sha256sums to verify
files on a users system have not been modified from the packaged version.

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-12-04 20:15:33 +10:00
Allan McRae
310bf878fc repo-add: do not add md5sums to the repo dbs
Keeping md5sums in the repo databases no longer serves a real purpose.
md5sums are no longer considered  secure, and we already have sha256sums
in the repos (along with PGP verification).

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-12-04 20:15:33 +10:00
Allan McRae
4f43ce3e4a repo-add: use parseopts from libmakepkg
Signed-off-by: Allan McRae <allan@archlinux.org>
2022-12-04 20:14:32 +10:00
Allan McRae
e7806a43e0 pacman.conf.in: adjust example custom repo path for consistency
The example makepkg.conf.in suggests using "PKGDEST=/home/packages". It makes
sense to use the same path for the custom repo example in pacman.conf.in.

Fixes FS#48497.

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-12-04 20:11:43 +10:00
Allan McRae
23aa82812e Fix typo in comment
Signed-off-by: Allan McRae <allan@archlinux.org>
2022-11-08 14:20:36 +10:00
Allan McRae
05e52ef796 Document alpm_pkg_xdata_t type and accessor
Also more definitions to more relevant areas in alpm.h.

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-11-08 14:19:35 +10:00
Allan McRae
83e5326ac9 Remove obsolete Doxyfile declarations
Signed-off-by: Allan McRae <allan@archlinux.org>
2022-11-08 11:49:31 +10:00
Allan McRae
b2c9543ea9 Use modern openssl interfaces for calculating MD5 and SHA256 checksum
The currently used openssl interfaces for calculating checksums have been
deprecated in openssl-3.0.  Move to the modern interfaces to avoid build
warnings.

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-11-07 16:58:29 +10:00
Morten Linderud
3ed08f97ec
executable/meson.build: include debugedit.sh.in
Signed-off-by: Morten Linderud <morten@linderud.pw>
2022-11-07 01:02:12 +01:00
Andrew Gregory
da68447ec6 set bash env variables before running scripts
Bash sources user configuration files under a number of conditions that
can cause issues with scripts when bash is used as the scriptlet shell.

Bash assumes it's being run under rsh/ssh if stdin is connected to a
socket and sources the user bashrc unless the environment variable
$SHLVL is >= 2.  Commit 6a4c6a02de
switched from pipes to sockets when communicating with child processes
to work around SIGPIPE issues.  Normally $SHLVL would be inherited from
the shell running pacman, but operations involving scriptlets are
generally run with sudo which does not let the $SHLVL variable through
unless specifically configured to.

Similarly $BASH_ENV can cause bash to source user-specified configuration
files if set.

https://lists.gnu.org/archive/html/help-bash/2022-02/msg00082.html

Note: the list discussion and bash source all reference SHLVL >= 2, this
is the SHLVL value *after* bash has incremented it on startup.  Setting
it to 1 in pacman is sufficient to disable the unwanted behavior.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
2022-10-15 10:40:59 -07:00
Allan McRae
86981383a2 Fix missing if
Signed-off-by: Allan McRae <allan@archlinux.org>
2022-10-09 13:43:31 +10:00
Frederik Schwan
de11824527 strip: Include .o files in strip operation
`.o` objects used to be omitted by strip.sh due to a missing match in
the `Relocatable file` section. This patch fixes the issue by handling
`.o` objects similar to kernel modules.

fixes FS#74941

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-10-09 11:01:12 +10:00
Morten Linderud
478af273df strip: fix unique source paths
`${pkgbase}` was added to the wrong invocation. This ensures we are
producing correct debug packages.

Example from the package:

    /usr/src/debug/pacman/pacman-6.0.2/src/pacman/callback.c
    /usr/src/debug/pacman/pacman-6.0.2/src/pacman/callback.h
    /usr/src/debug/pacman/pacman-6.0.2/src/pacman/check.c
    /usr/src/debug/pacman/pacman-6.0.2/src/pacman/check.h

Fixes: 776b7c1e75 ("debugflags: Ensure we have unique source paths")
Signed-off-by: Morten Linderud <morten@linderud.pw>
Signed-off-by: Allan McRae <allan@archlinux.org>
2022-10-09 10:57:26 +10:00
Allan McRae
efd0c24c07 Always create directories outputted from debugedit in debug packages
The debugedit call to list all source files may include things like
build/<...>.  We have been filtering out these <> files, but they can
point to the build directory which is important to be available for
relative source paths stored in the .debug files.

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-10-08 21:07:45 +10:00
Allan McRae
a6b06a5b17 libmakepkg: fix compatibility with bash-5.2 globskipdots
Bash 5.2 has a new globskipdots option, which is enabled by default. The
check_dotfiles lint fails with globskipdots due to the assumption that
at least the "." and ".." paths will match. Disabling globskipdots would
be the usual solution, but that fails on bash<5.2.  Instead, enable
nullglob for this check.

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-10-02 11:40:52 +10:00
Allan McRae
546433b4fd Update Transifex client usage instructions
Signed-off-by: Allan McRae <allan@archlinux.org>
2022-09-26 21:10:54 +10:00
Allan McRae
e10751a1e0 Update Transifex config
Signed-off-by: Allan McRae <allan@archlinux.org>
2022-09-26 20:53:48 +10:00
Kristian Klausen
673ce1ab10 pacman-key: Don't check gpg's trustdb after each key revocation
The trustdb is marked as dirty when a key is revoked[1] and GPG will
recheck it the next time. Checking the trustdb can take 300-500ms which
with 52 revoked keys (and counting) adds up.

This is very noticeable when initializing and populating pacman's
keyring like archiso is doing[2]. It is also unnecessary as the trustdb
is always checked as the last step when populating the keyring.

[1] https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob;f=g10/keyedit.c;h=1cb62de8a87a823e06b2ed74efdc9e7a4cd99e2b;hb=refs/heads/STABLE-BRANCH-2-2#l6509
[2] https://gitlab.archlinux.org/archlinux/archiso/-/issues/191
2022-09-26 20:22:11 +10:00
Allan McRae
53dd3e844a makepkg.8: add missing fullstop
Fixes FS#75838

Signed-off-by: Allan McRae <allan@archlinux.org>
2022-09-07 23:14:12 +10:00
Ben Westover
656abdb256 doc: Create documentation for pacman-db-upgrade and testpkg
There are two "binaries" that are currently missing documentation,
pacman-db-upgrade and testpkg. This patch adds that documentation.

Signed-off-by: Ben Westover <kwestover.kw@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
2022-08-04 22:29:27 +10:00
Ben Westover
064e556c4e doc: Fix grammar in pacman.8.asciidoc
Signed-off-by: Ben Westover <kwestover.kw@gmail.com>
2022-08-02 23:04:22 +10:00
soloturn
184f593168 libmakepkg: Fix git clone command
Commit e017a5975c introduced the GITFLAGS
environmental variable. While ensuring the default of "--mirror" was
kept, there was a capitalisation mistake made. Handle the default for
GITFLAGS directly in the git clone command.
2022-08-02 13:07:09 +10:00
soloturn
e017a5975c makepkg: Add GITFLAGS environmental variable to customise checkout
The default flag used to clone a git repository when using makepkg
is "--mirror". However, when working with huge repositories, the use
of different flags during cloning can allow an faster checkout. For
example, using "--filter=blob:none" allows for small checkouts, at
the expense of requiring downloads during the build stage if anything
but the HEAD commit is used for the build. In addition, this example
would serve as a replacement for the often requested (but broken)
addition of --depth=1.

Add support for the environment variable GITFLAG to pass flags for
the git clone command. Note that this overrides the default rather
than adding to it in order to prevent incompatibilities.
2022-07-29 11:00:01 +10:00
Daan De Meyer
79bd512181 Add --keyringdir meson option to configure the keyring directory
On Debian, keyrings are stored in /usr/share/keyrings. To support
this, let's add a new --keyringdir option that allows configuring
the directory under datarootdir where the keyrings should be
imported from. We default to 'pacman/keyrings' for backwards
compatibility.
2022-07-29 10:17:52 +10:00
Alexander F. Rødseth
51b2e1c973 pacman: let the progress bar "C"/"c" move up and down at a more regular rate
For some terminal widths, the "C"/"c" character does not alternate at
regular intervals, but may look like it is stuck at either lowercase or
uppercase.

The previous behavior toggled based on the character position, while this
new behavior toggles the chomp alternation based on the progress percentage value.

This leads to slightly improved chomping.

Signed-off-by: Alexander F. Rødseth <xyproto@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
2022-07-29 09:44:04 +10:00