You are not logged in.
hi,
In order for my pre-transaction hook to work,
I had to skip filesystem=2016.12-2
% sudo pacman -Syu --ignore filesystem
% sudo pacman -S filesystem
...
warning: could not get file information for etc/motd
warning: could not get file information for mnt/
:: Running pre-transaction hooks...
(1/2) destination forbidden
error: command failed to execute correctly
error: failed to commit transaction (failed to run transaction hooks)
% cat /etc/pacman.d/hooks/pre-install.hook
[Trigger]
Operation = Install
Operation = Upgrade
Operation = Remove
Type = Package
Target = *
[Action]
Description = Saving list of installed packages
When = PreTransaction
Exec = /usr/bin/sh -c "echo 'saving to /tmp/pacman.save'; /usr/bin/pacman -Qq > /tmp/pacman.save"
what's going on?
Offline
Look at pacman's output; that is not the hook that failed.
Offline
sorry I'm an idiot
Apart from the warnings I looked at the wrong hook. This is the hook that was designed to make the transaction fail on specific targets:
% cat /etc/pacman.d/hooks/destinations.hook
[Trigger]
Operation = Install
Operation = Upgrade
Type = File
Target = home/*
Target = usr/local/*
Target = tmp/*
[Action]
Description = destination forbidden
When = PreTransaction
Exec = /usr/bin/false
AbortOnFail
Offline
It seems "tmp/*" matches "tmp/". The filesystem package contains the tmp/ directory.
Offline
It also contains directories in "usr/local/".
Offline
I'm creating separate disallow-{home,tmp,usrlocal}.hook files for each target and included a more descriptive message like "The disallow-home hook prevented a package archive that contains files under home/ to install."
But it would be helpful to alert which package is causing the problem. Any ideas?
Offline
man -P 'less -p NeedsTargets' alpm-hooks
But you cannot get the package that would trigger a File hook. Although you could, theoretically, use pkgfile/pacman -F if only you could rely on those being up to date.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline