When ever pacman prints a conflict, it now prints pkgname-version,
instead of just pkgname.
alpm_conflict_t now carries *alpm_pkg_ts instead of just the
names of each package.
Fixes FS#12536 (point 2)
Controlling the type of getmntinfo's param was decided by
whether or not we had the statvfs type avaliable. But getmntinfo uses
statfs regardless of this except on netbsd where it uses statvfs.
Add a check to detect which type our version of the function uses.
MD5 isn't a very good checksum, and the PKGBUILD page on the Arch Wiki
states that it should not be used, instead recommending sha256 or b2.
This patch changes the default from md5 to sha256 because that seems to
be the most commonly used checksum today.
Signed-off-by: Ben Westover <kwestover.kw@gmail.com>
This feature makes bzr VCS build inputs immutable by adding support for
pinning a bzr checkout by a hash of its content using the deterministic
export functionality `bzr export`.
This feature allows to preserve security implications of immutable build inputs
using a trusted cryptographic hash function of the content.
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
This feature makes Mercurial VCS build inputs immutable by adding
support for pinning a Mercurial checkout by a hash of its content using
the deterministic export functionality `hg archive`.
This feature aids packagers by allowing them to use simple and
convenient refnames (instead of full commit hashes) in the `PKGBUILD`
while still preserving security implications of immutable build inputs
using a trusted cryptographic hash function of the content.
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
This feature makes Git VCS build inputs immutable by adding support for
pinning a Git checkout by a hash of its content using the deterministic
export functionality `git archive`.
This feature aids packagers by allowing them to use simple and
convenient refnames (instead of full commit hashes) in the `PKGBUILD`
while still preserving security implications of immutable build inputs
using a trusted cryptographic hash function of the content.
Previously VCS source downloads have been skipped for `--geninteg` and
`--source` as both options did not need a checkout. This commit changes
this behavior by forcing the download of all sources as integrity checks
and generation requires to have an up to date state.
Signed-off-by: Levente Polyak <anthraxx@archlinux.org>
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>
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>
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>
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>
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>
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.
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
`.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>
`${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>