We were comparing files based on resolved paths but returning the
original file_t structures, which were not necessarily in the same
order. The additional file_t information was never used, so just return
the resolved path.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
alpm_filelist_intersection returns a list of pointers to internal file_t
struct's, so only the list itself should be freed.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Installing filesystem entries first allows the filesystem to provide
a symlink to a directory. Packages will then be able to use the symlink
as if it were a directory instead of causing an error.
For example:
self.filesystem = ["dir/", "link -> dir/"]
pkg = pmpkg("pkg1")
pkg.files = ["link/file"]
self.addpkg2db("local", pkg)
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
'/' should not be appended to the resolved root when root is "/".
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Supported by libarchive as of version 3.1.0 when compiled against lzo2
or in the presence of the lzop binary.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
Arch Linux typically runs into this with /sys when upgrading the
filesystem package in build chroots, but LXC users might also run into
this, since their /sys is shared from the host and must, for security
reasons, be mounted RO.
I've neglected to add any tests for this because they would require root
in order to run. Current tests all pass with this patch and I've
confirmed the desired behavior in a VM. Incidentally, the first hunk of
this patch (skipping can_remove_file checks for directories) resolves the
case of API mountpoints being removed since they eventually fall into
unlink_file and fail with "contains files". However, this patch should
still be the Right Thing To Do™, as we can't possibly remove a directory
that is also a mountpoint.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
[Allan] Do not skip checking if directories can be removed. Instead test
if directories are mountpoints in can_remove_file.
Signed-off-by: Allan McRae <allan@archlinux.org>
We record whether the default SigLevel is set in order to add upon
it for the *FileSigLevel entries. When using the only valid value
of "SigLevel = Never" with non-gpgme builds, we need to ignore
the ALPM_SIG_PACKAGE_SET flag when determining if we have a valid
value for the database SigLevel.
Signed-off-by: Allan McRae <allan@archlinux.org>
The gpgme detection had a couple of issues which are fixed:
1) In some cases it would not error out when gpgme was missing and
--with-gpgme was passed.
2) In some cases, the CFLAGS/LDFLAGS etc would not be properly
restored.
Signed-off-by: Allan McRae <allan@archlinux.org>
Fixes all clang warnings with -Wformat-literal.
Also, fix genuine formating issue discovered once adding these attributes
and add a cast to prevent a gcc warning.
Signed-off-by: Allan McRae <allan@archlinux.org>
gcc gives an error on an unknown warning flag, but clang just gives a
warning. Upgrade the warning in clang to an error by activating
-Werror=unknown-warning-option if available.
Signed-off-by: Allan McRae <allan@archlinux.org>
In makepkg, passing -sr --needed causes there to be a conflict when
pacman goes to remove the dependencies, as the --needed flag is not an
option for pacman -R. This patch makes --needed not get added to the
PACMAN_OPTS array, but it acts like ASDEPS, and is only added to an
install function.
Signed-off-by: William Giokas <1007380@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This also lead me to notice that in _alpm_gpgme_checksig many things
were not being cleaned up. Fix this by having CHECK_ERR goto gpg_error
and make the required adjustments.
Signed-off-by: Allan McRae <allan@archlinux.org>
When installing a package with "pacman -U" that has a detached
signature, check if the needed key is in the keyring and download
if necessary.
Signed-off-by: Allan McRae <allan@archlinux.org>
Now that the keyring is checked for all needed keys before the
validation, we can not reach a point of a missing key when doing
validity checks for sync operations.
Signed-off-by: Allan McRae <allan@archlinux.org>
Keys used to create signatures are checked for presence in the keyring
before package validation is performed.
Signed-off-by: Allan McRae <allan@archlinux.org>
Conflicts:
lib/libalpm/alpm.h
Signed-off-by: Allan McRae <allan@archlinux.org>
This does not support all possibilities of RFC4880, but it does
cover every key currently used in Arch Linux.
Signed-off-by: Allan McRae <allan@archlinux.org>
This will be useful for checking the availablity of all keys before
perfoming validation in sync operations and for downloading a needed
key in upgrade operations.
Signed-off-by: Allan McRae <allan@archlinux.org>
We don't want test files to do any checks for fakechroot since we will
print a warning if it is not found.
Signed-off-by: Chirantan Ekbote <chirantan.ekbote@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This prevents multiple spaces between values from being
parsed as empty values.
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Rearrange the functions section of the PKGBUILD man package. Clarify
that the package() function is a requirement and the rest are all
optional. Note that $pkgdir should only be used in the package()
function.
Signed-off-by: Allan McRae <allan@archlinux.org>
The idea of having separate build() and package() functions is that
build() is run as a normal uses and package() as (fake)root. Any
files placed in $pkgdir during build() can have the wrong permissions.
Restrict access to $pkgdir during build() - unless there is no package()
function.
Also, set $pkgdir to something "useful" during build(). For split
packages, this uses "<path>/pkg/$pkgbase" because it is not obvious
which $pkgdir is being referred to.
Signed-off-by: Allan McRae <allan@archlinux.org>