Fix typo in acinclude.m4 fs_old_*flags

Introduced in commit d2669b47.

Signed-off-by: Dan McGee <dan@archlinux.org>
Fix thinko in configure.ac CFLAGS empty checking

Since commit d2669b47, CFLAGS specified on the command line haven't been
respected at all, resulting in no optimization being applied to builds.
This exposed one warning flag issue in some new code, which is also
fixed here.

Signed-off-by: Dan McGee <dan@archlinux.org>
Skip reading sync db deltas files if UseDelta is unset

Signed-off-by: Allan McRae <allan@archlinux.org>
Add configuration option for Upgrade operation SigLevel

Add LocalFileSigLevel and RemoteFileSigLevel to control the signature
checking for "pacman -U <file>" and "pacman -U <url>" operations
respectively. The starting value for both these options is SigLevel,
if it is specified in the [options] section, or the built-in system
default. The specified values override and/or supplement this initial
value. Note there is no destintion between setting "Required" and
"PackageRequired" as there is not database options for Upgrade
operations.

Signed-off-by: Allan McRae <allan@archlinux.org>
Quieten the build process some more

Signed-off-by: Allan McRae <allan@archlinux.org>
pacman: print version information in debug output

Signed-off-by: Allan McRae <allan@archlinux.org>
pacman-key: handle local signing of multiple keys

gpg --lsign-key does not like being given multiple keys to sign.

Signed-off-by: Allan McRae <allan@archlinux.org>
pacman-key: reduce verbosity of --populate

Do not bother the user with gpg's verbose output.

Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
Use execvp for running programs in chroot

This makes us more robust to utilities changing paths.  There is no
functional change when a full path is specified.

Signed-off-by: Allan McRae <allan@archlinux.org>
Do not use full path for ldconfig

The ldconfig binary is not guaranteed to be in /sbin. Change to calling
just "ldconfig" rather than using the full path.

This removed the check that the ldconfig binary exists. However, it is
a reasonable assumption that it will exist if its configuration file
does.

Signed-off-by: Allan McRae <allan@archlinux.org>
Do not require full path for scriptlet shell

This increases robustness to the shell location changing paths.

Signed-off-by: Allan McRae <allan@archlinux.org>
pactest: Provide a full filelist to the pactests that need it

It turns out when you set the filelist for a package to include
"usr/lib/foo" in the pactest suite, it thinks there is only the
file "usr/lib/foo" in there...  No "usr/" or "usr/lib/" directory.
This makes life difficult when testing code that scrolls through
a filelist looking for directory entries.

Signed-off-by: Allan McRae <allan@archlinux.org>
Detect inter-package conflicts between files and directories

Detect a conflict between a file/symlink in one package and a directory
in another when both are being installed at once.

A side effect is the creation of conflicts between a directory symlink
and a real directory (e.g lib -> usr/lib in pkg1 and /lib in pkg2).
Given we can not guarantee pkg1 is installed before pkg2, this is a
genuine conflict.

Signed-off-by: Allan McRae <allan@archlinux.org>
Add resolved_path to alpm_filelist_t

Add an array to hold the resolved paths of the files in alpm_filelist_t.
When the file name and its resolved file name are identical, the pointer
to the original file name is used to avoid duplicate memory allocation.

Signed-off-by: Allan McRae <allan@archlinux.org>
Add _alpm_filelist_resolve

The _alpm_filelist_resolve function takes a filelist and creates
a list with any symlinks in directory paths resolved.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
_alpm_filelist_resolve: use original filenames where possible

If a filename isn't resolved, the original can be used instead of strdup()ing
it.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Resolve file paths during inter-package conflict check

File paths are resolved if necessary during inter-package conflict
checks so that packages carrying the same effective file due to
directory symlinks on the filesystem are flagged as conflicting.

Signed-off-by: Allan McRae <allan@archlinux.org>
Avoid upgrade conflict with unchanged effective path

This applies to a case such as when /lib is a symlink to /usr/lib. If a
package is installed which contains /lib/libfoo.so, pacman will complain
if this package is then "fixed" to contain /usr/lib/libfoo.so. Since
these have the same effective path and it exists within the same
package, ignore the conflict.

Fixes FS#30681.

Signed-off-by: Allan McRae <allan@archlinux.org>
_alpm_filelist_resolve: add useful return code

Return -1 if a path is too long to resolve or we run out of memory.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Notify of removed package required as optdepend

When a package is being removed, provide a notification (via a callback)
if any local package requires it as an optdepend.

Signed-off-by: Allan McRae <allan@archlinux.org>