Re: How to obtain current package version number?

2003-03-06 Thread Antti-Juhani Kaijanaho
On 20030306T080640+0100, Marc Haber wrote: Because I don't find that approach very elegant, and it is also error prone. Imagine a local user diverting the file that I use for package version indication. The information which version is installed is already there, in the dpkg database. I only

Re: How to obtain current package version number?

2003-03-06 Thread Antti-Juhani Kaijanaho
On 20030304T141459+0100, Bastian Kleineidam wrote: Does a maintainer script know the package version, so that it can write the version number to a file? # example: current bash version number BASH_VERSION=`grep-available -P -s Version -n -r '^bash$'` Please see the grep-dctrl(1) manual

Re: How to obtain current package version number?

2003-03-06 Thread Marc Haber
On Tue, 4 Mar 2003 17:22:51 -0600, Graham Wilson [EMAIL PROTECTED] wrote: On Tue, Mar 04, 2003 at 05:01:36PM +0100, Marc Haber wrote: Well, I wouldn't have posted without first consulting policy and developer's reference. Section 6.4 doesn't seem to document any maintainer script of the package

Re: How to obtain current package version number?

2003-03-06 Thread Marc Haber
On Tue, 4 Mar 2003 21:30:07 -0500, Matt Zimmerman [EMAIL PROTECTED] wrote: On Tue, Mar 04, 2003 at 01:41:58PM +0100, Marc Haber wrote: Does a maintainer script know the package version, so that it can write the version number to a file? Why is it that you need to know this in a maintainer

Re: How to obtain current package version number?

2003-03-06 Thread Marc Haber
On Wed, 5 Mar 2003 11:25:07 +0100, Jeremie Koenig [EMAIL PROTECTED] wrote: Well, there already have been a lot of suggestions, but why do you need to create the file at install time ? Can't you just generate it in debian/rules, and include it in the package ? Because I don't find that approach

Re: How to obtain current package version number?

2003-03-06 Thread Antti-Juhani Kaijanaho
On 20030306T080640+0100, Marc Haber wrote: Because I don't find that approach very elegant, and it is also error prone. Imagine a local user diverting the file that I use for package version indication. The information which version is installed is already there, in the dpkg database. I only

Re: How to obtain current package version number?

2003-03-05 Thread Antti-Juhani Kaijanaho
On 20030304T141459+0100, Bastian Kleineidam wrote: Does a maintainer script know the package version, so that it can write the version number to a file? # example: current bash version number BASH_VERSION=`grep-available -P -s Version -n -r '^bash$'` Please see the grep-dctrl(1) manual

Re: How to obtain current package version number?

2003-03-05 Thread Marc Haber
On Tue, 4 Mar 2003 21:30:07 -0500, Matt Zimmerman [EMAIL PROTECTED] wrote: On Tue, Mar 04, 2003 at 01:41:58PM +0100, Marc Haber wrote: Does a maintainer script know the package version, so that it can write the version number to a file? Why is it that you need to know this in a maintainer

Re: How to obtain current package version number?

2003-03-05 Thread Marc Haber
On Wed, 5 Mar 2003 11:25:07 +0100, Jeremie Koenig [EMAIL PROTECTED] wrote: Well, there already have been a lot of suggestions, but why do you need to create the file at install time ? Can't you just generate it in debian/rules, and include it in the package ? Because I don't find that approach

Re: How to obtain current package version number?

2003-03-05 Thread Jeremie Koenig
On Tue, Mar 04, 2003 at 01:41:58PM +0100, Marc Haber wrote: Does a maintainer script know the package version, so that it can write the version number to a file? Well, there already have been a lot of suggestions, but why do you need to create the file at install time ? Can't you just generate

How to obtain current package version number?

2003-03-04 Thread Marc Haber
Hi, how can a package learn about its current version number? Parsing /usr/share/doc/$PACKAGE/changelog.gz is out of the question since /usr/share/doc need not be present, and calling dpkg --list $PACKAGE and parsing its output looks like bad overkill. Does a maintainer script know the package

Re: How to obtain current package version number?

2003-03-04 Thread Bastian Kleineidam
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tue, Mar 04, 2003 at 01:41:58PM +0100, Marc Haber wrote: how can a package learn about its current version number? Package information is stored in /var/lib/dpkg/available. There is already a package parsing this information: grep-dctrl You can do

Re: How to obtain current package version number?

2003-03-04 Thread Jérôme Marant
En réponse à Marc Haber [EMAIL PROTECTED]: Hi, Hi, how can a package learn about its current version number? Parsing /usr/share/doc/$PACKAGE/changelog.gz is out of the question since /usr/share/doc need not be present, and calling dpkg --list $PACKAGE and parsing its output looks like

