Received: (at submit) by bugs.debian.org; 20 Sep 1999 20:15:31 +0000 Received: (qmail 673 invoked from network); 20 Sep 1999 20:15:30 -0000 Received: from ns.ukai.nakahara.kawasaki.jp (HELO earlgrey.ukai.org) (210.239.121.106) by master.debian.org with SMTP; 20 Sep 1999 20:15:30 -0000 Received: from lavender.ukai.org (lavender.ukai.nakahara.kawasaki.jp [210.239.121.107]) by earlgrey.ukai.org (Postfix) with ESMTP id 8D62F8EE4 for ; Tue, 21 Sep 1999 05:13:08 +0900 (JST) Date: Tue, 21 Sep 1999 05:14:43 +0900 Message-ID: <14310.38323.128487.8570I@lavender> From: Fumitoshi UKAI To: submit@bugs.debian.org Subject: debhelper: dh_alternatives scripts? User-Agent: Wanderlust/2.2.1 (Wild World) SEMI/1.13.6 (Komatsu) FLIM/1.13.2 (Kasanui) Emacs/20.3 (i386-debian-linux-gnu) MULE/4.0 (HANANOEN) Organization: Debian JP Project MIME-Version: 1.0 (generated by SEMI 1.13.6 - "Komatsu") Content-Type: text/plain; charset=US-ASCII Sender: ukai@lavender.ukai.org Package: debhelper Version: 2.0.50 Severity: wishlist It might be nice to have a dh_alternatives scripts to automatically write any wanted update-alternatives commands for the postinst/prerm scripts by debian/alternatives or debian/.alternatives, like follows: (I don't have good idea about debian/alternatives format...) #!/usr/bin/perl -w BEGIN { push @INC, "debian", "/usr/share/debhelper" } use Dh_Lib; init(); foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $TMP=tmpdir($PACKAGE); $alternatives=pkgfile($PACKAGE,"alternatives"); if ($alternatives ne '') { if (! $dh{NOSCRIPTS}) { open(IN, "<$alternatives") || die "$alternatives: $!"; while () { # read alternatives file # and check it autoscript($PACKAGE,"postinst", "postinst-alternatives", "s:#ALTINSTALLARGS#:$altinstargs:"); autoscript($PACKAGE,"postrm", "postrm-alternatives", "s:#ALTRMARGS#:$altrmargs:") } } } } /usr/lib/debhelper/autoscripts/postinst-alternatives: if [ "$1" = "configure" ]; then update-alternatives #ALTINSTALLARGS# fi /usr/lib/debhelper/autoscripts/prerm-alternatives: if [ "$1" != "upgrade" ]; then update-alternatives #ALTRMARGS# fi Regards, Fumitoshi UKAI