2009-03-12 11:16:08 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Registers or unregisters info files for a package.
|
|
|
|
#
|
|
|
|
# Arguments: $1 = action [run/targets]
|
|
|
|
# $2 = target [post-install/pre-remove]
|
|
|
|
# $3 = pkgname
|
|
|
|
#
|
2009-05-19 02:13:58 +02:00
|
|
|
installinfo=usr/bin/install-info
|
|
|
|
infodir=usr/share/info
|
2009-03-12 11:16:08 +01:00
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
targets)
|
|
|
|
echo "post-install pre-remove"
|
|
|
|
;;
|
|
|
|
run)
|
2009-07-30 12:34:31 +02:00
|
|
|
[ ! -x "$installinfo" ] && exit 0
|
2009-03-12 11:16:08 +01:00
|
|
|
|
2009-07-30 12:34:31 +02:00
|
|
|
if [ -z "$info_files" ]; then
|
|
|
|
echo "Trigger info-files: empty info_files."
|
2009-03-12 11:16:08 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2009-07-30 12:34:31 +02:00
|
|
|
for f in ${info_files}; do
|
|
|
|
[ "$f" = "/usr/share/info/dir" ] && continue
|
2009-03-12 11:16:08 +01:00
|
|
|
|
|
|
|
case "$2" in
|
|
|
|
post-install)
|
2009-07-30 12:34:31 +02:00
|
|
|
echo -n "Registering info file: $f... "
|
2009-03-12 11:16:08 +01:00
|
|
|
;;
|
|
|
|
pre-remove)
|
2009-07-30 12:34:31 +02:00
|
|
|
echo -n "Unregistering info file: $f... "
|
2009-03-12 11:16:08 +01:00
|
|
|
infoargs="--delete"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2009-07-30 12:34:31 +02:00
|
|
|
$installinfo $infoargs ./$f $infodir/dir 2>/dev/null
|
2009-03-12 11:16:08 +01:00
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
echo "done."
|
|
|
|
else
|
|
|
|
echo "failed!"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|