Re: How to obtain current package version number?

2003-03-04 Thread Henrique de Moraes Holschuh
On Tue, 04 Mar 2003, Bastian Kleineidam wrote: On Tue, Mar 04, 2003 at 01:41:58PM +0100, Marc Haber wrote: how can a package learn about its current version number? Package information is stored in /var/lib/dpkg/available. No. Do not skip the proper interface layers. Use dpkg to get that

Re: How to obtain current package version number?

2003-03-04 Thread Roland Mas
Colin Watson (2003-03-04 14:06:07 +) : On Tue, Mar 04, 2003 at 02:14:59PM +0100, Bastian Kleineidam wrote: [...] # example: current bash version number BASH_VERSION=`grep-available -P -s Version -n -r '^bash$'` That will be wrong in the event that somebody has run 'dselect update' but

Re: How to obtain current package version number?

2003-03-04 Thread Marc Haber
On Tue, 4 Mar 2003 07:16:11 -0600, Graham Wilson [EMAIL PROTECTED] wrote: On Tue, Mar 04, 2003 at 01:41:58PM +0100, Marc Haber wrote: Parsing /usr/share/doc/$PACKAGE/changelog.gz is out of the question since /usr/share/doc need not be present, and calling dpkg --list $PACKAGE and parsing its

Re: How to obtain current package version number?

2003-03-04 Thread Colin Watson
On Tue, Mar 04, 2003 at 05:02:22PM +0100, Marc Haber wrote: On Tue, 04 Mar 2003 14:16:34 +0100 (CET), J?r?me Marant [EMAIL PROTECTED] wrote: IIRC you can get it from the postinst parameters. You can have a look to the policy, in maintainers scripts section. I thought so as well, but it

Re: How to obtain current package version number?

2003-03-04 Thread Simon Richter
Marc, Well, I wouldn't have posted without first consulting policy and developer's reference. Section 6.4 doesn't seem to document any maintainer script of the package being installed being called with the new version number as a parameter, so I was actually hoping that dpkg sends that

Re: How to obtain current package version number?

2003-03-04 Thread Thomas Viehmann
Roland Mas wrote: Colin Watson (2003-03-04 14:06:07 +) : On Tue, Mar 04, 2003 at 02:14:59PM +0100, Bastian Kleineidam wrote: How about the following? BASH_VERSION=$(dpkg -s bash | awk '/^Version:/ { print $2 }') if [ $(dpkg -s bash | awk '/^Status:/ { print $3 $4 }') == ok installed ]

Re: How to obtain current package version number?

2003-03-04 Thread Marc Haber
On Tue, 4 Mar 2003 17:34:47 +0100, Simon Richter [EMAIL PROTECTED] wrote: Well, I wouldn't have posted without first consulting policy and developer's reference. Section 6.4 doesn't seem to document any maintainer script of the package being installed being called with the new version number

Re: How to obtain current package version number?

2003-03-04 Thread Marc Haber
On Tue, 4 Mar 2003 16:41:48 +, Colin Watson [EMAIL PROTECTED] wrote: On Tue, Mar 04, 2003 at 05:02:22PM +0100, Marc Haber wrote: I thought so as well, but it looks like postinst is only called with the most recently configured version, not with the current version. Why not just preprocess

Re: How to obtain current package version number?

2003-03-04 Thread Marc Haber
On Tue, 04 Mar 2003 17:46:40 +0100 (CET), Jérôme Marant [EMAIL PROTECTED] wrote: En réponse à Sven Luther [EMAIL PROTECTED]: No, it is not. You just need to use the $1 argument to postinst, as Jerome told you. IIRC, it is $2. Policy 6.4 says: postinst configure most-recently-configured-version

Re: How to obtain current package version number?

2003-03-04 Thread Marc Haber
On Tue, 4 Mar 2003 16:41:48 +, Colin Watson [EMAIL PROTECTED] wrote: Why not just preprocess the postinst in debian/rules to embed its own version number directly into it? Nice idea, thanks! Is an executeable script (for example an init script) allowed to parse

Re: How to obtain current package version number?

2003-03-04 Thread Graham Wilson
On Tue, Mar 04, 2003 at 05:01:36PM +0100, Marc Haber wrote: On Tue, 4 Mar 2003 07:16:11 -0600, Graham Wilson [EMAIL PROTECTED] wrote: dpkg -l PACKAGE | awk '$2 ~ /PACKAGE/ { print $3 }' Well, I just said that I consider foo to be bad overkill, and you proceed to posting foo without any

Re: How to obtain current package version number?

