summaryrefslogtreecommitdiff
path: root/autoscripts
diff options
context:
space:
mode:
Diffstat (limited to 'autoscripts')
-rw-r--r--autoscripts/postinst-doc-base2
-rw-r--r--autoscripts/postinst-emacsen5
-rw-r--r--autoscripts/postinst-info4
-rw-r--r--autoscripts/postinst-info-nosection4
-rw-r--r--autoscripts/postinst-init10
-rw-r--r--autoscripts/postinst-init-norestart6
-rw-r--r--autoscripts/postinst-init-nostart3
-rw-r--r--autoscripts/postinst-makeshlibs3
-rw-r--r--autoscripts/postinst-menu2
-rw-r--r--autoscripts/postinst-mime2
-rw-r--r--autoscripts/postinst-modules5
-rw-r--r--autoscripts/postinst-python8
-rw-r--r--autoscripts/postinst-scrollkeeper3
-rw-r--r--autoscripts/postinst-sgmlcatalog7
-rw-r--r--autoscripts/postinst-suid12
-rw-r--r--autoscripts/postinst-usrlocal16
-rw-r--r--autoscripts/postinst-wm5
-rw-r--r--autoscripts/postinst-xaw6
-rw-r--r--autoscripts/postinst-xfonts3
-rw-r--r--autoscripts/postrm-debconf4
-rw-r--r--autoscripts/postrm-init3
-rw-r--r--autoscripts/postrm-makeshlibs3
-rw-r--r--autoscripts/postrm-menu1
-rw-r--r--autoscripts/postrm-menu-method4
-rw-r--r--autoscripts/postrm-mime1
-rw-r--r--autoscripts/postrm-modules3
-rw-r--r--autoscripts/postrm-scrollkeeper3
-rw-r--r--autoscripts/postrm-sgmlcatalog3
-rw-r--r--autoscripts/postrm-suid3
-rw-r--r--autoscripts/postrm-wm4
-rw-r--r--autoscripts/postrm-xaw3
-rw-r--r--autoscripts/postrm-xfonts3
-rw-r--r--autoscripts/prerm-doc-base3
-rw-r--r--autoscripts/prerm-emacsen4
-rw-r--r--autoscripts/prerm-init8
-rw-r--r--autoscripts/prerm-init-norestart7
-rw-r--r--autoscripts/prerm-python5
-rw-r--r--autoscripts/prerm-sgmlcatalog3
-rw-r--r--autoscripts/prerm-usrlocal7
-rw-r--r--autoscripts/prerm-wm3
-rw-r--r--autoscripts/prerm-xaw4
41 files changed, 139 insertions, 49 deletions
diff --git a/autoscripts/postinst-doc-base b/autoscripts/postinst-doc-base
index c3653bed..39265721 100644
--- a/autoscripts/postinst-doc-base
+++ b/autoscripts/postinst-doc-base
@@ -1,3 +1,3 @@
-if command -v install-docs >/dev/null 2>&1; then
+if [ "$1" = configure ] && which install-docs >/dev/null 2>&1; then
install-docs -i /usr/share/doc-base/#DOC-ID#
fi
diff --git a/autoscripts/postinst-emacsen b/autoscripts/postinst-emacsen
index 45f1deec..f80e1dbd 100644
--- a/autoscripts/postinst-emacsen
+++ b/autoscripts/postinst-emacsen
@@ -1 +1,4 @@
-/usr/lib/emacsen-common/emacs-package-install #PACKAGE#
+if [ "$1" = "configure" ] && [ -x /usr/lib/emacsen-common/emacs-package-install ]
+then
+ /usr/lib/emacsen-common/emacs-package-install #PACKAGE#
+fi
diff --git a/autoscripts/postinst-info b/autoscripts/postinst-info
index 59881a19..71ffa19b 100644
--- a/autoscripts/postinst-info
+++ b/autoscripts/postinst-info
@@ -1 +1,3 @@
-install-info --quiet --section "#SECTION#" "#SECTION#" #FILE#
+if [ "$1" = "configure" ]; then
+ install-info --quiet --section "#SECTION#" "#SECTION#" #FILE#
+fi
diff --git a/autoscripts/postinst-info-nosection b/autoscripts/postinst-info-nosection
index cba27d27..ffef8636 100644
--- a/autoscripts/postinst-info-nosection
+++ b/autoscripts/postinst-info-nosection
@@ -1 +1,3 @@
-install-info --quiet #FILE#
+if [ "$1" = "configure" ]; then
+ install-info --quiet #FILE#
+fi
diff --git a/autoscripts/postinst-init b/autoscripts/postinst-init
index 976c6b34..b5bd7a57 100644
--- a/autoscripts/postinst-init
+++ b/autoscripts/postinst-init
@@ -1,2 +1,8 @@
-update-rc.d #SCRIPT# #INITPARMS# >/dev/null
-/etc/init.d/#SCRIPT# start
+if [ -x "/etc/init.d/#SCRIPT#" ]; then
+ update-rc.d #SCRIPT# #INITPARMS# >/dev/null
+ if [ -x /usr/sbin/invoke-rc.d ]; then
+ invoke-rc.d #SCRIPT# start
+ else
+ /etc/init.d/#SCRIPT# start
+ fi
+fi
diff --git a/autoscripts/postinst-init-norestart b/autoscripts/postinst-init-norestart
deleted file mode 100644
index b33702c5..00000000
--- a/autoscripts/postinst-init-norestart
+++ /dev/null
@@ -1,6 +0,0 @@
-update-rc.d #SCRIPT# #INITPARMS# >/dev/null
-if [ "$1" = "configure" ]; then
- if [ -z "$2" -o "$2" = "<unknown>" ]; then
- /etc/init.d/#SCRIPT# start
- fi
-fi
diff --git a/autoscripts/postinst-init-nostart b/autoscripts/postinst-init-nostart
new file mode 100644
index 00000000..5d882b6f
--- /dev/null
+++ b/autoscripts/postinst-init-nostart
@@ -0,0 +1,3 @@
+if [ -x "/etc/init.d/#SCRIPT#" ]; then
+ update-rc.d #SCRIPT# #INITPARMS# >/dev/null
+fi
diff --git a/autoscripts/postinst-makeshlibs b/autoscripts/postinst-makeshlibs
new file mode 100644
index 00000000..8a25b9e9
--- /dev/null
+++ b/autoscripts/postinst-makeshlibs
@@ -0,0 +1,3 @@
+if [ "$1" = "configure" ]; then
+ ldconfig
+fi
diff --git a/autoscripts/postinst-menu b/autoscripts/postinst-menu
index 2be88247..276a3c0a 100644
--- a/autoscripts/postinst-menu
+++ b/autoscripts/postinst-menu
@@ -1 +1 @@
-if test -x /usr/bin/update-menus ; then update-menus ; fi
+if [ "$1" = "configure" ] && [ -x /usr/bin/update-menus ]; then update-menus ; fi
diff --git a/autoscripts/postinst-mime b/autoscripts/postinst-mime
index e993233b..bef63cc9 100644
--- a/autoscripts/postinst-mime
+++ b/autoscripts/postinst-mime
@@ -1 +1 @@
-if [ -x /usr/sbin/update-mime ]; then update-mime; fi
+if [ "$1" = "configure" ] && [ -x /usr/sbin/update-mime ]; then update-mime; fi
diff --git a/autoscripts/postinst-modules b/autoscripts/postinst-modules
index a8f4ce70..babf39bd 100644
--- a/autoscripts/postinst-modules
+++ b/autoscripts/postinst-modules
@@ -1,2 +1,3 @@
-update-modules
-depmod -a
+if [ "$1" = "configure" ] && [ -x /sbin/update-modules ]; then
+ update-modules >/dev/null
+fi
diff --git a/autoscripts/postinst-python b/autoscripts/postinst-python
new file mode 100644
index 00000000..6f1f9a5b
--- /dev/null
+++ b/autoscripts/postinst-python
@@ -0,0 +1,8 @@
+PYTHON=#PYVER#
+if which $PYTHON >/dev/null 2>&1; then
+ DIRLIST="#DIRLIST#"
+ for i in $DIRLIST ; do
+ $PYTHON -O /usr/lib/$PYTHON/compileall.py -q $i
+ $PYTHON /usr/lib/$PYTHON/compileall.py -q $i
+ done
+fi
diff --git a/autoscripts/postinst-scrollkeeper b/autoscripts/postinst-scrollkeeper
new file mode 100644
index 00000000..5f2a255d
--- /dev/null
+++ b/autoscripts/postinst-scrollkeeper
@@ -0,0 +1,3 @@
+if [ "$1" = "configure" ]; then
+ scrollkeeper-update -q
+fi
diff --git a/autoscripts/postinst-sgmlcatalog b/autoscripts/postinst-sgmlcatalog
new file mode 100644
index 00000000..100dee2f
--- /dev/null
+++ b/autoscripts/postinst-sgmlcatalog
@@ -0,0 +1,7 @@
+if [ "$1" = "configure" ]; then
+ rm -f #CENTRALCAT#
+ for ordcat in #ORDCATS#; do
+ update-catalog --quiet --add #CENTRALCAT# ${ordcat}
+ done
+ update-catalog --quiet --add --super #CENTRALCAT#
+fi
diff --git a/autoscripts/postinst-suid b/autoscripts/postinst-suid
index dcc277fd..d0d16c06 100644
--- a/autoscripts/postinst-suid
+++ b/autoscripts/postinst-suid
@@ -1,6 +1,8 @@
-if command -v suidregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then
- suidregister -s #PACKAGE# /#FILE# #OWNER# #GROUP# #PERMS#
-elif [ -e /#FILE# ]; then
- chown #OWNER#.#GROUP# /#FILE#
- chmod #PERMS# /#FILE#
+if [ "$1" = "configure" ]; then
+ if which suidregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then
+ suidregister -s #PACKAGE# /#FILE# #OWNER# #GROUP# #PERMS#
+ elif [ -e /#FILE# ]; then
+ chown #OWNER#.#GROUP# /#FILE#
+ chmod #PERMS# /#FILE#
+ fi
fi
diff --git a/autoscripts/postinst-usrlocal b/autoscripts/postinst-usrlocal
new file mode 100644
index 00000000..a2f004db
--- /dev/null
+++ b/autoscripts/postinst-usrlocal
@@ -0,0 +1,16 @@
+if [ "$1" = configure ]; then
+(
+ while read line; do
+ set -- $line
+ dir="$1"; mode="$2"; user="$3"; group="$4"
+ if [ ! -e "$dir" ]; then
+ if mkdir "$dir" 2>/dev/null; then
+ chown "$user":"$group" "$dir"
+ chmod "$mode" "$dir"
+ fi
+ fi
+ done
+) << DATA
+#DIRS#
+DATA
+fi
diff --git a/autoscripts/postinst-wm b/autoscripts/postinst-wm
index 925c7883..aef412a3 100644
--- a/autoscripts/postinst-wm
+++ b/autoscripts/postinst-wm
@@ -1,3 +1,4 @@
-if command -v register-window-manager >/dev/null 2>&1; then
- register-window-manager --add #WM#
+if [ "$1" = "configure" ]; then
+ update-alternatives --install /usr/bin/x-window-manager \
+ x-window-manager #WM# #PRIORITY#
fi
diff --git a/autoscripts/postinst-xaw b/autoscripts/postinst-xaw
deleted file mode 100644
index 3d8e2d1b..00000000
--- a/autoscripts/postinst-xaw
+++ /dev/null
@@ -1,6 +0,0 @@
-if test -x /usr/sbin/update-xaw-wrappers; then
- /usr/sbin/update-xaw-wrappers
-fi
-for opts in #OPTS#; do
- update-alternatives --quiet --install $opts 25
-done
diff --git a/autoscripts/postinst-xfonts b/autoscripts/postinst-xfonts
new file mode 100644
index 00000000..96390e4e
--- /dev/null
+++ b/autoscripts/postinst-xfonts
@@ -0,0 +1,3 @@
+if which update-fonts-dir >/dev/null 2>&1; then
+ #CMDS#
+fi
diff --git a/autoscripts/postrm-debconf b/autoscripts/postrm-debconf
new file mode 100644
index 00000000..5a61724d
--- /dev/null
+++ b/autoscripts/postrm-debconf
@@ -0,0 +1,4 @@
+if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
+ . /usr/share/debconf/confmodule
+ db_purge
+fi
diff --git a/autoscripts/postrm-init b/autoscripts/postrm-init
deleted file mode 100644
index 1c292982..00000000
--- a/autoscripts/postrm-init
+++ /dev/null
@@ -1,3 +0,0 @@
-if [ "$1" = "purge" ] ; then
- update-rc.d #SCRIPT# remove >/dev/null
-fi
diff --git a/autoscripts/postrm-makeshlibs b/autoscripts/postrm-makeshlibs
new file mode 100644
index 00000000..96bf24ed
--- /dev/null
+++ b/autoscripts/postrm-makeshlibs
@@ -0,0 +1,3 @@
+if [ "$1" = "remove" ]; then
+ ldconfig
+fi
diff --git a/autoscripts/postrm-menu b/autoscripts/postrm-menu
new file mode 100644
index 00000000..a180558d
--- /dev/null
+++ b/autoscripts/postrm-menu
@@ -0,0 +1 @@
+if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi
diff --git a/autoscripts/postrm-menu-method b/autoscripts/postrm-menu-method
index 3270b7c7..ffa1e486 100644
--- a/autoscripts/postrm-menu-method
+++ b/autoscripts/postrm-menu-method
@@ -1,3 +1,3 @@
inst=/etc/menu-methods/#PACKAGE#
-if [ "$1" = "remove" -a -f "$inst" ]; then chmod a-x $inst ; fi
-if test -x /usr/bin/update-menus ; then update-menus; fi
+if [ "$1" = "remove" ] && [ -f "$inst" ]; then chmod a-x $inst ; fi
+if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi
diff --git a/autoscripts/postrm-mime b/autoscripts/postrm-mime
new file mode 100644
index 00000000..a9404112
--- /dev/null
+++ b/autoscripts/postrm-mime
@@ -0,0 +1 @@
+if which update-mime >/dev/null 2>&1; then update-mime; fi
diff --git a/autoscripts/postrm-modules b/autoscripts/postrm-modules
new file mode 100644
index 00000000..f2d4cb7a
--- /dev/null
+++ b/autoscripts/postrm-modules
@@ -0,0 +1,3 @@
+if [ -x /sbin/update-modules ]; then
+ update-modules >/dev/null
+fi
diff --git a/autoscripts/postrm-scrollkeeper b/autoscripts/postrm-scrollkeeper
new file mode 100644
index 00000000..47b71544
--- /dev/null
+++ b/autoscripts/postrm-scrollkeeper
@@ -0,0 +1,3 @@
+if [ "$1" = "remove" ] && which scrollkeeper-update >/dev/null 2>&1; then
+ scrollkeeper-update -q
+fi
diff --git a/autoscripts/postrm-sgmlcatalog b/autoscripts/postrm-sgmlcatalog
new file mode 100644
index 00000000..168a6949
--- /dev/null
+++ b/autoscripts/postrm-sgmlcatalog
@@ -0,0 +1,3 @@
+if [ "$1" = "purge" ]; then
+ rm -f #CENTRALCAT# #CENTRALCAT#.old
+fi
diff --git a/autoscripts/postrm-suid b/autoscripts/postrm-suid
index d4a76199..a4cfecf9 100644
--- a/autoscripts/postrm-suid
+++ b/autoscripts/postrm-suid
@@ -1,3 +1,4 @@
-if command -v suidunregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; then
+if [ "$1" = remove ] && [ -e /etc/suid.conf ] && \
+ which suidunregister >/dev/null 2>&1; then
suidunregister -s #PACKAGE# /#FILE#
fi
diff --git a/autoscripts/postrm-wm b/autoscripts/postrm-wm
deleted file mode 100644
index 6a7eb47a..00000000
--- a/autoscripts/postrm-wm
+++ /dev/null
@@ -1,4 +0,0 @@
-if [ "$1" = "purge" ] && command -v register-window-manager >/dev/null 2>&1
-then
- register-window-manager --remove #WM#
-fi
diff --git a/autoscripts/postrm-xaw b/autoscripts/postrm-xaw
deleted file mode 100644
index b8d718ea..00000000
--- a/autoscripts/postrm-xaw
+++ /dev/null
@@ -1,3 +0,0 @@
-if test -x /usr/sbin/update-xaw-wrappers; then
- /usr/sbin/update-xaw-wrappers
-fi
diff --git a/autoscripts/postrm-xfonts b/autoscripts/postrm-xfonts
new file mode 100644
index 00000000..a4d0a082
--- /dev/null
+++ b/autoscripts/postrm-xfonts
@@ -0,0 +1,3 @@
+if [ "$1" != "upgrade" ] && [ -x /usr/sbin/update-fonts-dir ]; then
+#CMDS#
+fi
diff --git a/autoscripts/prerm-doc-base b/autoscripts/prerm-doc-base
index 9678003e..c57d999a 100644
--- a/autoscripts/prerm-doc-base
+++ b/autoscripts/prerm-doc-base
@@ -1,3 +1,4 @@
-if command -v install-docs >/dev/null 2>&1; then
+if [ "$1" = remove ] || [ "$1" = upgrade ] && \
+ which install-docs >/dev/null 2>&1; then
install-docs -r #DOC-ID#
fi
diff --git a/autoscripts/prerm-emacsen b/autoscripts/prerm-emacsen
index d11dafab..8c3ca64c 100644
--- a/autoscripts/prerm-emacsen
+++ b/autoscripts/prerm-emacsen
@@ -1 +1,3 @@
-/usr/lib/emacsen-common/emacs-package-remove #PACKAGE#
+if [ -x /usr/lib/emacsen-common/emacs-package-remove ] ; then
+ /usr/lib/emacsen-common/emacs-package-remove #PACKAGE#
+fi
diff --git a/autoscripts/prerm-init b/autoscripts/prerm-init
index 64975a38..eab98c72 100644
--- a/autoscripts/prerm-init
+++ b/autoscripts/prerm-init
@@ -1 +1,7 @@
-/etc/init.d/#SCRIPT# stop
+if [ -x "/etc/init.d/#SCRIPT#" ]; then
+ if [ -x /usr/sbin/invoke-rc.d ] ; then
+ invoke-rc.d #SCRIPT# stop
+ else
+ /etc/init.d/#SCRIPT# stop
+ fi
+fi
diff --git a/autoscripts/prerm-init-norestart b/autoscripts/prerm-init-norestart
new file mode 100644
index 00000000..fb991524
--- /dev/null
+++ b/autoscripts/prerm-init-norestart
@@ -0,0 +1,7 @@
+if [ -x "/etc/init.d/#SCRIPT#" ] && [ "$1" = remove ]; then
+ if [ -x /usr/sbin/invoke-rc.d ] ; then
+ invoke-rc.d #SCRIPT# stop
+ else
+ /etc/init.d/#SCRIPT# stop
+ fi
+fi
diff --git a/autoscripts/prerm-python b/autoscripts/prerm-python
new file mode 100644
index 00000000..0dc12731
--- /dev/null
+++ b/autoscripts/prerm-python
@@ -0,0 +1,5 @@
+if [ "$1" = remove ]; then
+ dpkg -L #PACKAGE# |
+ awk '$0~/\.py$/ {print $0"c\n" $0"o"}' |
+ xargs rm -f >&2
+fi
diff --git a/autoscripts/prerm-sgmlcatalog b/autoscripts/prerm-sgmlcatalog
new file mode 100644
index 00000000..cdc96e02
--- /dev/null
+++ b/autoscripts/prerm-sgmlcatalog
@@ -0,0 +1,3 @@
+if [ "$1" = "remove" ]; then
+ update-catalog --quiet --remove --super #CENTRALCAT#
+fi
diff --git a/autoscripts/prerm-usrlocal b/autoscripts/prerm-usrlocal
new file mode 100644
index 00000000..baafc23e
--- /dev/null
+++ b/autoscripts/prerm-usrlocal
@@ -0,0 +1,7 @@
+(
+ while read dir; do
+ rmdir "$dir" 2>/dev/null || true
+ done
+) << DATA
+#JUSTDIRS#
+DATA
diff --git a/autoscripts/prerm-wm b/autoscripts/prerm-wm
new file mode 100644
index 00000000..b97d627f
--- /dev/null
+++ b/autoscripts/prerm-wm
@@ -0,0 +1,3 @@
+if [ "$1" = "remove" ]; then
+ update-alternatives --remove x-window-manager #WM#
+fi
diff --git a/autoscripts/prerm-xaw b/autoscripts/prerm-xaw
deleted file mode 100644
index 2507a2f5..00000000
--- a/autoscripts/prerm-xaw
+++ /dev/null
@@ -1,4 +0,0 @@
-for opts in #OPTS#; do
- update-alternatives --quiet --remove $opts
-done
-