Fixes failure to finalize download path if the package file already
exists but the .sig file does not.
This patch also moves .sig.part files which should be done for
completeness although it's probably rare/inconsequential for them to
exist.
Hopefully this is now the right approach now. The logic is as follows:
Check if dest_name or temp_name exists and try to move whichever
does.
If neither exist assume we're just downloading sig files and don't
error.
Figure out the .sig base filename.
Try to move the .sig file if one was needed and if that fails try
move the .sig.part file.
The patch leaves the logging as is. Maybe we should check if moves fail
for reasons other than non existence and log it properly. Though this is
probably rare and pacman will error out later anyway.
Fixes#256
The xdata field is an array of key=value entries that allow a packager to
include arbitrary metadata in the generated .PKGINFO.
Fixes#241.
Signed-off-by: Dominik Peteler <archlinux+gitlab@with-h.at>
This ensures (e.g.) that the "emptydirs" script runs last after
unneeded files have been deleted.
Fixes#184.
Signed-off-by: Allan McRae <allan@archlinux.org>
The file stream associated with downloads without a filename is not
being freed when downloading using the sandbox user.
Signed-off-by: Allan McRae <allan@archlinux.org>
Note that the user provided in the DownloadUser configuration option (if
set) needs to be able to access the directory specified with the --cachedir
argument.
Fixes#216.
Signed-off-by: Allan McRae <allan@archlinux.org>
This could help locate the real failure (instead of scrolling through the whole possibly-successful buildtime dep installation section) and also saves time on the operation.
Commit 7ccf316c provided "root" (or the user name for UID 0) as a
default download user. However, when DownloadUser is unset in pacman.conf,
pacman was overwriting the default with null. Rectify this.
Fixes#248
Signed-off-by: Allan McRae <allan@archlinux.org>
Using the --wait-for-lock option will result in repo-add retrying to acquire the database lock file after 3 seconds. If the option is not set, exit with code 2 on lock failure.
While the event is already globally initialised, initialising the fields
prevents a valgrind warning (since the gcc-15 update).
Signed-off-by: Allan McRae <allan@archlinux.org>
Globally set `GIT_CONFIG_GLOBAL` and `GIT_CONFIG_SYSTEM` so that we're
only loading `/etc/makepkg.d/gitconfig` (if it exists) and no other Git
config files.
Allow injecting another value via `MAKEPKG_GIT_CONFIG`.
Fixes: https://gitlab.archlinux.org/pacman/pacman/-/issues/193
The manpage was lacking the database endings for various compression
algorithms that one can validly use, therefore we add these to the list.
Signed-off-by: Christian Heusel <christian@heusel.eu>
When using --ignorearch or options that imply it (e.g. --printsrcinfo),
all checks of the arch array were skipped. Instead, perform all checks
apart from confirming that the package can be built on that
architecture.
Signed-off-by: Allan McRae <allan@archlinux.org>
Using gdb-add-index to add a .gdb_index section before splitting
debug info (together with enabling "maintenance set debuginfod
download-sections" in GDB) can dramatically reduce the amount of
data GDB has to download.
Fixes#205.
Signed-off-by: Allan McRae <allan@archlinux.org>
The current logic sets CCACHE_PREFIX to distcc when both distcc and
ccache are enabled. However, according to the source of ccache, it would
execute the command with execv, which would not look up arg0 from PATH,
unlike those exec functions with _p suffix.
This would result in the following error, when building a package with
both ccache and distcc enabled:
```
ccache: error: execute_noreturn of distcc failed: No such file or directory
```
This breaks package builds in different ways: packages that use make/cc
directly would yield the actual error which is the same as the above
line, packages that rely on other build systems wouldn't go through
compiler check and complain on a bad compiler.
To reproduce the problem, try to build a simple package:
```
git clone https://gitlab.archlinux.org/archlinux/packaging/packages/abc.git
cd abc
cp /etc/makepkg.conf .
echo 'BUILDENV=(distcc color ccache check !sign)' >> makepkg.conf
makepkg --config makepkg.conf
```
refs:
f887434d35/src/ccache/execute.cpp (L348)https://man.archlinux.org/man/exec.3.en#v_-_execv(),_execvp(),_execvpe()
Signed-off-by: Guoxin Pu <pugokushin@gmail.com>
Repeated values in the arch array can result in architecture specific
fields being repeated when using --printsrcinfo.
Signed-off-by: Allan McRae <allan@archlinux.org>