From 4106beebd28b7fe73dd19e43cf15378c08b8241f Mon Sep 17 00:00:00 2001 From: joey Date: Sun, 26 May 2002 05:06:51 +0000 Subject: r528: * Consistently use the which command instead of command -v or hardcoded paths in autoscripts. Neither is in posix, but which is in debianutils, so will always be available. command -v is not available in zsh. Closes: #148172 --- autoscripts/postinst-doc-base | 2 +- autoscripts/postinst-suid | 2 +- autoscripts/postinst-xaw | 4 ++-- autoscripts/postinst-xfonts | 2 +- autoscripts/postrm-menu | 2 +- autoscripts/postrm-menu-method | 2 +- autoscripts/postrm-mime | 2 +- autoscripts/postrm-suid | 2 +- autoscripts/postrm-xaw | 4 ++-- autoscripts/prerm-doc-base | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) (limited to 'autoscripts') diff --git a/autoscripts/postinst-doc-base b/autoscripts/postinst-doc-base index fce4d17e..39265721 100644 --- a/autoscripts/postinst-doc-base +++ b/autoscripts/postinst-doc-base @@ -1,3 +1,3 @@ -if [ "$1" = configure ] && 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-suid b/autoscripts/postinst-suid index 820d69a4..d0d16c06 100644 --- a/autoscripts/postinst-suid +++ b/autoscripts/postinst-suid @@ -1,5 +1,5 @@ if [ "$1" = "configure" ]; then - if command -v suidregister >/dev/null 2>&1 && [ -e /etc/suid.conf ]; 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# diff --git a/autoscripts/postinst-xaw b/autoscripts/postinst-xaw index 035aa269..f7703dcf 100644 --- a/autoscripts/postinst-xaw +++ b/autoscripts/postinst-xaw @@ -1,6 +1,6 @@ if [ "$1" = "configure" ]; then - if [ -x /usr/sbin/update-xaw-wrappers ]; then - /usr/sbin/update-xaw-wrappers + if which update-xaw-wrappers >/dev/null 2>&1; then + update-xaw-wrappers fi for opts in #OPTS#; do update-alternatives --quiet --install $opts 25 diff --git a/autoscripts/postinst-xfonts b/autoscripts/postinst-xfonts index 4c5ab1b8..96390e4e 100644 --- a/autoscripts/postinst-xfonts +++ b/autoscripts/postinst-xfonts @@ -1,3 +1,3 @@ -if [ -x /usr/sbin/update-fonts-dir ]; then +if which update-fonts-dir >/dev/null 2>&1; then #CMDS# fi diff --git a/autoscripts/postrm-menu b/autoscripts/postrm-menu index a34b6f18..a180558d 100644 --- a/autoscripts/postrm-menu +++ b/autoscripts/postrm-menu @@ -1 +1 @@ -if [ -x /usr/bin/update-menus ]; then update-menus ; fi +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 2e0faed7..0d573fd0 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 [ -x /usr/bin/update-menus ]; then update-menus; fi +if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi diff --git a/autoscripts/postrm-mime b/autoscripts/postrm-mime index e993233b..a9404112 100644 --- a/autoscripts/postrm-mime +++ b/autoscripts/postrm-mime @@ -1 +1 @@ -if [ -x /usr/sbin/update-mime ]; then update-mime; fi +if which update-mime >/dev/null 2>&1; then update-mime; fi diff --git a/autoscripts/postrm-suid b/autoscripts/postrm-suid index 340736af..46fee33e 100644 --- a/autoscripts/postrm-suid +++ b/autoscripts/postrm-suid @@ -1,4 +1,4 @@ if [ "$1" = remove -a -e /etc/suid.conf ] && \ - command -v suidunregister >/dev/null 2>&1; then + which suidunregister >/dev/null 2>&1; then suidunregister -s #PACKAGE# /#FILE# fi diff --git a/autoscripts/postrm-xaw b/autoscripts/postrm-xaw index 14d13ebb..61bd3c9f 100644 --- a/autoscripts/postrm-xaw +++ b/autoscripts/postrm-xaw @@ -1,3 +1,3 @@ -if [ -x /usr/sbin/update-xaw-wrappers ]; then - /usr/sbin/update-xaw-wrappers +if which update-xaw-wrappers >/dev/null 2>&1; then + update-xaw-wrappers fi diff --git a/autoscripts/prerm-doc-base b/autoscripts/prerm-doc-base index d2b07ebc..7ec95b7c 100644 --- a/autoscripts/prerm-doc-base +++ b/autoscripts/prerm-doc-base @@ -1,4 +1,4 @@ if [ "$1" = remove -o "$1" = upgrade ] && \ - command -v install-docs >/dev/null 2>&1; then + which install-docs >/dev/null 2>&1; then install-docs -r #DOC-ID# fi -- cgit v1.2.3