On Tue, May 26, 1998 at 03:35:02PM -0500, Manoj Srivastava wrote:
> 
>  Adam> I use the following to take version numbers from the changelog:
>  Adam> SRC_VERSION := $(shell head -1 debian/changelog | cut '-d ' -f 2 | sed 
> 's/[()]//g')
> 
>       Why not go one step further and use the acceted interface to
>  chengelogs? 
> 
>  SRC_VERSION := $(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | sed 
> 's/^Version: *//')
> 
>       I think this is more robust ;-)

Great!
This make me remember that I used dpkg-parsechangelog in man-db's configure.in
to get both the version and the maintainer's entry.

Although very slow (on my 486) I think I'll use these for my "all numeric"
library packages:

===================================================================
ver_info =      ${shell LC_ALL=C \
                dpkg-parsechangelog 2>/dev/null \
                | awk '/^Version:/{ print $$2 }' }
full_ver =      ${shell expr "${ver_info}" : '\([0-9.]*\)'}
major_ver =     ${shell expr "${ver_info}" : '\([0-9]*\).[0-9]*'}
debian_ver =    ${shell expr "${ver_info}" : '[0-9.]*-\([0-9.]*\)'}
===================================================================

A perl addict would prefere to use this line to extract the three
informations, although I dubt its speed:

        LC_ALL=C dpkg-parsechangelog 2>/dev/null \
        | perl -ne 'print $1,"\n",$2,"\n",$3,"\n" \
        if /^Version:.*\s(([0-9]*).[0-9.]*)-([0-9.]*)/;'


fab - who loves this thread :-)
-- 
| [EMAIL PROTECTED]       [EMAIL PROTECTED]       [EMAIL PROTECTED]
| 6F7267F5 fingerprint 57 16 C4 ED C9 86 40 7B 1A 69 A1 66 EC FB D2 5E
> support the open-source initiative! http://www.opensource.org/


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to