From 7f522a8cf458ef52edb494672e56bc1571d1ed24 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 4 Nov 2010 13:52:10 +0100 Subject: [PATCH] xbps-src: remove the triggers, they will be handled by the xbps-triggers pkg. --- xbps-src/Makefile | 2 +- xbps-src/shutils/init_funcs.sh.in | 2 +- xbps-src/triggers/Makefile | 21 ----- xbps-src/triggers/gconf-schemas | 92 --------------------- xbps-src/triggers/gio-modules | 39 --------- xbps-src/triggers/gsettings-schemas | 57 ------------- xbps-src/triggers/gtk-icon-cache | 51 ------------ xbps-src/triggers/gtk-immodules | 43 ---------- xbps-src/triggers/gtk-pixbuf-loaders | 47 ----------- xbps-src/triggers/info-files | 58 ------------- xbps-src/triggers/initramfs-tools | 72 ----------------- xbps-src/triggers/mimedb | 38 --------- xbps-src/triggers/openrc-service | 117 --------------------------- xbps-src/triggers/pango-modules | 46 ----------- xbps-src/triggers/register-shell | 66 --------------- xbps-src/triggers/system-accounts | 84 ------------------- xbps-src/triggers/update-desktopdb | 45 ----------- xbps-src/triggers/x11-fonts | 66 --------------- xbps-src/triggers/xml-catalog | 94 --------------------- 19 files changed, 2 insertions(+), 1038 deletions(-) delete mode 100644 xbps-src/triggers/Makefile delete mode 100755 xbps-src/triggers/gconf-schemas delete mode 100755 xbps-src/triggers/gio-modules delete mode 100755 xbps-src/triggers/gsettings-schemas delete mode 100755 xbps-src/triggers/gtk-icon-cache delete mode 100755 xbps-src/triggers/gtk-immodules delete mode 100755 xbps-src/triggers/gtk-pixbuf-loaders delete mode 100755 xbps-src/triggers/info-files delete mode 100755 xbps-src/triggers/initramfs-tools delete mode 100755 xbps-src/triggers/mimedb delete mode 100755 xbps-src/triggers/openrc-service delete mode 100755 xbps-src/triggers/pango-modules delete mode 100755 xbps-src/triggers/register-shell delete mode 100755 xbps-src/triggers/system-accounts delete mode 100755 xbps-src/triggers/update-desktopdb delete mode 100755 xbps-src/triggers/x11-fonts delete mode 100755 xbps-src/triggers/xml-catalog diff --git a/xbps-src/Makefile b/xbps-src/Makefile index 01209b5e79..bb7705b60a 100644 --- a/xbps-src/Makefile +++ b/xbps-src/Makefile @@ -1,7 +1,7 @@ include vars.mk BINS = xbps-src -SUBDIRS = etc common libexec helpers triggers shutils +SUBDIRS = etc common libexec helpers shutils .PHONY: all all: diff --git a/xbps-src/shutils/init_funcs.sh.in b/xbps-src/shutils/init_funcs.sh.in index 979b8acc34..5c9f64ec56 100644 --- a/xbps-src/shutils/init_funcs.sh.in +++ b/xbps-src/shutils/init_funcs.sh.in @@ -29,7 +29,6 @@ set_defvars() instsharedir=@@XBPS_INSTALL_SHAREDIR@@ - : ${XBPS_TRIGGERSDIR:=$instsharedir/triggers} : ${XBPS_HELPERSDIR:=$instsharedir/helpers} : ${XBPS_SHUTILSDIR:=$instsharedir/shutils} : ${XBPS_COMMONVARSDIR:=$instsharedir/common} @@ -41,6 +40,7 @@ set_defvars() : ${XBPS_PACKAGESDIR:=$XBPS_MASTERDIR/pkg-binpkgs} : ${XBPS_BUILDDIR:=$XBPS_MASTERDIR/pkg-builddir} : ${XBPS_SRCDISTDIR:=$XBPS_MASTERDIR/pkg-srcdistdir} + : ${XBPS_TRIGGERSDIR:=$XBPS_SRCPKGDIR/xbps-triggers/files} DDIRS="TRIGGERSDIR HELPERSDIR SRCPKGDIR COMMONVARSDIR SHUTILSDIR" DDIRS="$DDIRS DISTRIBUTIONDIR" diff --git a/xbps-src/triggers/Makefile b/xbps-src/triggers/Makefile deleted file mode 100644 index f986c5b5a2..0000000000 --- a/xbps-src/triggers/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -include ../vars.mk - -TRIGGERS= gtk-icon-cache info-files mimedb register-shell -TRIGGERS+= xml-catalog gtk-immodules initramfs-tools openrc-service -TRIGGERS+= update-desktopdb gtk-pixbuf-loaders pango-modules x11-fonts -TRIGGERS+= system-accounts gconf-schemas gio-modules gsettings-schemas - -.PHONY: all -all: - -.PHONY: clean -clean: - -.PHONY: install -install: - install -d $(DESTDIR)$(SHAREDIR)/triggers - install -m 755 $(TRIGGERS) $(DESTDIR)$(SHAREDIR)/triggers - -.PHONY: uninstall -uninstall: - -rm -rf $(DESTDIR)$(SHAREDIR)/triggers diff --git a/xbps-src/triggers/gconf-schemas b/xbps-src/triggers/gconf-schemas deleted file mode 100755 index b3efde8ed9..0000000000 --- a/xbps-src/triggers/gconf-schemas +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/sh -e -# -# (Un)registers GConf schemas/entries into the schemas database directory. -# -# The following variables can be defined by a package to register .entries -# and .schemas files: -# -# gconf_entries - A list of .entries files to register. When using this -# variable, packages need to be fixed to not register -# them and to install those files to GCONF_SCHEMAS_DIR. -# gconf_schemas - A list of .schemas files to register. When using this -# variable, packages need to be fixed to not register -# them and to install those files to GCONF_SCHEMAS_DIR. -# -# Arguments: $ACTION = [run/targets] -# $TARGET = [post-install/pre-remove] -# $PKGNAME -# $VERSION -# $UPDATE = [yes/no] -# -ACTION="$1" -TARGET="$2" -PKGNAME="$3" -VERSION="$4" -UPDATE="$5" - -# The gconftool-2 binary program. -GCONFTOOL2="usr/bin/gconftool-2" - -# Default configuration source (database). -GCONF_CONFIG_SOURCE="xml::/etc/gconf/gconf.xml.defaults" - -# Where .schemas files go. -GCONF_SCHEMAS_DIR="usr/share/gconf/schemas" - -case "$ACTION" in -targets) - echo "post-install pre-remove" - ;; -run) - if [ ! -x "$GCONFTOOL2" ]; then - exit 0 - fi - if [ -z "$gconf_entries" -a -z "$gconf_schemas" ]; then - return 0 - fi - - case "$TARGET" in - post-install) - for f in ${gconf_schemas}; do - GCONF_CONFIG_SOURCE="$GCONF_CONFIG_SOURCE" \ - ${GCONFTOOL2} --makefile-install-rule \ - ${GCONF_SCHEMAS_DIR}/${f} >/dev/null - if [ $? -eq 0 ]; then - echo "Registered GConf schema: ${f}." - fi - done - for f in ${gconf_entries}; do - ${GCONFTOOL2} --config-source=${GCONF_CONFIG_SOURCE} \ - --direct --load ${GCONF_SCHEMAS_DIR}/${f} \ - >/dev/null - if [ $? -eq 0 ]; then - echo "Registered GConf entry: ${f}." - fi - done - ;; - pre-remove) - for f in ${gconf_entries}; do - ${GCONFTOOL2} --config-source=${GCONF_CONFIG_SOURCE} \ - --direct --unload ${GCONF_SCHEMAS_DIR}/${f} \ - >/dev/null - if [ $? -eq 0 ]; then - echo "Unregistered GConf entry: ${f}." - fi - done - for f in ${gconf_schemas}; do - GCONF_CONFIG_SOURCE="${GCONF_CONFIG_SOURCE}" \ - ${GCONFTOOL2} --makefile-uninstall-rule \ - ${GCONF_SCHEMAS_DIR}/${f} >/dev/null - if [ $? -eq 0 ]; then - echo "Unregistered GConf schema: ${f}." - fi - done - ;; - esac - ;; -*) - exit 1 - ;; -esac - -exit 0 diff --git a/xbps-src/triggers/gio-modules b/xbps-src/triggers/gio-modules deleted file mode 100755 index ae74ec7bfb..0000000000 --- a/xbps-src/triggers/gio-modules +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -e -# -# Updates GLib GIO module cache with gio-querymodules. -# -# Arguments: $ACTION = [run/targets] -# $TARGET = [post-install/post-remove] -# $PKGNAME -# $VERSION -# $UPDATE = [yes/no] -# -ACTION="$1" -TARGET="$2" -PKGNAME="$3" -VERSION="$4" -UPDATE="$5" - -gioquery=usr/bin/gio-querymodules -giocachedir=usr/lib/gio/modules - -case "$ACTION" in -targets) - echo "post-install post-remove" - ;; -run) - case "$TARGET" in - post-*) - if [ -x ${gioquery} -a -d ${giocachedir} ]; then - echo "Updating GLib GIO modules cache..." - ${gioquery} ${giocachedir} - fi - ;; - esac - ;; -*) - exit 1 - ;; -esac - -exit 0 diff --git a/xbps-src/triggers/gsettings-schemas b/xbps-src/triggers/gsettings-schemas deleted file mode 100755 index 5bd1782736..0000000000 --- a/xbps-src/triggers/gsettings-schemas +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -e -# -# GLib's GSettings XML schema files. -# -# Arguments: $ACTION = [run/targets] -# $TARGET = [post-install/pre-remove] -# $PKGNAME -# $VERSION -# $UPDATE = [yes/no] -# -ACTION="$1" -TARGET="$2" -PKGNAME="$3" -VERSION="$4" -UPDATE="$5" - -# The glib-compile-schemas binary program. -GSCHEMASCOMP="usr/bin/glib-compile-schemas" - -# Where .schemas files go. -GLIB_SCHEMAS_DIR="usr/share/glib-2.0/schemas" - -case "$ACTION" in -targets) - echo "post-install post-remove pre-remove" - ;; -run) - if [ ! -x "$GSCHEMASCOMP" ]; then - exit 0 - fi - - case "$TARGET" in - post-*) - # Compile all GSettings schema files. - echo -n "Refreshing GSettings database from " - echo -n "${GLIB_SCHEMAS_DIR}... " - ${GSCHEMASCOMP} ${GLIB_SCHEMAS_DIR} - if [ $? -eq 0 ]; then - echo "done." - else - echo "failed!" - fi - ;; - pre-remove) - if [ "${PKGNAME}" = "glib" ]; then - rm -f ${GLIB_SCHEMAS_DIR}/*.compiled - echo "Removed GSettings database file." - fi - ;; - esac - ;; -*) - exit 1 - ;; -esac - -exit 0 diff --git a/xbps-src/triggers/gtk-icon-cache b/xbps-src/triggers/gtk-icon-cache deleted file mode 100755 index 679408702a..0000000000 --- a/xbps-src/triggers/gtk-icon-cache +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh -e -# -# Updates GTK+ icon cache file with gtk-update-icon-cache(1). -# -# Arguments: $ACTION = [run/targets] -# $TARGET = [post-install/post-remove] -# $PKGNAME -# $VERSION -# $UPDATE = [yes/no] -# -ACTION="$1" -TARGET="$2" -PKGNAME="$3" -VERSION="$4" -UPDATE="$5" - -iconcache_bin=usr/bin/gtk-update-icon-cache - -case "$ACTION" in -targets) - echo "post-install post-remove" - ;; -run) - if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gtk+" ]; then - for dir in ${gtk_iconcache_dirs}; do - if [ -f ${dir}/icon-theme.cache ]; then - rm -f ${dir}/icon-theme.cache - echo -n "Removed GTK+ icon theme " - echo "cache for ${dir}." - fi - done - break - fi - case "$TARGET" in - post-*) - for dir in ${gtk_iconcache_dirs}; do - if [ -x ${iconcache_bin} ]; then - echo -n "Updating GTK+ icon cache for " - echo "${dir}..." - ${iconcache_bin} -q -f -t ${dir} - fi - done - ;; - esac - ;; -*) - exit 1 - ;; -esac - -exit 0 diff --git a/xbps-src/triggers/gtk-immodules b/xbps-src/triggers/gtk-immodules deleted file mode 100755 index 1f534e8376..0000000000 --- a/xbps-src/triggers/gtk-immodules +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -e -# -# Updates GTK+ IM modules file with gtk-query-immodules-2.0(1). -# -# Arguments: $ACTION = [run/targets] -# $TARGET = [post-install/post-remove] -# $PKGNAME -# $VERSION -# $UPDATE = [yes/no] -# -ACTION="$1" -TARGET="$2" -PKGNAME="$3" -VERSION="$4" -UPDATE="$5" - -immodules_bin=usr/bin/gtk-query-immodules-2.0 -immodules_db=etc/gtk-2.0/gtk.immodules - -case "$ACTION" in -targets) - echo "post-install post-remove" - ;; -run) - if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gtk+" ]; then - [ -f ${immodules_db} ] rm -f ${immodules_db} - break - fi - case "$TARGET" in - post-*) - if [ -x ${immodules_bin} ]; then - echo "Updating GTK's immodules database..." - ${immodules_bin} > ${immodules_db} - fi - ;; - esac - ;; -*) - exit 1 - ;; -esac - -exit 0 diff --git a/xbps-src/triggers/gtk-pixbuf-loaders b/xbps-src/triggers/gtk-pixbuf-loaders deleted file mode 100755 index 7c2327a415..0000000000 --- a/xbps-src/triggers/gtk-pixbuf-loaders +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -e -# -# Updates's GDK Pixbuf loaders cache with gdk-pixbuf-query-loaders(1). -# -# Arguments: $ACTION = [run/targets] -# $TARGET = [post-install/post-remove] -# $PKGNAME -# $VERSION -# $UPDATE = [yes/no] -# -ACTION="$1" -TARGET="$2" -PKGNAME="$3" -VERSION="$4" -UPDATE="$5" - -pixbuf_bin=usr/bin/gdk-pixbuf-query-loaders - -case "$ACTION" in -targets) - echo "post-install post-remove" - ;; -run) - if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gdk-pixbuf" ]; then - _cache_file=$(${pixbuf_bin} --print-cache-file) - [ -f .${_cache_file} ] && rm -f .${_cache_file} - break - fi - case "$TARGET" in - post-*) - if [ -f etc/gtk-2.0/gdk-pixbuf.loaders ]; then - echo " Removing obsolete conf file: etc/gtk-2.0/gdk-pixbuf.loaders" - rm -f etc/gtk-2.0/gdk-pixbuf.loaders - fi - if [ -x ${pixbuf_bin} ]; then - echo "Updating GDK Pixbuf loaders cache..." - ${pixbuf_bin} --update-cache - fi - ;; - esac - ;; -*) - exit 1 - ;; -esac - -exit 0 diff --git a/xbps-src/triggers/info-files b/xbps-src/triggers/info-files deleted file mode 100755 index 2a792cb357..0000000000 --- a/xbps-src/triggers/info-files +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -e -# -# Registers or unregisters info files for a package. -# -# Arguments: $ACTION = [run/targets] -# $TARGET = [post-install/pre-remove] -# $PKGNAME -# $VERSION -# $UPDATE = [yes/no] -# -ACTION="$1" -TARGET="$2" -PKGNAME="$3" -VERSION="$4" -UPDATE="$5" - -installinfo=usr/bin/install-info -infodir=usr/share/info - -case "$ACTION" in -targets) - echo "post-install pre-remove" - ;; -run) - [ ! -x "$installinfo" ] && exit 0 - - if [ -z "$info_files" ]; then - echo "Trigger info-files: empty info_files." - exit 1 - fi - - for f in ${info_files}; do - [ "$f" = "/usr/share/info/dir" ] && continue - - case "$TARGET" in - post-install) - echo -n "Registering info file: $f... " - ;; - pre-remove) - echo -n "Unregistering info file: $f... " - infoargs="--delete" - ;; - esac - - $installinfo $infoargs ./$f $infodir/dir 2>/dev/null - if [ $? -eq 0 ]; then - echo "done." - else - echo "failed!" - fi - done - ;; -*) - exit 1 - ;; -esac - -exit 0 diff --git a/xbps-src/triggers/initramfs-tools b/xbps-src/triggers/initramfs-tools deleted file mode 100755 index 7359ee87a7..0000000000 --- a/xbps-src/triggers/initramfs-tools +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/sh -e -# -# Runs update-initramfs(8) to create/update an initramfs for specified -# version (if the pkg that is triggering it) or for the currently -# installed kernel otherwise. -# -# Arguments: $ACTION = [run/targets] -# $TARGET = [post-install/post-remove] -# $PKGNAME -# $VERSION -# $UPDATE = [yes/no] -# -ACTION="$1" -TARGET="$2" -PKGNAME="$3" -VERSION="$4" -UPDATE="$5" - -update_initramfs=usr/sbin/update-initramfs - -case "$ACTION" in -targets) - echo "post-install post-remove" - ;; -run) - [ ! -x ${update_initramfs} ] && exit 0 - - if [ "$PKGNAME" = "kernel" ]; then - if [ "$TARGET" = "post-remove" ]; then - exit 0 - fi - if [ ! -f var/lib/initramfs-tools/${VERSION} ]; then - # Create new initramfs - initramfs_args="-B -c -t -k ${VERSION}" - else - # Update existing initramfs - initramfs_args="-B -u -t -k ${VERSION}" - fi - else - # Update initramfs for all kernels - initramfs_args="-B -u -t -k all" - fi - - if [ ! -e /proc/filesystems ]; then - mount -t proc proc /proc - proc_mounted=1 - fi - - if [ ! -e /sys/kernel/vmcoreinfo ]; then - mount -t sysfs sysfs /sys - sys_mounted=1 - fi - - ${update_initramfs} ${initramfs_args} - - if [ -x usr/sbin/grub-mkconfig ]; then - usr/sbin/grub-mkconfig -o boot/grub/grub.cfg - fi - - if [ -n "$proc_mounted" ]; then - umount /proc - fi - if [ -n "$sys_mounted" ]; then - umount /sys - fi - ;; -*) - exit 1 - ;; -esac - -exit 0 diff --git a/xbps-src/triggers/mimedb b/xbps-src/triggers/mimedb deleted file mode 100755 index a76ca71b9b..0000000000 --- a/xbps-src/triggers/mimedb +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -e -# -# Updates the shared-mime-info db file with update-mime-database(1). -# -# Arguments: $ACTION = [run/targets] -# $TARGET = [post-install/post-remove] -# $PKGNAME -# $VERSION -# $UPDATE = [yes/no] -# -ACTION="$1" -TARGET="$2" -PKGNAME="$3" -VERSION="$4" -UPDATE="$5" - -mimedb_bin=usr/bin/update-mime-database - -case "$ACTION" in -targets) - echo "post-install post-remove" - ;; -run) - case "$TARGET" in - post-*) - if [ -x ${mimedb_bin} ]; then - echo "Updating shared-mime-info database..." - ${mimedb_bin} usr/share/mime > /dev/null - fi - ;; - esac - ;; -*) - exit 1 - ;; -esac - -exit 0 diff --git a/xbps-src/triggers/openrc-service b/xbps-src/triggers/openrc-service deleted file mode 100755 index e7aabe007c..0000000000 --- a/xbps-src/triggers/openrc-service +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/sh -# -# Registers or unregisters OpenRC services into the specified -# runlevel. This works by specifying three arguments as follows: -# -# service_name runlevel register -# -------------------------------------------------- -# dbus default boolean -# -------------------------------------------------- -# -# Arguments: $ACTION = [run/targets] -# $TARGET = [post-install/pre-remove] -# $PKGNAME -# $VERSION -# $UPDATE = [yes/no] -# -ACTION="$1" -TARGET="$2" -PKGNAME="$3" -VERSION="$4" -UPDATE="$5" - -initdir=etc/init.d -metadatadir=var/db/xbps/metadata/${PKGNAME} - -case "$ACTION" in -targets) - echo "post-install pre-remove" - ;; -run) - [ ! -x sbin/rc-update ] && exit 0 - [ ! -x sbin/rc-service ] && exit 0 - [ -z "$openrc_services" ] && exit 1 - - if [ "$TARGET" = "pre-remove" ]; then - rcupdate_args="del" - elif [ "$TARGET" = "post-install" ]; then - rcupdate_args="add" - else - exit 1 - fi - - [ ! -f etc/fstab ] && touch etc/fstab - - set -- ${openrc_services} - while [ $# -gt 0 ]; do - unset skip_service - srv_restart=$metadatadir/.$1_srv_restart - if [ "$TARGET" = "post-install" ]; then - # The service shouldn't be registered, so just show a message - # explaining how to add it in the future. - case "$3" in - [Ff][Aa][Ll][Ss][Ee]|[Oo][Ff]|0) - skip_service=1 - ;; - [Tt][Rr][Uu][Ee]|[Oo][Nn]|1) - unset skip_service - ;; - esac - if [ -n "$skip_service" ]; then - cat <<_EOF -================================================================ - -The system service '${1}' won't be added into the runlevel -'${2}' by default, so it will remain disabled at boot. - -To start it at boot time, use the following command: - - $ rc-update add ${1} ${2} - -To disable it again use: - - $ rc-update del ${1} ${2} - -================================================================ -_EOF - shift; shift; shift; - continue - else - echo "Registering '${1}' service to start at boot." - fi - if [ -f $srv_restart ]; then - # Restart service if it was running previously. - $initdir/$1 start - rm -f $srv_restart - else - # Register service. - if sbin/rc-service -e ${1}; then - sbin/rc-update add ${1} ${2} - fi - fi - else - # While removing always stop the service if running. - $initdir/$1 -q status - if [ $? -eq 0 ]; then - $initdir/$1 stop - fi - # - # While upgrading a package, don't remove the service. - # - if [ "$UPDATE" = "yes" ]; then - touch -f $srv_restart - else - # Unregister the service. - sbin/rc-update del ${1} ${2} - fi - fi - unset srv_restart - shift; shift; shift; - done - ;; -*) - exit 1 - ;; -esac - -exit 0 diff --git a/xbps-src/triggers/pango-modules b/xbps-src/triggers/pango-modules deleted file mode 100755 index ab21be33b1..0000000000 --- a/xbps-src/triggers/pango-modules +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh -e -# -# Updates the list of pango modules with pango-querymodules(1). -# -# Arguments: $ACTION = [run/targets] -# $TARGET = [post-install/post-remove] -# $PKGNAME -# $VERSION -# $UPDATE = [yes/no] -# -ACTION="$1" -TARGET="$2" -PKGNAME="$3" -VERSION="$4" -UPDATE="$5" - -pango_bin=usr/bin/pango-querymodules -pango_modules=etc/pango/pango.modules - -case "$ACTION" in -targets) - echo "post-install post-remove" - ;; -run) - if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "pango" ]; then - if [ -f ${pango_modules} ]; then - echo "Removing pango modules file..." - rm -f ${pango_modules} - fi - break - fi - case "$TARGET" in - post-*) - if [ -x ${pango_bin} ]; then - echo "Updating pango modules file..." - ${pango_bin} > ${pango_modules} - fi - ;; - esac - ;; -*) - exit 1 - ;; -esac - -exit 0 diff --git a/xbps-src/triggers/register-shell b/xbps-src/triggers/register-shell deleted file mode 100755 index e2cacfab77..0000000000 --- a/xbps-src/triggers/register-shell +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh -e -# -# Registers or unregisters a shell in /etc/shells. -# -# Arguments: $ACTION = [run/targets] -# $TARGET = [post-install/post-remove] -# $PKGNAME -# $VERSION -# $UPDATE = [yes/no] -# -ACTION="$1" -TARGET="$2" -PKGNAME="$3" -VERSION="$4" -UPDATE="$5" - -case "$ACTION" in -targets) - echo "post-install post-remove" - ;; -run) - [ "$TARGET" != "post-install" -a "$TARGET" != "post-remove" ] && exit 1 - - if [ -z "$register_shell" ]; then - echo "Trigger register-shell: empty \$register_shell!" - exit 1 - fi - - case "$TARGET" in - post-install) - if [ ! -f etc/shells ]; then - for f in ${register_shell}; do - echo $f >> etc/shells - echo "Registered $f into /etc/shells." - done - chmod 644 etc/shells - else - for f in ${register_shell}; do - if ! grep -q $f etc/shells; then - echo $f >> etc/shells - echo -n "Registered $f into " - echo "/etc/shells." - fi - done - fi - ;; - post-remove) - if [ -f etc/shells ]; then - for f in ${register_shell}; do - if grep -q $f etc/shells; then - shell=$(echo $f|sed "s|\\/|\\\/|g") - sed -i -e "/$shell/d" etc/shells - echo -n "Unregistered $f from " - echo "/etc/shells." - fi - done - fi - ;; - esac - ;; -*) - exit 1 - ;; -esac - -exit 0 diff --git a/xbps-src/triggers/system-accounts b/xbps-src/triggers/system-accounts deleted file mode 100755 index ec2d21da30..0000000000 --- a/xbps-src/triggers/system-accounts +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/sh -e -# -# (Un)registers systems accounts (users/groups). -# -# Arguments: $ACTION = [run/targets] -# $TARGET = [post-install/pre-remove] -# $PKGNAME -# $VERSION -# $UPDATE = [yes/no] -# -ACTION="$1" -TARGET="$2" -PKGNAME="$3" -VERSION="$4" -UPDATE="$5" - -useradd_cmd=usr/sbin/useradd -userdel_cmd=usr/sbin/userdel -groupadd_cmd=usr/sbin/groupadd -passwd_cmd=usr/bin/passwd -getent_cmd=usr/bin/getent - -case "$ACTION" in -targets) - echo "post-install pre-remove" - ;; -run) - if [ ! -x $useradd_cmd -a ! -x $groupadd_cmd -a ! -x $passwd_cmd \ - -a ! -x $getent_cmd ]; then - exit 0 - fi - - if [ -z "$system_accounts" ]; then - exit 0 - fi - - case "$TARGET" in - post-install) - for acct in ${system_accounts}; do - eval homedir="\$${acct}_homedir" - eval shell="\$${acct}_shell" - eval descr="\$${acct}_descr" - eval groups="\$${acct}_groups" - [ -z "$homedir" ] && homedir="/" - [ -z "$shell" ] && shell="/sbin/nologin" - [ -z "$descr" ] && descr="$acct unpriviledged user" - [ -n "$groups" ] && groups="-G $groups" - - if ! $getent_cmd group ${acct} >/dev/null; then - $groupadd_cmd -r ${acct} \ - 2>&1 >/dev/null || exit $? - echo "Created ${acct} system group." - fi - if ! $getent_cmd passwd ${acct} >/dev/null; then - $useradd_cmd -c "$descr" -d "$homedir" \ - -s "$shell" -g ${acct} $groups \ - -r ${acct} && \ - $passwd_cmd -l ${acct} \ - 2>&1 >/dev/null || exit $? - echo "Created ${acct} system user." - fi - done - ;; - pre-remove) - # - # Only unregister if we aren't updating a package. - # - if [ "$UPDATE" = "no" ]; then - for acct in ${system_accounts}; do - $userdel_cmd ${acct} 2>&1 >/dev/null - if [ $? -eq 0 ]; then - echo "Removed ${acct} system user/group." - fi - done - fi - ;; - esac - ;; -*) - exit 1 - ;; -esac - -exit 0 diff --git a/xbps-src/triggers/update-desktopdb b/xbps-src/triggers/update-desktopdb deleted file mode 100755 index ea14b9d01b..0000000000 --- a/xbps-src/triggers/update-desktopdb +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -e -# -# Updates the MIME database that connects with applications, through -# the update-desktop-database(1) utility. -# -# Arguments: $ACTION = [run/targets] -# $TARGET = [post-install/post-remove] -# $PKGNAME -# $VERSION -# $UPDATE = [yes/no] -# -ACTION="$1" -TARGET="$2" -PKGNAME="$3" -VERSION="$4" -UPDATE="$5" - -desktopdb_bin=usr/bin/update-desktop-database -desktopdb_dir=usr/share/applications -desktopdb_cache=${desktopdb_dir}/mimeinfo.cache - -case "$ACTION" in -targets) - echo "post-install post-remove" - ;; -run) - if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "desktop-file-utils" ]; then - [ -f ${desktopdb_cache} ] && rm -f ${desktopdb_cache} - break - fi - case "$TARGET" in - post-*) - if [ -x ${desktopdb_bin} ]; then - echo "Updating MIME database..." - ${desktopdb_bin} ${desktopdb_dir} - fi - ;; - esac - ;; -*) - exit 1 - ;; -esac - -exit 0 diff --git a/xbps-src/triggers/x11-fonts b/xbps-src/triggers/x11-fonts deleted file mode 100755 index 5219631f9e..0000000000 --- a/xbps-src/triggers/x11-fonts +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh -e -# -# This trigger rebuilds the fonts.dir and fonts.scale files -# for packages that install X11 fonts, and update fontconfig's -# cache for those fonts. -# -# Arguments: $ACTION = [run/targets] -# $TARGET = [post-install/pre-remove] -# $PKGNAME -# $VERSION -# $UPDATE = [yes/no] -# -ACTION="$1" -TARGET="$2" -PKGNAME="$3" -VERSION="$4" -UPDATE="$5" - -mkfontdir=usr/bin/mkfontdir -mkfontscale=usr/bin/mkfontscale -fccache=usr/bin/fc-cache - -case "$ACTION" in -targets) - echo "post-install pre-remove" - ;; -run) - if [ ! -x ${mkfontdir} -a ! -x ${mkfontscale} ]; then - exit 0 - fi - - [ -z "${font_dirs}" ] && exit 0 - - case "$TARGET" in - post-install) - for dir in ${font_dirs}; do - echo "Building ${dir}/fonts.dir..." - ${mkfontdir} .${dir} || exit $? - echo "Building ${dir}/fonts.scale..." - ${mkfontscale} .${dir} || exit $? - echo "Updating fontconfig's cache..." - ${fccache} .${dir} 2>/dev/null - done - ;; - pre-remove) - for dir in ${font_dirs}; do - if [ -f .${dir}/fonts.dir ]; then - rm -f .${dir}/fonts.dir - fi - if [ -f .${dir}/fonts.scale ]; then - rm -f .${dir}/fonts.scale - fi - if [ -f .${dir}/encodings.dir ]; then - rm -f .${dir}/encodings.dir - fi - done - ;; - esac - - ;; -*) - exit 1 - ;; -esac - -exit 0 diff --git a/xbps-src/triggers/xml-catalog b/xbps-src/triggers/xml-catalog deleted file mode 100755 index 3a12359f84..0000000000 --- a/xbps-src/triggers/xml-catalog +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/sh -e -# -# Registers or unregisters SGML/XML catalog entries, through -# the xmlcatmgr application. -# -# Arguments: $ACTION = [run/targets] -# $TARGET = [post-install/pre-remove] -# $PKGNAME -# $VERSION -# $UPDATE = [yes/no] -# -ACTION="$1" -TARGET="$2" -PKGNAME="$3" -VERSION="$4" -UPDATE="$5" - -sgml_catalog=usr/share/sgml/catalog -xml_catalog=usr/share/xml/catalog - -register_entries() -{ - if [ -n "${sgml_entries}" ]; then - echo -n "Registering SGML catalog entries... " - set -- ${sgml_entries} - while [ $# -gt 0 ]; do - xmlcatmgr -sc ${sgml_catalog} add "$1" "$2" "$3" - shift; shift; shift; - done - echo "done." - fi - - if [ -n "${xml_entries}" ]; then - echo -n "Registering XML catalog entries... " - set -- ${xml_entries} - while [ $# -gt 0 ]; do - xmlcatmgr -c ${xml_catalog} add "$1" "$2" "$3" - shift; shift; shift; - done - echo "done." - fi -} - -unregister_entries() -{ - if [ -n "${sgml_entries}" ]; then - echo -n "Unregistering SGML catalog entries... " - set -- ${sgml_entries} - while [ $# -gt 0 ]; do - xmlcatmgr -sc ${sgml_catalog} remove "$1" "$2" \ - 2>/dev/null - shift; shift; shift - done - echo "done." - fi - if [ -n "${xml_entries}" ]; then - echo -n "Unregistering XML catalog entries... " - set -- ${xml_entries} - while [ $# -gt 0 ]; do - xmlcatmgr -c ${xml_catalog} remove "$1" "$2" \ - 2>/dev/null - shift; shift; shift - done - echo "done." - fi -} - -case "$ACTION" in -targets) - echo "post-install pre-remove" - ;; -run) - [ ! -x $xmlcatmgr ] && exit 0 - [ -n "${sgml_entries}" -a ! -f "${sgml_catalog}" ] && exit 0 - [ -n "${xml_entries}" -a ! -f "${xml_catalog}" ] && exit 0 - - case "$TARGET" in - post-install) - register_entries - ;; - pre-remove) - unregister_entries - ;; - *) - exit 1 - ;; - esac - ;; -*) - exit 1 - ;; -esac - -exit 0