From 982e8935d2259eacf196e2b8d3364d0286e953ca Mon Sep 17 00:00:00 2001 From: joey Date: Wed, 5 Jan 2005 00:09:57 +0000 Subject: [PATCH] r1737: releasing version 4.2.30 --- autoscripts/postinst-init | 2 +- autoscripts/postinst-menu | 4 +++- autoscripts/postinst-menu-method | 2 +- autoscripts/postinst-mime | 4 +++- autoscripts/postinst-sharedmimeinfo | 3 +++ autoscripts/postrm-sharedmimeinfo | 3 +++ autoscripts/postrm-xfonts | 2 +- autoscripts/prerm-init | 2 +- autoscripts/prerm-init-norestart | 2 +- debian/changelog | 10 +++++++++ dh_installmime | 35 ++++++++++++++++++++++------- 11 files changed, 54 insertions(+), 15 deletions(-) create mode 100644 autoscripts/postinst-sharedmimeinfo create mode 100644 autoscripts/postrm-sharedmimeinfo diff --git a/autoscripts/postinst-init b/autoscripts/postinst-init index 8128cd9..6a1c572 100644 --- a/autoscripts/postinst-init +++ b/autoscripts/postinst-init @@ -1,6 +1,6 @@ if [ -x "/etc/init.d/#SCRIPT#" ]; then update-rc.d #SCRIPT# #INITPARMS# >/dev/null - if [ -x /usr/sbin/invoke-rc.d ]; then + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then invoke-rc.d #SCRIPT# start || #ERROR_HANDLER# else /etc/init.d/#SCRIPT# start || #ERROR_HANDLER# diff --git a/autoscripts/postinst-menu b/autoscripts/postinst-menu index 276a3c0..b56a346 100644 --- a/autoscripts/postinst-menu +++ b/autoscripts/postinst-menu @@ -1 +1,3 @@ -if [ "$1" = "configure" ] && [ -x /usr/bin/update-menus ]; then update-menus ; fi +if [ "$1" = "configure" ] && [ -x "`which update-menus 2>/dev/null`" ]; then + update-menus +fi diff --git a/autoscripts/postinst-menu-method b/autoscripts/postinst-menu-method index d3ef636..c56d625 100644 --- a/autoscripts/postinst-menu-method +++ b/autoscripts/postinst-menu-method @@ -1,7 +1,7 @@ inst=/etc/menu-methods/#PACKAGE# if [ -f $inst ]; then chmod a+x $inst - if [ -x /usr/bin/update-menus ]; then + if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus fi fi diff --git a/autoscripts/postinst-mime b/autoscripts/postinst-mime index bef63cc..3749fc9 100644 --- a/autoscripts/postinst-mime +++ b/autoscripts/postinst-mime @@ -1 +1,3 @@ -if [ "$1" = "configure" ] && [ -x /usr/sbin/update-mime ]; then update-mime; fi +if [ "$1" = "configure" ] && [ -x "`which update-mime 2>/dev/null`" ]; then + update-mime +fi diff --git a/autoscripts/postinst-sharedmimeinfo b/autoscripts/postinst-sharedmimeinfo new file mode 100644 index 0000000..aa6333f --- /dev/null +++ b/autoscripts/postinst-sharedmimeinfo @@ -0,0 +1,3 @@ +if [ "$1" = "configure" ] && [ -x "`which update-mime-database 2>/dev/null`" ]; then + update-mime-database /usr/share/mime +fi diff --git a/autoscripts/postrm-sharedmimeinfo b/autoscripts/postrm-sharedmimeinfo new file mode 100644 index 0000000..917fd49 --- /dev/null +++ b/autoscripts/postrm-sharedmimeinfo @@ -0,0 +1,3 @@ +if [ -x "`which update-mime-database 2>/dev/null`" ]; then + update-mime-database /usr/share/mime +fi diff --git a/autoscripts/postrm-xfonts b/autoscripts/postrm-xfonts index a4d0a08..42fea68 100644 --- a/autoscripts/postrm-xfonts +++ b/autoscripts/postrm-xfonts @@ -1,3 +1,3 @@ -if [ "$1" != "upgrade" ] && [ -x /usr/sbin/update-fonts-dir ]; then +if [ "$1" != "upgrade" ] && [ -x "`which update-fonts-dir 2>/dev/null`" ]; then #CMDS# fi diff --git a/autoscripts/prerm-init b/autoscripts/prerm-init index 014fa9a..96d3755 100644 --- a/autoscripts/prerm-init +++ b/autoscripts/prerm-init @@ -1,5 +1,5 @@ if [ -x "/etc/init.d/#SCRIPT#" ]; then - if [ -x /usr/sbin/invoke-rc.d ] ; then + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then invoke-rc.d #SCRIPT# stop || #ERROR_HANDLER# else /etc/init.d/#SCRIPT# stop || #ERROR_HANDLER# diff --git a/autoscripts/prerm-init-norestart b/autoscripts/prerm-init-norestart index 0f64c45..9b63174 100644 --- a/autoscripts/prerm-init-norestart +++ b/autoscripts/prerm-init-norestart @@ -1,5 +1,5 @@ if [ -x "/etc/init.d/#SCRIPT#" ] && [ "$1" = remove ]; then - if [ -x /usr/sbin/invoke-rc.d ] ; then + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then invoke-rc.d #SCRIPT# stop || #ERROR_HANDLER# else /etc/init.d/#SCRIPT# stop || #ERROR_HANDLER# diff --git a/debian/changelog b/debian/changelog index d2c66a5..ead31f7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +debhelper (4.2.30) unstable; urgency=low + + * dh_installmime: Patch from Loïc Minier to add support for instlaling + "sharedmimeinfo" files and calling update-mime-database. Closes: #255719 + * Modified patch to not hardcode pathnames. + * Modified other autoscripts so there are no hardcoded pathnames at all + any more. + + -- Joey Hess Tue, 4 Jan 2005 18:44:11 -0500 + debhelper (4.2.29) unstable; urgency=low * dh_installdocs Spanish manpage update diff --git a/dh_installmime b/dh_installmime index 8ffd523..42f2f82 100755 --- a/dh_installmime +++ b/dh_installmime @@ -19,11 +19,13 @@ dh_installmime is a debhelper program that is responsible for installing mime files into package build directories. It also automatically generates the postinst and postrm commands needed to -interface with the debian mime-support package. See L for -an explanation of how this works. +interface with the debian mime-support and shared-mime-info packages. See +L for an explanation of how this works. -If a file named debian/package.mime exists, then it is installed into -usr/lib/mime/packages/package in the package build directory. +If files named debian/package.mime or debian/package.sharedmimeinfo exist, then +they are installed into usr/lib/mime/packages/package and +/usr/share/mime/packages/package.xml (respectively) in the package build +directory. =head1 OPTIONS @@ -54,11 +56,28 @@ foreach my $package (@{$dh{DOPACKAGES}}) { doit("install","-d","$tmp/usr/lib/mime/packages"); } doit("install","-p","-m644",$mime,"$tmp/usr/lib/mime/packages/$package"); - - if (! $dh{NOSCRIPTS}) { - autoscript($package,"postinst","postinst-mime"); - autoscript($package,"postrm","postrm-mime") + } + # Check wether we have to call update-mime (either upstream already + # installs a MIME information file or Debian provides one) + if ((! $dh{NOSCRIPTS}) && (-d "$tmp/usr/lib/mime/packages")) { + autoscript($package,"postinst","postinst-mime"); + autoscript($package,"postrm","postrm-mime") + } + + my $sharedmimeinfo=pkgfile($package,"sharedmimeinfo"); + + if ($sharedmimeinfo ne '') { + if (! -d "$tmp/usr/share/mime/packages") { + doit("install", "-d", "$tmp/usr/share/mime/packages"); } + doit("install", "-p", "-m644", $sharedmimeinfo, "$tmp/usr/share/mime/packages/$package.xml"); + } + # check wether we have to call update-mime-database (either upstream + # already installs a shared MIME information file or Debian provides + # one) + if ((! $dh{NOSCRIPTS}) && (-d "$tmp/usr/share/mime/packages")) { + autoscript($package, "postinst", "postinst-sharedmimeinfo"); + autoscript($package, "postrm", "postrm-sharedmimeinfo") } } -- 2.39.2