metadata_script.sh: improve the INSTALL/REMOVE scripts.
--HG-- extra : convert_revision : 70e6088c94a274cfc862552e08aca60e790c29c3
This commit is contained in:
parent
2df068741c
commit
7a40cfcfe8
1 changed files with 12 additions and 6 deletions
|
@ -28,7 +28,6 @@ xbps_write_metadata_scripts_pkg()
|
||||||
local action="$1"
|
local action="$1"
|
||||||
local metadir="${DESTDIR}/var/db/xbps/metadata/$pkgname"
|
local metadir="${DESTDIR}/var/db/xbps/metadata/$pkgname"
|
||||||
local tmpf=$(mktemp -t xbps-install.XXXXXXXXXX) || exit 1
|
local tmpf=$(mktemp -t xbps-install.XXXXXXXXXX) || exit 1
|
||||||
local triggerdir="./var/db/xbps/triggers"
|
|
||||||
local targets found
|
local targets found
|
||||||
|
|
||||||
case "$action" in
|
case "$action" in
|
||||||
|
@ -54,6 +53,11 @@ xbps_write_metadata_scripts_pkg()
|
||||||
|
|
||||||
export PATH="./bin:./sbin:./usr/bin:./usr/sbin"
|
export PATH="./bin:./sbin:./usr/bin:./usr/sbin"
|
||||||
|
|
||||||
|
TRIGGERSDIR="./var/db/xbps/triggers"
|
||||||
|
ACTION="\$2"
|
||||||
|
PKGNAME="\$3"
|
||||||
|
VERSION="\$4"
|
||||||
|
|
||||||
_EOF
|
_EOF
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -66,6 +70,7 @@ _EOF
|
||||||
fi
|
fi
|
||||||
if [ -n "${sgml_entries}" ]; then
|
if [ -n "${sgml_entries}" ]; then
|
||||||
echo "export sgml_entries=\"${sgml_entries}\"" >> $tmpf
|
echo "export sgml_entries=\"${sgml_entries}\"" >> $tmpf
|
||||||
|
echo >> $tmpf
|
||||||
fi
|
fi
|
||||||
if [ -n "${xml_catalogs}" ]; then
|
if [ -n "${xml_catalogs}" ]; then
|
||||||
for catalog in ${xml_catalogs}; do
|
for catalog in ${xml_catalogs}; do
|
||||||
|
@ -74,19 +79,20 @@ _EOF
|
||||||
fi
|
fi
|
||||||
if [ -n "${xml_entries}" ]; then
|
if [ -n "${xml_entries}" ]; then
|
||||||
echo "export xml_entries=\"${xml_entries}\"" >> $tmpf
|
echo "export xml_entries=\"${xml_entries}\"" >> $tmpf
|
||||||
|
echo >> $tmpf
|
||||||
fi
|
fi
|
||||||
echo >> $tmpf
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Handle X11 font updates via mkfontdir/mkfontscale.
|
# Handle X11 font updates via mkfontdir/mkfontscale.
|
||||||
#
|
#
|
||||||
if [ -n "${font_dirs}" ]; then
|
if [ -n "${font_dirs}" ]; then
|
||||||
echo "font_dirs=\"${font_dirs}\"" >> $tmpf
|
echo "export font_dirs=\"${font_dirs}\"" >> $tmpf
|
||||||
|
echo >> $tmpf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$triggers" ]; then
|
if [ -n "$triggers" ]; then
|
||||||
found=1
|
found=1
|
||||||
echo "case \"\$2\" in" >> $tmpf
|
echo "case \"\${ACTION}\" in" >> $tmpf
|
||||||
echo "pre)" >> $tmpf
|
echo "pre)" >> $tmpf
|
||||||
for f in ${triggers}; do
|
for f in ${triggers}; do
|
||||||
if [ ! -f $XBPS_TRIGGERSDIR/$f ]; then
|
if [ ! -f $XBPS_TRIGGERSDIR/$f ]; then
|
||||||
|
@ -100,7 +106,7 @@ _EOF
|
||||||
if ! $(echo $j|grep -q pre-${action}); then
|
if ! $(echo $j|grep -q pre-${action}); then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
printf "\t$triggerdir/$f run $j $pkgname $version\n" >> $tmpf
|
printf "\t\${TRIGGERSDIR}/$f run $j \${PKGNAME} \${VERSION}\n" >> $tmpf
|
||||||
printf "\t[ \$? -ne 0 ] && exit \$?\n" >> $tmpf
|
printf "\t[ \$? -ne 0 ] && exit \$?\n" >> $tmpf
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
@ -112,7 +118,7 @@ _EOF
|
||||||
if ! $(echo $j|grep -q post-${action}); then
|
if ! $(echo $j|grep -q post-${action}); then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
printf "\t$triggerdir/$f run $j $pkgname $version\n" >> $tmpf
|
printf "\t\${TRIGGERSDIR}/$f run $j \${PKGNAME} \${VERSION}\n" >> $tmpf
|
||||||
printf "\t[ \$? -ne 0 ] && exit \$?\n" >> $tmpf
|
printf "\t[ \$? -ne 0 ] && exit \$?\n" >> $tmpf
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue