From f375c254bef045414797dfb9bd55c6ddc7391659 Mon Sep 17 00:00:00 2001 From: joey Date: Thu, 6 Jul 2000 00:18:18 +0000 Subject: r353: * Modified all postinst script fragments to only run when called with "configure". I looked at the other possibilities, and I don't think any of the supported stuff should be called if the postist is called for error unwinds. Closes: #66673 * Implemented dh_clean -X, to allow specification of files to not delete, Closes: #66670 --- autoscripts/postinst-emacsen | 3 ++- autoscripts/postinst-info | 4 +++- autoscripts/postinst-info-nosection | 4 +++- autoscripts/postinst-menu | 2 +- autoscripts/postinst-mime | 2 +- autoscripts/postinst-modules | 6 ++++-- autoscripts/postinst-suid | 12 +++++++----- autoscripts/postinst-wm | 6 ++++-- autoscripts/postinst-xaw | 9 +++++++-- autoscripts/postinst-xfonts | 16 +++++++++------- autoscripts/postrm-menu | 1 + autoscripts/postrm-mime | 1 + autoscripts/postrm-modules | 2 ++ debian/changelog | 11 +++++++++++ dh_clean | 10 +++++++++- dh_clean.1 | 7 ++++++- 16 files changed, 71 insertions(+), 25 deletions(-) create mode 100644 autoscripts/postrm-menu create mode 100644 autoscripts/postrm-mime create mode 100644 autoscripts/postrm-modules diff --git a/autoscripts/postinst-emacsen b/autoscripts/postinst-emacsen index 48bf26e7..97004eb7 100644 --- a/autoscripts/postinst-emacsen +++ b/autoscripts/postinst-emacsen @@ -1,3 +1,4 @@ -if [ -x /usr/lib/emacsen-common/emacs-package-install ]; then +if [ "$1" = "configure" -a -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-menu b/autoscripts/postinst-menu index a73a1692..8a46311f 100644 --- a/autoscripts/postinst-menu +++ b/autoscripts/postinst-menu @@ -1 +1 @@ -if [ -x /usr/bin/update-menus ] ; then update-menus ; fi +if [ "$1" = "configure" -a -x /usr/bin/update-menus ]; then update-menus ; fi diff --git a/autoscripts/postinst-mime b/autoscripts/postinst-mime index e993233b..a28e5bd7 100644 --- a/autoscripts/postinst-mime +++ b/autoscripts/postinst-mime @@ -1 +1 @@ -if [ -x /usr/sbin/update-mime ]; then update-mime; fi +if [ "$1" = "configure" -a -x /usr/sbin/update-mime ]; then update-mime; fi diff --git a/autoscripts/postinst-modules b/autoscripts/postinst-modules index a8f4ce70..64b8eb0c 100644 --- a/autoscripts/postinst-modules +++ b/autoscripts/postinst-modules @@ -1,2 +1,4 @@ -update-modules -depmod -a +if [ "$1" = "configure" ]; then + update-modules + depmod -a +fi diff --git a/autoscripts/postinst-suid b/autoscripts/postinst-suid index 1294d313..820d69a4 100644 --- a/autoscripts/postinst-suid +++ b/autoscripts/postinst-suid @@ -1,6 +1,8 @@ -if [ -e /etc/suid.conf -a -x /usr/sbin/suidregister ]; then - suidregister -s #PACKAGE# /#FILE# #OWNER# #GROUP# #PERMS# -else - chown #OWNER#.#GROUP# /#FILE# - chmod #PERMS# /#FILE# +if [ "$1" = "configure" ]; then + 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# + fi fi diff --git a/autoscripts/postinst-wm b/autoscripts/postinst-wm index 794ad700..aef412a3 100644 --- a/autoscripts/postinst-wm +++ b/autoscripts/postinst-wm @@ -1,2 +1,4 @@ -update-alternatives --install /usr/bin/x-window-manager \ - x-window-manager #WM# #PRIORITY# +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 index b8d718ea..324058f8 100644 --- a/autoscripts/postinst-xaw +++ b/autoscripts/postinst-xaw @@ -1,3 +1,8 @@ -if test -x /usr/sbin/update-xaw-wrappers; then - /usr/sbin/update-xaw-wrappers +if [ "$1" = "configure" ]; then + 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 fi diff --git a/autoscripts/postinst-xfonts b/autoscripts/postinst-xfonts index a0b58c9d..ae999633 100644 --- a/autoscripts/postinst-xfonts +++ b/autoscripts/postinst-xfonts @@ -1,8 +1,10 @@ -fontdirs="#FONTDIRS#" -updatecmds="#UPDATECMDS#" - -for dir in $fontdirs; do - for currentcmd in $updatecmds; do - $currentcmd /usr/lib/X11/fonts/$dir +if [ "$1" = "configure" ]; then + fontdirs="#FONTDIRS#" + updatecmds="#UPDATECMDS#" + + for dir in $fontdirs; do + for currentcmd in $updatecmds; do + $currentcmd /usr/lib/X11/fonts/$dir + done done -done +fi diff --git a/autoscripts/postrm-menu b/autoscripts/postrm-menu new file mode 100644 index 00000000..a34b6f18 --- /dev/null +++ b/autoscripts/postrm-menu @@ -0,0 +1 @@ +if [ -x /usr/bin/update-menus ]; then update-menus ; fi diff --git a/autoscripts/postrm-mime b/autoscripts/postrm-mime new file mode 100644 index 00000000..e993233b --- /dev/null +++ b/autoscripts/postrm-mime @@ -0,0 +1 @@ +if [ -x /usr/sbin/update-mime ]; then update-mime; fi diff --git a/autoscripts/postrm-modules b/autoscripts/postrm-modules new file mode 100644 index 00000000..a8f4ce70 --- /dev/null +++ b/autoscripts/postrm-modules @@ -0,0 +1,2 @@ +update-modules +depmod -a diff --git a/debian/changelog b/debian/changelog index 369431ea..4a806d05 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +debhelper (2.0.100) unstable; urgency=low + + * Modified all postinst script fragments to only run when called with + "configure". I looked at the other possibilities, and I don't think any + of the supported stuff should be called if the postist is called for + error unwinds. Closes: #66673 + * Implemented dh_clean -X, to allow specification of files to not delete, + Closes: #66670 + + -- Joey Hess Wed, 5 Jul 2000 17:02:40 -0700 + debhelper (2.0.99) unstable; urgency=low * dh_installmodules will now install modiles even if etc/modutils already diff --git a/dh_clean b/dh_clean index 1ca10125..4b98a6a0 100755 --- a/dh_clean +++ b/dh_clean @@ -30,6 +30,14 @@ if (! $dh{D_FLAG}) { doit("rm","-f","debian/files"); } + # See if some files that would normally be deleted are excluded. + if (! defined($dh{EXCLUDE_FIND}) || $dh{EXCLUDE_FIND} eq '') { + $find_options=""; + } + else { + $find_options="-a ! ( $dh{EXCLUDE_FIND} )"; + } + # Remove other temp files. # (The \s+ is important, \s won't work because find would get null # parameters). Note that you _don't_ quote wildcards used by find @@ -39,7 +47,7 @@ if (! $dh{D_FLAG}) { -o -name *.orig -o -name *.rej -o -name *.bak -o -name .*.orig -o -name .*.rej -o -name .SUMS -o -name TAGS -o -name core -o ( -path */.deps/* -a -name *.P ) - ) -exec rm -f {} ;")); + ) $find_options -exec rm -f {} ;")); } doit('rm', '-rf', 'debian/tmp') diff --git a/dh_clean.1 b/dh_clean.1 index 729ba054..118a03c2 100644 --- a/dh_clean.1 +++ b/dh_clean.1 @@ -3,7 +3,7 @@ dh_clean \- clean up package build directories .SH SYNOPSIS .B dh_clean -.I "[debhelper options] [-k] [-d] [file ...]" +.I "[debhelper options] [-k] [-d] [file ...] [-Xitem]" .SH "DESCRIPTION" dh_clean is a debhelper program that is responsible for cleaning up after a package is built. It removes the package build directories, and removes some @@ -29,6 +29,11 @@ was built. Only clean the package build directories, do not clean up any other files at all. .TP +.B \-Xitem, \--exclude=item +Exclude files that contain "item" anywhere in their filename from being +deleted, even if they would normally be deleted. You may use this option +multiple times to build up a list of things to exclude. +.TP .B file ... Delete these files too. .SH ENVIRONMENT -- cgit v1.2.3