2003-03-04 Thread Matt Zimmerman
On Tue, Mar 04, 2003 at 01:41:58PM +0100, Marc Haber wrote: how can a package learn about its current version number? Parsing /usr/share/doc/$PACKAGE/changelog.gz is out of the question since /usr/share/doc need not be present, and calling dpkg --list $PACKAGE and parsing its output looks

Re: How to obtain current package version number?

2003-03-04 Thread Darren Salt
I demand that Colin Watson may or may not have written... On Tue, Mar 04, 2003 at 11:52:09PM +0100, Marc Haber wrote: On Tue, 4 Mar 2003 16:41:48 +, Colin Watson [EMAIL PROTECTED] wrote: Why not just preprocess the postinst in debian/rules to embed its own version number directly into

How to obtain current package version number?

2003-03-04 Thread Marc Haber
Hi, how can a package learn about its current version number? Parsing /usr/share/doc/$PACKAGE/changelog.gz is out of the question since /usr/share/doc need not be present, and calling dpkg --list $PACKAGE and parsing its output looks like bad overkill. Does a maintainer script know the package

Re: How to obtain current package version number?

2003-03-04 Thread Bastian Kleineidam
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tue, Mar 04, 2003 at 01:41:58PM +0100, Marc Haber wrote: how can a package learn about its current version number? Package information is stored in /var/lib/dpkg/available. There is already a package parsing this information: grep-dctrl You can do

Re: How to obtain current package version number?

2003-03-04 Thread Graham Wilson
On Tue, Mar 04, 2003 at 01:41:58PM +0100, Marc Haber wrote: Parsing /usr/share/doc/$PACKAGE/changelog.gz is out of the question since /usr/share/doc need not be present, and calling dpkg --list $PACKAGE and parsing its output looks like bad overkill. dpkg -l PACKAGE | awk '$2 ~ /PACKAGE/ {

Re: How to obtain current package version number?

2003-03-04 Thread Henrique de Moraes Holschuh
On Tue, 04 Mar 2003, Bastian Kleineidam wrote: On Tue, Mar 04, 2003 at 01:41:58PM +0100, Marc Haber wrote: how can a package learn about its current version number? Package information is stored in /var/lib/dpkg/available. No. Do not skip the proper interface layers. Use dpkg to get that

Re: How to obtain current package version number?

2003-03-04 Thread Colin Watson
On Tue, Mar 04, 2003 at 02:14:59PM +0100, Bastian Kleineidam wrote: On Tue, Mar 04, 2003 at 01:41:58PM +0100, Marc Haber wrote: how can a package learn about its current version number? Package information is stored in /var/lib/dpkg/available. Information about what's installed is in

Re: How to obtain current package version number?

2003-03-04 Thread Marc Haber
On Tue, 4 Mar 2003 10:40:52 -0300, Henrique de Moraes Holschuh [EMAIL PROTECTED] wrote: No. Do not skip the proper interface layers. Use dpkg to get that information. Calling dpkg is actually the recommended way to do this? Can I call dpkg --list from a postinst script without having it explode?

Re: How to obtain current package version number?

2003-03-04 Thread Roland Mas
Colin Watson (2003-03-04 14:06:07 +) : On Tue, Mar 04, 2003 at 02:14:59PM +0100, Bastian Kleineidam wrote: [...] # example: current bash version number BASH_VERSION=`grep-available -P -s Version -n -r '^bash$'` That will be wrong in the event that somebody has run 'dselect update' but

Re: How to obtain current package version number?

2003-03-04 Thread Marc Haber
On Tue, 04 Mar 2003 14:16:34 +0100 (CET), Jérôme Marant [EMAIL PROTECTED] wrote: IIRC you can get it from the postinst parameters. You can have a look to the policy, in maintainers scripts section. I thought so as well, but it looks like postinst is only called with the most recently configured

Re: How to obtain current package version number?

2003-03-04 Thread Marc Haber
On Tue, 4 Mar 2003 07:16:11 -0600, Graham Wilson [EMAIL PROTECTED] wrote: On Tue, Mar 04, 2003 at 01:41:58PM +0100, Marc Haber wrote: Parsing /usr/share/doc/$PACKAGE/changelog.gz is out of the question since /usr/share/doc need not be present, and calling dpkg --list $PACKAGE and parsing its

Re: How to obtain current package version number?

2003-03-04 Thread Sven Luther
On Tue, Mar 04, 2003 at 04:58:32PM +0100, Marc Haber wrote: On Tue, 4 Mar 2003 10:40:52 -0300, Henrique de Moraes Holschuh [EMAIL PROTECTED] wrote: No. Do not skip the proper interface layers. Use dpkg to get that information. Calling dpkg is actually the recommended way to do this? Can I

Re: How to obtain current package version number?

2003-03-04 Thread Colin Watson
On Tue, Mar 04, 2003 at 05:02:22PM +0100, Marc Haber wrote: On Tue, 04 Mar 2003 14:16:34 +0100 (CET), J?r?me Marant [EMAIL PROTECTED] wrote: IIRC you can get it from the postinst parameters. You can have a look to the policy, in maintainers scripts section. I thought so as well, but it

Re: How to obtain current package version number?

2003-03-04 Thread Simon Richter
Marc, Well, I wouldn't have posted without first consulting policy and developer's reference. Section 6.4 doesn't seem to document any maintainer script of the package being installed being called with the new version number as a parameter, so I was actually hoping that dpkg sends that

Re: How to obtain current package version number?

2003-03-04 Thread Thomas Viehmann
Roland Mas wrote: Colin Watson (2003-03-04 14:06:07 +) : On Tue, Mar 04, 2003 at 02:14:59PM +0100, Bastian Kleineidam wrote: How about the following? BASH_VERSION=$(dpkg -s bash | awk '/^Version:/ { print $2 }') if [ $(dpkg -s bash | awk '/^Status:/ { print $3 $4 }') == ok installed ]

Re: How to obtain current package version number?

2003-03-04 Thread Jérôme Marant
En réponse à Sven Luther [EMAIL PROTECTED]: On Tue, Mar 04, 2003 at 04:58:32PM +0100, Marc Haber wrote: On Tue, 4 Mar 2003 10:40:52 -0300, Henrique de Moraes Holschuh [EMAIL PROTECTED] wrote: No. Do not skip the proper interface layers. Use dpkg to get that information. Calling

Re: How to obtain current package version number?

2003-03-04 Thread Marc Haber
On Tue, 4 Mar 2003 17:34:47 +0100, Simon Richter [EMAIL PROTECTED] wrote: Well, I wouldn't have posted without first consulting policy and developer's reference. Section 6.4 doesn't seem to document any maintainer script of the package being installed being called with the new version number

Re: How to obtain current package version number?

2003-03-04 Thread Marc Haber
On Tue, 4 Mar 2003 16:41:48 +, Colin Watson [EMAIL PROTECTED] wrote: On Tue, Mar 04, 2003 at 05:02:22PM +0100, Marc Haber wrote: I thought so as well, but it looks like postinst is only called with the most recently configured version, not with the current version. Why not just preprocess

Re: How to obtain current package version number?

2003-03-04 Thread Marc Haber
On Tue, 04 Mar 2003 17:46:40 +0100 (CET), Jérôme Marant [EMAIL PROTECTED] wrote: En réponse à Sven Luther [EMAIL PROTECTED]: No, it is not. You just need to use the $1 argument to postinst, as Jerome told you. IIRC, it is $2. Policy 6.4 says: postinst configure most-recently-configured-version

Re: How to obtain current package version number?

2003-03-04 Thread Marc Haber
On Tue, 4 Mar 2003 16:41:48 +, Colin Watson [EMAIL PROTECTED] wrote: Why not just preprocess the postinst in debian/rules to embed its own version number directly into it? Nice idea, thanks! Is an executeable script (for example an init script) allowed to parse

Re: How to obtain current package version number?

2003-03-04 Thread Graham Wilson
On Tue, Mar 04, 2003 at 05:01:36PM +0100, Marc Haber wrote: On Tue, 4 Mar 2003 07:16:11 -0600, Graham Wilson [EMAIL PROTECTED] wrote: dpkg -l PACKAGE | awk '$2 ~ /PACKAGE/ { print $3 }' Well, I just said that I consider foo to be bad overkill, and you proceed to posting foo without any

Re: How to obtain current package version number?

2003-03-04 Thread Colin Watson
On Tue, Mar 04, 2003 at 11:52:09PM +0100, Marc Haber wrote: On Tue, 4 Mar 2003 16:41:48 +, Colin Watson [EMAIL PROTECTED] wrote: Why not just preprocess the postinst in debian/rules to embed its own version number directly into it? Nice idea, thanks! Is an executeable script (for

Re: How to obtain current package version number?

2003-03-04 Thread Simon Richter
Marc, You can pull it in using a substvar, I think. That sounds interesting. Can you elaborate? I know that I can use substvars in my control file to get automatic dependencies on the libs I use, but how does that transfer to maintainer scripts? Never mind, I just looked it up. Substvars

Re: How to obtain current package version number?

2003-03-04 Thread Matt Zimmerman
On Tue, Mar 04, 2003 at 01:41:58PM +0100, Marc Haber wrote: how can a package learn about its current version number? Parsing /usr/share/doc/$PACKAGE/changelog.gz is out of the question since /usr/share/doc need not be present, and calling dpkg --list $PACKAGE and parsing its output looks