xbps-base-files: some changes to all triggers.
--HG-- extra : convert_revision : 2f3a39a7d1853268b84c5087cbbf5e74044c20f0
This commit is contained in:
parent
38e6679ff5
commit
5b3489c9ea
13 changed files with 56 additions and 85 deletions
|
@ -1,6 +1,6 @@
|
|||
# Template file for 'xbps-base-files'
|
||||
pkgname=xbps-base-files
|
||||
version=0.16
|
||||
version=0.17
|
||||
build_style=custom-install
|
||||
short_desc="xbps base system files"
|
||||
maintainer="Juan RP <xtraeme@gmail.com>"
|
||||
|
|
|
@ -7,23 +7,16 @@
|
|||
# $3 = pkgname
|
||||
# $4 = version
|
||||
#
|
||||
trigger="gtk-icon-cache"
|
||||
iconcache_bin=./usr/bin/gtk-update-icon-cache
|
||||
iconcache_bin=usr/bin/gtk-update-icon-cache
|
||||
|
||||
case "$1" in
|
||||
targets)
|
||||
echo "post-install post-remove"
|
||||
;;
|
||||
run)
|
||||
echo "Running $trigger trigger..."
|
||||
|
||||
case "$2" in
|
||||
post-*)
|
||||
post-install)
|
||||
for dir in ${gtk_iconcache_dirs}; do
|
||||
if [ -f ${dir}/icon-theme.cache ]; then
|
||||
rm -f ${dir}/icon-theme.cache
|
||||
echo "Removed GTK+ icon theme cache for ${dir}."
|
||||
fi
|
||||
if [ -x ${iconcache_bin} ]; then
|
||||
echo -n "Updating GTK+ icon cache for "
|
||||
echo -n "${dir}... "
|
||||
|
@ -32,6 +25,14 @@ run)
|
|||
fi
|
||||
done
|
||||
;;
|
||||
post-remove)
|
||||
for dir in ${gtk_iconcache_dirs}; do
|
||||
if [ -f ${dir}/icon-theme.cache ]; then
|
||||
rm -f ${dir}/icon-theme.cache
|
||||
echo "Removed GTK+ icon theme cache for ${dir}."
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
|
|
|
@ -7,21 +7,19 @@
|
|||
# $3 = pkgname
|
||||
# $4 = version
|
||||
#
|
||||
trigger="gtk-immodules"
|
||||
immodules_bin=./usr/bin/gtk-query-immodules-2.0
|
||||
immodules_db=./etc/gtk-2.0/gtk.immodules
|
||||
immodules_bin=usr/bin/gtk-query-immodules-2.0
|
||||
immodules_db=etc/gtk-2.0/gtk.immodules
|
||||
|
||||
case "$1" in
|
||||
targets)
|
||||
echo "post-install post-remove"
|
||||
;;
|
||||
run)
|
||||
echo "Running $trigger trigger..."
|
||||
|
||||
case "$2" in
|
||||
post-*)
|
||||
if [ -f ${immodules_db} ]; then
|
||||
rm -f ${immodules_db}
|
||||
if [ "${PKGNAME}" = "gtk+" ]; then
|
||||
[ -f ${immodules_db} ] rm -f ${immodules_db}
|
||||
break
|
||||
fi
|
||||
if [ -x ${immodules_bin} ]; then
|
||||
echo "Updating GTK's immodules database..."
|
||||
|
|
|
@ -7,21 +7,19 @@
|
|||
# $3 = pkgname
|
||||
# $4 = version
|
||||
#
|
||||
trigger="gtk-pixbuf-loaders"
|
||||
pixbuf_bin=./usr/bin/gdk-pixbuf-query-loaders
|
||||
pixbuf_loaders=./etc/gtk-2.0/gdk-pixbuf.loaders
|
||||
pixbuf_bin=usr/bin/gdk-pixbuf-query-loaders
|
||||
pixbuf_loaders=etc/gtk-2.0/gdk-pixbuf.loaders
|
||||
|
||||
case "$1" in
|
||||
targets)
|
||||
echo "post-install post-remove"
|
||||
;;
|
||||
run)
|
||||
echo "Running $trigger trigger..."
|
||||
|
||||
case "$2" in
|
||||
post-*)
|
||||
if [ -f ${pixbuf_loaders} ]; then
|
||||
rm -f ${pixbuf_loaders}
|
||||
if [ "${PKGNAME}" = "gtk+" ]; then
|
||||
[ -f ${pixbuf_loaders} ] && rm -f ${pixbuf_loaders}
|
||||
break
|
||||
fi
|
||||
if [ -x ${pixbuf_bin} ]; then
|
||||
echo "Updating GTK's pixbuf modules file..."
|
||||
|
|
|
@ -6,12 +6,10 @@
|
|||
# $2 = target [post-install/pre-remove]
|
||||
# $3 = pkgname
|
||||
#
|
||||
trigger="info-files"
|
||||
|
||||
xbps_metadir="./var/db/xbps/metadata"
|
||||
finfometa="$xbps_metadir/$3/$trigger"
|
||||
installinfo="./usr/bin/install-info"
|
||||
infodir="./usr/share/info"
|
||||
xbps_metadir=var/db/xbps/metadata
|
||||
finfometa=$xbps_metadir/$3/info-files
|
||||
installinfo=usr/bin/install-info
|
||||
infodir=usr/share/info
|
||||
|
||||
case "$1" in
|
||||
targets)
|
||||
|
@ -25,8 +23,6 @@ run)
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo "Running $trigger trigger..."
|
||||
|
||||
cat $finfometa | while read line; do
|
||||
[ ! -f ./$line ] && continue
|
||||
[ "$line" = "/usr/share/info/dir" ] && continue
|
||||
|
|
|
@ -9,19 +9,14 @@
|
|||
# $3 = pkgname
|
||||
# $4 = version
|
||||
#
|
||||
trigger="initramfs-tools"
|
||||
|
||||
case "$1" in
|
||||
targets)
|
||||
echo "post-install"
|
||||
;;
|
||||
run)
|
||||
[ ! -x usr/sbin/update-initramfs ] && exit 0
|
||||
[ ! -x lib/rc/bin/mountinfo ] && exit 0
|
||||
[ "$2" != "post-install" ] && exit 1
|
||||
|
||||
echo "Running $trigger trigger..."
|
||||
|
||||
initramfs_cmd="update-initramfs"
|
||||
|
||||
if [ "$3" = "kernel" -a ! -f ./var/lib/initramfs-tools/$4 ]; then
|
||||
|
|
|
@ -7,21 +7,18 @@
|
|||
# $3 = pkgname
|
||||
# $4 = version
|
||||
#
|
||||
trigger="mimedb"
|
||||
mimedb_bin=./usr/bin/update-mime-database
|
||||
mimedb_bin=usr/bin/update-mime-database
|
||||
|
||||
case "$1" in
|
||||
targets)
|
||||
echo "post-install post-remove"
|
||||
;;
|
||||
run)
|
||||
echo "Running $trigger trigger..."
|
||||
|
||||
case "$2" in
|
||||
post-*)
|
||||
if [ -x ${mimedb_bin} ]; then
|
||||
echo "Updating shared-mime-info database..."
|
||||
${mimedb_bin} ./usr/share/mime > /dev/null
|
||||
${mimedb_bin} usr/share/mime > /dev/null
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -7,8 +7,6 @@
|
|||
# $2 = target [post-install/pre-remove]
|
||||
# $3 = pkgname
|
||||
#
|
||||
trigger="openrc-service"
|
||||
|
||||
case "$1" in
|
||||
targets)
|
||||
echo "post-install pre-remove"
|
||||
|
@ -28,8 +26,6 @@ run)
|
|||
exit 1
|
||||
fi
|
||||
|
||||
echo "Running trigger ${trigger}..."
|
||||
|
||||
[ ! -f etc/fstab ] && touch etc/fstab
|
||||
|
||||
set -- ${openrc_services}
|
||||
|
|
|
@ -7,25 +7,25 @@
|
|||
# $3 = pkgname
|
||||
# $4 = version
|
||||
#
|
||||
trigger="pango-modules"
|
||||
pango_bin=./usr/bin/pango-querymodules
|
||||
pango_modules=./etc/pango/pango.modules
|
||||
pango_bin=usr/bin/pango-querymodules
|
||||
pango_modules=etc/pango/pango.modules
|
||||
|
||||
case "$1" in
|
||||
targets)
|
||||
echo "post-install post-remove"
|
||||
;;
|
||||
run)
|
||||
echo "Running $trigger trigger..."
|
||||
|
||||
case "$2" in
|
||||
post-*)
|
||||
if [ -f ${pango_modules} ]; then
|
||||
echo "Removing $trigger list file..."
|
||||
rm -f ${pango_modules}
|
||||
if [ "${PKGNAME}" = "pango" ]; then
|
||||
if [ -f ${pango_modules} ]; then
|
||||
echo "Removing pango modules file..."
|
||||
rm -f ${pango_modules}
|
||||
fi
|
||||
break
|
||||
fi
|
||||
if [ -x ${pango_bin} ]; then
|
||||
echo "Creating $trigger list file..."
|
||||
echo "Updating pango modules file..."
|
||||
${pango_bin} > ${pango_modules}
|
||||
fi
|
||||
;;
|
||||
|
|
|
@ -7,8 +7,7 @@
|
|||
# $3 = pkgname
|
||||
# $4 = version
|
||||
#
|
||||
trigger="register-shell"
|
||||
shells_file="./var/db/xbps/metadata/$3/shells"
|
||||
shells_file=var/db/xbps/metadata/$3/shells
|
||||
|
||||
case "$1" in
|
||||
targets)
|
||||
|
@ -18,20 +17,18 @@ run)
|
|||
[ "$2" != "post-install" -a "$2" != "post-remove" ] && exit 1
|
||||
[ ! -f ${shells_file} ] && exit 1
|
||||
|
||||
echo "Running $trigger trigger..."
|
||||
|
||||
case "$2" in
|
||||
post-install)
|
||||
if [ ! -f ./etc/shells ]; then
|
||||
if [ ! -f etc/shells ]; then
|
||||
cat ${shells_file} | while read line; do
|
||||
echo $line >> ./etc/shells
|
||||
echo $line >> etc/shells
|
||||
echo "Registered $line into /etc/shells."
|
||||
done
|
||||
chmod 644 ./etc/shells
|
||||
chmod 644 etc/shells
|
||||
else
|
||||
cat ${shells_file} | while read line; do
|
||||
if ! grep -q $line ./etc/shells; then
|
||||
echo $line >> ./etc/shells
|
||||
if ! grep -q $line etc/shells; then
|
||||
echo $line >> etc/shells
|
||||
echo -n "Registered $line into "
|
||||
echo "/etc/shells."
|
||||
fi
|
||||
|
@ -39,11 +36,11 @@ run)
|
|||
fi
|
||||
;;
|
||||
post-remove)
|
||||
if [ -f ./etc/shells ]; then
|
||||
if [ -f etc/shells ]; then
|
||||
cat ${shells_file} | while read line; do
|
||||
if grep -q $line ./etc/shells; then
|
||||
if grep -q $line etc/shells; then
|
||||
shell=$(echo $line|sed "s|\\/|\\\/|g")
|
||||
sed -i -e "/$shell/d" ./etc/shells
|
||||
sed -i -e "/$shell/d" etc/shells
|
||||
echo -n "Unregistered $line from "
|
||||
echo "/etc/shells."
|
||||
fi
|
||||
|
|
|
@ -8,9 +8,8 @@
|
|||
# $3 = pkgname
|
||||
# $4 = version
|
||||
#
|
||||
trigger="update-desktopdb"
|
||||
desktopdb_bin=./usr/bin/update-desktop-database
|
||||
desktopdb_dir=./usr/share/applications
|
||||
desktopdb_bin=usr/bin/update-desktop-database
|
||||
desktopdb_dir=usr/share/applications
|
||||
desktopdb_cache=${desktopdb_dir}/mimeinfo.cache
|
||||
|
||||
case "$1" in
|
||||
|
@ -18,15 +17,14 @@ targets)
|
|||
echo "post-install post-remove"
|
||||
;;
|
||||
run)
|
||||
echo "Running $trigger trigger..."
|
||||
|
||||
case "$2" in
|
||||
post-*)
|
||||
if [ -f ${desktopdb_cache} ]; then
|
||||
rm -f ${desktopdb_cache}
|
||||
if [ "${PKGNAME}" = "desktop-file-utils" ]; then
|
||||
[ -f ${desktopdb_cache} ] && rm -f ${desktopdb_cache}
|
||||
break
|
||||
fi
|
||||
if [ -x ${desktopdb_bin} ]; then
|
||||
echo "Updating MIME database for ${desktopdb_dir}..."
|
||||
echo "Updating MIME database..."
|
||||
${desktopdb_bin} ${desktopdb_dir}
|
||||
fi
|
||||
;;
|
||||
|
|
|
@ -8,11 +8,9 @@
|
|||
# $2 = target [post-install/pre-remove]
|
||||
# $3 = pkgname
|
||||
#
|
||||
trigger="x11-fonts"
|
||||
|
||||
mkfontdir=./usr/bin/mkfontdir
|
||||
mkfontscale=./usr/bin/mkfontscale
|
||||
fccache=./usr/bin/fc-cache
|
||||
mkfontdir=usr/bin/mkfontdir
|
||||
mkfontscale=usr/bin/mkfontscale
|
||||
fccache=usr/bin/fc-cache
|
||||
|
||||
case "$1" in
|
||||
targets)
|
||||
|
@ -25,8 +23,6 @@ run)
|
|||
|
||||
[ -z "${font_dirs}" ] && exit 0
|
||||
|
||||
echo "Running $trigger trigger..."
|
||||
|
||||
case "$2" in
|
||||
post-install)
|
||||
for dir in ${font_dirs}; do
|
||||
|
|
|
@ -8,9 +8,8 @@
|
|||
# $3 = pkgname
|
||||
# $4 = version
|
||||
#
|
||||
trigger="xml-catalog"
|
||||
sgml_catalog="./usr/share/sgml/catalog"
|
||||
xml_catalog="./usr/share/xml/catalog"
|
||||
sgml_catalog=usr/share/sgml/catalog
|
||||
xml_catalog=usr/share/xml/catalog
|
||||
|
||||
register_entries()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue