You are not logged in.

#1 2016-12-12 23:33:30

sharethewisdom
Member
Registered: 2014-09-22
Posts: 60

failed to run hook when trying to upgrade the filesystem package

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

#2 2016-12-12 23:43:06

apg
Developer
Registered: 2012-11-10
Posts: 211

Re: failed to run hook when trying to upgrade the filesystem package

Look at pacman's output; that is not the hook that failed.

Offline

#3 2016-12-13 09:34:33

sharethewisdom
Member
Registered: 2014-09-22
Posts: 60

Re: failed to run hook when trying to upgrade the filesystem package

roll 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

#4 2016-12-13 11:08:56

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,385
Website

Re: failed to run hook when trying to upgrade the filesystem package

It seems "tmp/*" matches "tmp/".  The filesystem package contains the tmp/ directory.

Offline

#5 2016-12-13 11:50:33

apg
Developer
Registered: 2012-11-10
Posts: 211

Re: failed to run hook when trying to upgrade the filesystem package

It also contains directories in "usr/local/".

Offline

#6 2016-12-13 13:55:10

sharethewisdom
Member
Registered: 2014-09-22
Posts: 60

Re: failed to run hook when trying to upgrade the filesystem package

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

#7 2016-12-14 18:07:48

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: failed to run hook when trying to upgrade the filesystem package

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

Board footer

Powered by FluxBB