Report forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@master.debian.org>:
Bug#45614; Package debhelper.   debian-bugs-dist@lists.debian.orgJoey Hess  Subject: Bug#45614: debhelper: dh_alternatives scripts? Reply-To: Fumitoshi UKAI , 45614@bugs.debian.org Resent-From: Fumitoshi UKAI Orignal-Sender: ukai@lavender.ukai.org Resent-To: debian-bugs-dist@lists.debian.org Resent-CC: Joey Hess Resent-Date: Mon, 20 Sep 1999 20:18:00 GMT Resent-Message-ID: Resent-Sender: owner@bugs.debian.org X-Debian-PR-Message: report 45614 X-Debian-PR-Package: debhelper X-Debian-PR-Keywords: X-Loop: owner@bugs.debian.org Received: via spool by bugs@bugs.debian.org id=B.937858531711 (code B ref -1); Mon, 20 Sep 1999 20:18:00 GMT Date: Tue, 21 Sep 1999 05:14:43 +0900 Message-ID: <14310.38323.128487.8570I@lavender> From: Fumitoshi UKAI To: submit@bugs.debian.org 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   Acknowledgement sent to Fumitoshi UKAI <ukai@debian.or.jp>:
New Bug report received and forwarded. Copy sent to Joey Hess <joeyh@master.debian.org>.   -t  From: owner@bugs.debian.org (Debian Bug Tracking System) To: Fumitoshi UKAI Subject: Bug#45614: Acknowledgement (debhelper: dh_alternatives scripts?) Message-ID: In-Reply-To: <14310.38323.128487.8570I@lavender> References: <14310.38323.128487.8570I@lavender> X-Debian-PR-Message: ack 45614 Thank you for the problem report you have sent regarding Debian. This is an automatically generated reply, to let you know your message has been received. It is being forwarded to the developers mailing list for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): Joey Hess If you wish to submit further information on your problem, please send it to 45614@bugs.debian.org (and *not* to bugs@bugs.debian.org). Please do not reply to the address at the top of this message, unless you wish to report a problem with the Bug-tracking system. Darren Benham (administrator, Debian Bugs database)   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   Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@master.debian.org>:
Bug#45614; Package debhelper.   debian-bugs-dist@lists.debian.orgJoey Hess  Subject: Bug#45614: New dh_ script for alternatives Reply-To: Joey Hess , 45614@bugs.debian.org Resent-From: Joey Hess Resent-To: debian-bugs-dist@lists.debian.org Resent-CC: Joey Hess Resent-Date: Wed, 17 Nov 1999 23:33:06 GMT Resent-Message-ID: Resent-Sender: owner@bugs.debian.org X-Debian-PR-Message: report 45614 X-Debian-PR-Package: debhelper X-Debian-PR-Keywords: X-Loop: owner@bugs.debian.org Received: via spool by 45614-bugs@bugs.debian.org id=B45614.94288120710718 (code B ref 45614); Wed, 17 Nov 1999 23:33:06 GMT Date: Wed, 17 Nov 1999 15:26:43 -0800 From: Joey Hess To: Brian Bassett Cc: debhelper@packages.debian.org, 45614@bugs.debian.org Message-ID: <19991117152643.N8480@kitenet.net> References: <3830F2F2.5778CC26@bbassett.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i In-Reply-To: <3830F2F2.5778CC26@bbassett.net>; from bbassett@bbassett.net on Tue, Nov 16, 1999 at 06:00:18AM +0000 Brian Bassett wrote: > I've done a bit of work on automating maintainer scripts that use > alternatives. I have come up with a new dh_ script, > dh_installalternatives. It uses a debian/alternatives (for the first > package) file which contains the information about priorities, link, and > destination information for the primary link and slave links. For > example, for a package foo that installs two alternatives, one of which > has a slave link, dh_installalternatives would use the following > debian/alternatives file: > > 100 > /usr/bin/foo > /usr/bin/foo-foo > /usr/share/man/man1/foo.1.gz > /usr/share/man/man1/foo-foo.1.gz > 100 > /usr/bin/bar > /usr/bin/bar-foo This is the main reason I've never come up with such a script. I dislike this config file format, but I can't come up with a better one. I think this format is too obscure to be useful. Raw update-alternatives commands in a postinst are more understandable. > It generates the following maintainer script snippets: > > postinst: > > # Automatically added by dh_installalternatives > if [ "$1" = "configure" ]; then > if update-alternatives --display /usr/bin/foo | grep 'status is > manual' > /dev/null; then > echo "You have manually overriden the alternatives > mechanism for /usr/bin/foo" > echo -e "Please run\n\n\tupdate-alternatives --auto > /usr/bin/foo\n\nas root to reset /usr/bin/foo to its default." > fi > update-alternatives --install /usr/bin/foo foo /usr/bin/foo-foo > 100 --slave /usr/share/man/man1/foo.1.gz foo.1.gz > /usr/share/man/man1/foo-foo.1.gz Debhelper postinst additions scripts cannot echo anything to the user without pausing, because that is a villation of policy. I really don't want anything debhelper adds to maintainer scripts to output anything at all except error messages. I think the messages update-alternatives outputs when something in on manual are good enough. > Would you be interested in including this in debhelper? Yes, if we can come up with a better config file format. -- see shy jo   Acknowledgement sent to Joey Hess <joeyh@debian.org>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@master.debian.org>.   -t  From: owner@bugs.debian.org (Debian Bug Tracking System) To: Joey Hess Subject: Bug#45614: Info received (was New dh_ script for alternatives) Message-ID: In-Reply-To: <19991117152643.N8480@kitenet.net> References: <19991117152643.N8480@kitenet.net> X-Debian-PR-Message: ack-info-maintonly 45614 Thank you for the additional information you have supplied regarding this problem report. It has been forwarded to the developer(s) and to the developers mailing list to accompany the original report. Your message has been sent to the package maintainer(s): Joey Hess If you wish to continue to submit further information on your problem, please send it to 45614@bugs.debian.org, as before. Please do not reply to the address at the top of this message, unless you wish to report a problem with the Bug-tracking system. Darren Benham (administrator, Debian Bugs database)   Received: (at 45614) by bugs.debian.org; 17 Nov 1999 23:26:46 +0000 Received: (qmail 10688 invoked from network); 17 Nov 1999 23:26:44 -0000 Received: from adsl-63-193-116-241.dsl.snfc21.pacbell.net (HELO kitenet.net) (qmailr@63.193.116.241) by master.debian.org with SMTP; 17 Nov 1999 23:26:44 -0000 Received: (qmail 19340 invoked by uid 500); 17 Nov 1999 23:26:43 -0000 Date: Wed, 17 Nov 1999 15:26:43 -0800 From: Joey Hess To: Brian Bassett Cc: debhelper@packages.debian.org, 45614@bugs.debian.org Subject: Re: New dh_ script for alternatives Message-ID: <19991117152643.N8480@kitenet.net> References: <3830F2F2.5778CC26@bbassett.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0i In-Reply-To: <3830F2F2.5778CC26@bbassett.net>; from bbassett@bbassett.net on Tue, Nov 16, 1999 at 06:00:18AM +0000 Brian Bassett wrote: > I've done a bit of work on automating maintainer scripts that use > alternatives. I have come up with a new dh_ script, > dh_installalternatives. It uses a debian/alternatives (for the first > package) file which contains the information about priorities, link, and > destination information for the primary link and slave links. For > example, for a package foo that installs two alternatives, one of which > has a slave link, dh_installalternatives would use the following > debian/alternatives file: > > 100 > /usr/bin/foo > /usr/bin/foo-foo > /usr/share/man/man1/foo.1.gz > /usr/share/man/man1/foo-foo.1.gz > 100 > /usr/bin/bar > /usr/bin/bar-foo This is the main reason I've never come up with such a script. I dislike this config file format, but I can't come up with a better one. I think this format is too obscure to be useful. Raw update-alternatives commands in a postinst are more understandable. > It generates the following maintainer script snippets: > > postinst: > > # Automatically added by dh_installalternatives > if [ "$1" = "configure" ]; then > if update-alternatives --display /usr/bin/foo | grep 'status is > manual' > /dev/null; then > echo "You have manually overriden the alternatives > mechanism for /usr/bin/foo" > echo -e "Please run\n\n\tupdate-alternatives --auto > /usr/bin/foo\n\nas root to reset /usr/bin/foo to its default." > fi > update-alternatives --install /usr/bin/foo foo /usr/bin/foo-foo > 100 --slave /usr/share/man/man1/foo.1.gz foo.1.gz > /usr/share/man/man1/foo-foo.1.gz Debhelper postinst additions scripts cannot echo anything to the user without pausing, because that is a villation of policy. I really don't want anything debhelper adds to maintainer scripts to output anything at all except error messages. I think the messages update-alternatives outputs when something in on manual are good enough. > Would you be interested in including this in debhelper? Yes, if we can come up with a better config file format. -- see shy jo   Merged 43720 45614. Request was from Joey Hess <joeyh@debian.org> to control@bugs.debian.org.   Received: (at control) by bugs.debian.org; 6 Jan 2002 04:16:29 +0000 From joey@silk.kitenet.net Sat Jan 05 22:16:29 2002 Return-path: Received: from as5800-83-159.access.naxs.com (silk.kitenet.net) [216.98.83.159] by master.debian.org with esmtp (Exim 3.12 1 (Debian)) id 16N4jT-0001bB-00; Sat, 05 Jan 2002 22:16:27 -0600 Received: from joey by silk.kitenet.net with local (Exim 3.33 #1 (Debian)) id 16N4jP-00074I-00 for ; Sat, 05 Jan 2002 23:16:23 -0500 From: Joey Hess To: control@bugs.debian.org Subject: merging 45614 43720 Date: Sat, 5 Jan 2002 23:16:13 -0500 Message-Id: Sender: Joey Hess Delivered-To: control@bugs.debian.org merge 45614 43720   Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#45614; Package debhelper.   debian-bugs-dist@lists.debian.orgJoey Hess  X-Loop: owner@bugs.debian.org Subject: Bug#45614: debhelper: dh_alternatives scripts? Reply-To: Danilo Piazzalunga , 45614@bugs.debian.org Resent-From: Danilo Piazzalunga Resent-To: debian-bugs-dist@lists.debian.org Resent-CC: Joey Hess Resent-Date: Wed, 16 Feb 2005 23:03:07 UTC Resent-Message-ID: Resent-Sender: owner@bugs.debian.org X-Debian-PR-Message: report 45614 X-Debian-PR-Package: debhelper X-Debian-PR-Keywords: Received: via spool by 45614-submit@bugs.debian.org id=B45614.110859410516603 (code B ref 45614); Wed, 16 Feb 2005 23:03:07 UTC Received: (at 45614) by bugs.debian.org; 16 Feb 2005 22:48:25 +0000 Received: from smtp20.libero.it [193.70.192.147] by spohr.debian.org with esmtp (Exim 3.35 1 (Debian)) id 1D1Xy5-00043E-00; Wed, 16 Feb 2005 14:48:25 -0800 Received: from localhost (172.16.1.83) by smtp20.libero.it (7.0.027-DD01) id 41D02C9800ABE95A for 45614@bugs.debian.org; Wed, 16 Feb 2005 23:47:54 +0100 Received: from minefield (151.46.49.243) by smtp20.libero.it (7.0.027-DD01) id 41D02BD30319921C for 45614@bugs.debian.org; Wed, 16 Feb 2005 23:47:53 +0100 From: Danilo Piazzalunga To: 45614@bugs.debian.org Date: Wed, 16 Feb 2005 23:47:49 +0100 User-Agent: KMail/1.7.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200502162347.49674.danilopiazza@libero.it> X-Virus-Scanned: by amavisd-new at libero.it serv4 Delivered-To: 45614@bugs.debian.org X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 (1.212-2003-09-23-exp) on spohr.debian.org X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no version=2.60-bugs.debian.org_2005_01_02 X-Spam-Level: Joey Hess wrote: > This is the main reason I've never come up with such a script. I dislike > this config file format, but I can't come up with a better one. > > I think this format is too obscure to be useful. Raw update-alternatives > commands in a postinst are more understandable. [...] > > Would you be interested in including this in debhelper? > > Yes, if we can come up with a better config file format. Sorry for respawning this issue after such a long time... A better config file format could possibly be one which mimics the way update-alternatives is called: it would simplify things only if you consider that bugs caused by update-alternatives --remove commands being out of sync with their --install counterparts. The proposed format is like the following: ... ... Where slave lines (if any) begin with any amount of white space and an empty line separates stanzas (if there are more than one). Using the following format, the config file for e.g. mawk would be: /usr/bin/awk awk /usr/bin/mawk 5 /usr/share/man/man1/awk.1.gz awk.1.gz /usr/share/man/man1/mawk.1.gz /usr/bin/nawk nawk /usr/bin/mawk /usr/share/man/man1/nawk.1.gz nawk.1.gz /usr/share/man/man1/mawk.1.gz And for e.g vim, it would look like: /usr/bin/vi vi /usr/bin/vim 120 /usr/share/man/man1/vi.1.gz vi.1.gz /usr/share/man/man1/vim.1.gz /usr/bin/view view /usr/bin/vim 120 /usr/share/man/man1/view.1.gz view.1.gz /usr/share/man/man1/vim.1.gz /usr/bin/ex ex /usr/bin/vim 120 /usr/share/man/man1/ex.1.gz ex.1.gz /usr/share/man/man1/vim.1.gz /usr/bin/editor editor /usr/bin/vim 120 /usr/share/man/man1/editor.1.gz editor.1.gz /usr/share/man/man1/vim.1.gz (I admit that, in this case, a for loop in the maintainer scripts would be less redundant, but a package maintainer can choose whether to use this facility.) Regards, Danilo -- Danilo Piazzalunga +--------------------+ PGP Key available at subkeys.pgp.net | Linux User #245762 | Fingerprint: D018 815E 8C7F 2AE2 5565 | ICQ #105550412 | 0C36 B5F6 DB20 B800 CB9F +--------------------+   Acknowledgement sent to Danilo Piazzalunga <danilopiazza@libero.it>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>.   -t  X-Loop: owner@bugs.debian.org From: owner@bugs.debian.org (Debian Bug Tracking System) To: Danilo Piazzalunga Subject: Bug#45614: Info received (was debhelper: dh_alternatives scripts?) Message-ID: In-Reply-To: <200502162347.49674.danilopiazza@libero.it> References: <200502162347.49674.danilopiazza@libero.it> Precedence: bulk X-Debian-PR-Message: ack-info 45614 X-Debian-PR-Package: debhelper X-Debian-PR-Keywords: Thank you for the additional information you have supplied regarding this problem report. It has been forwarded to the package maintainer(s) and to other interested parties to accompany the original report. Your message has been sent to the package maintainer(s): Joey Hess If you wish to continue to submit further information on your problem, please send it to 45614@bugs.debian.org, as before. Please do not reply to the address at the top of this message, unless you wish to report a problem with the Bug-tracking system. Debian bug tracking system administrator (administrator, Debian Bugs database)   Received: (at 45614) by bugs.debian.org; 16 Feb 2005 22:48:25 +0000 From danilopiazza@libero.it Wed Feb 16 14:48:25 2005 Return-path: Received: from smtp20.libero.it [193.70.192.147] by spohr.debian.org with esmtp (Exim 3.35 1 (Debian)) id 1D1Xy5-00043E-00; Wed, 16 Feb 2005 14:48:25 -0800 Received: from localhost (172.16.1.83) by smtp20.libero.it (7.0.027-DD01) id 41D02C9800ABE95A for 45614@bugs.debian.org; Wed, 16 Feb 2005 23:47:54 +0100 Received: from minefield (151.46.49.243) by smtp20.libero.it (7.0.027-DD01) id 41D02BD30319921C for 45614@bugs.debian.org; Wed, 16 Feb 2005 23:47:53 +0100 From: Danilo Piazzalunga To: 45614@bugs.debian.org Subject: Re: debhelper: dh_alternatives scripts? Date: Wed, 16 Feb 2005 23:47:49 +0100 User-Agent: KMail/1.7.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200502162347.49674.danilopiazza@libero.it> X-Virus-Scanned: by amavisd-new at libero.it serv4 Delivered-To: 45614@bugs.debian.org X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 (1.212-2003-09-23-exp) on spohr.debian.org X-Spam-Status: No, hits=-3.0 required=4.0 tests=BAYES_00 autolearn=no version=2.60-bugs.debian.org_2005_01_02 X-Spam-Level: Joey Hess wrote: > This is the main reason I've never come up with such a script. I dislike > this config file format, but I can't come up with a better one. > > I think this format is too obscure to be useful. Raw update-alternatives > commands in a postinst are more understandable. [...] > > Would you be interested in including this in debhelper? > > Yes, if we can come up with a better config file format. Sorry for respawning this issue after such a long time... A better config file format could possibly be one which mimics the way update-alternatives is called: it would simplify things only if you consider that bugs caused by update-alternatives --remove commands being out of sync with their --install counterparts. The proposed format is like the following: ... ... Where slave lines (if any) begin with any amount of white space and an empty line separates stanzas (if there are more than one). Using the following format, the config file for e.g. mawk would be: /usr/bin/awk awk /usr/bin/mawk 5 /usr/share/man/man1/awk.1.gz awk.1.gz /usr/share/man/man1/mawk.1.gz /usr/bin/nawk nawk /usr/bin/mawk /usr/share/man/man1/nawk.1.gz nawk.1.gz /usr/share/man/man1/mawk.1.gz And for e.g vim, it would look like: /usr/bin/vi vi /usr/bin/vim 120 /usr/share/man/man1/vi.1.gz vi.1.gz /usr/share/man/man1/vim.1.gz /usr/bin/view view /usr/bin/vim 120 /usr/share/man/man1/view.1.gz view.1.gz /usr/share/man/man1/vim.1.gz /usr/bin/ex ex /usr/bin/vim 120 /usr/share/man/man1/ex.1.gz ex.1.gz /usr/share/man/man1/vim.1.gz /usr/bin/editor editor /usr/bin/vim 120 /usr/share/man/man1/editor.1.gz editor.1.gz /usr/share/man/man1/vim.1.gz (I admit that, in this case, a for loop in the maintainer scripts would be less redundant, but a package maintainer can choose whether to use this facility.) Regards, Danilo -- Danilo Piazzalunga +--------------------+ PGP Key available at subkeys.pgp.net | Linux User #245762 | Fingerprint: D018 815E 8C7F 2AE2 5565 | ICQ #105550412 | 0C36 B5F6 DB20 B800 CB9F +--------------------+