33 lines
745 B
Plaintext
33 lines
745 B
Plaintext
|
#!/bin/sh -efu
|
||
|
#
|
||
|
# File triggers are run at the end of successful transaction.
|
||
|
#
|
||
|
# Copyright (C) 2008 Alexey Tourbin <at@altlinux.org>
|
||
|
#
|
||
|
# Vaguely based on filetriggers.patch from Mandriva Linux.
|
||
|
#
|
||
|
# This program is free software; you can redistribute it and/or modify
|
||
|
# it under the terms of the GNU General Public License as published by
|
||
|
# the Free Software Foundation; either version 2 of the License, or
|
||
|
# (at your option) any later version.
|
||
|
|
||
|
filelist=$1
|
||
|
shift
|
||
|
|
||
|
RC=0
|
||
|
|
||
|
if [ -s "$filelist" ]; then
|
||
|
LC_ALL=C sort -u -o "$filelist" "$filelist"
|
||
|
set +f
|
||
|
for filetrigger in @RPMCONFIGDIR@/*.filetrigger; do
|
||
|
[ -x "$filetrigger" ] || continue
|
||
|
"$filetrigger" <"$filelist" ||
|
||
|
{
|
||
|
echo >&2 "$filetrigger failed"
|
||
|
RC=1
|
||
|
}
|
||
|
done
|
||
|
fi
|
||
|
|
||
|
exit $RC
|