Julien Letessier | 1 Aug 2002 13:36
Picon

Comparing version numbers

Hi list,

I'm writing a dselect-like tool for NetBSD binary package repositories, 
and was wondering if there is an 'official' reference / code blob about:
   * how package version strings are to be compared;
   * how requirement strings are to be expanded in a boolean expression.

pkg_info(1)'s man page gives strong hints about this, but is not really 
a spec :)

Cheers,
--

-- 
Julien T. Letessier
Sun Labs Europe, Meylan, France
julien.letessier <at> sun.com

Jeremy C. Reed | 1 Aug 2002 13:52

Re: Comparing version numbers

On Thu, 1 Aug 2002, Julien Letessier wrote:

> I'm writing a dselect-like tool for NetBSD binary package repositories,

Sounds interesting and useful. (For those who don't know: dselect is a
Debian tool for installing, removing and getting information about
Debian's packages. I found it difficult to use at first; and once I used
Debian's apt-get I never went back.)

> and was wondering if there is an 'official' reference / code blob about:
>    * how package version strings are to be compared;
>    * how requirement strings are to be expanded in a boolean expression.

Maybe have a look at
/usr/src/usr.sbin/pkg_install/lib/ftpio.c
/usr/src/usr.sbin/pkg_install/lib/file.c
/usr/src/usr.sbin/pkg_install/add/perform.c
and other related files for "wildcard" and expandURL, etc.

You may want to use that library.

For perl or other examples, look at code from pkgsrc/pkgtools/ packages.

Also, please consider making your code so it is easy to develop with new
user interfaces (console and/or x11).

Good luck!

   Jeremy C. Reed
   http://bsd.reedmedia.net/
(Continue reading)

Hubert Feyrer | 1 Aug 2002 14:18
Picon

RFP: palmtop environment


Maybe someone feels like whipping this into shape for our handheld ports
(do they run X at all???):

	http://gpe.handhelds.org/screenshots.shtml

 - Hubert

--

-- 
Want to get a clue on IPv6 but don't know where to start? Try this:
* Basics -> http://www.onlamp.com/pub/a/onlamp/2001/05/24/ipv6_tutorial.html
* Setup  -> http://www.onlamp.com/pub/a/onlamp/2001/06/01/ipv6_tutorial.html
Of course with your #1 IPv6 ready operating system -> http://www.NetBSD.org/

Julien Letessier | 1 Aug 2002 14:49
Picon

Re: Comparing version numbers

Jeremy C. Reed wrote:
> On Thu, 1 Aug 2002, Julien Letessier wrote:
> 
>>I'm writing a dselect-like tool for NetBSD binary package repositories,
> 
> Sounds interesting and useful. 

Thanks. Since we're aiming to help end-users and sysadmins rather than 
devvies, it seemed pretty logical to develop such a tool.

>>and was wondering if there is an 'official' reference / code blob about:
>>   * how package version strings are to be compared;
>>   * how requirement strings are to be expanded in a boolean expression.
> 
> 
> Maybe have a look at
> /usr/src/usr.sbin/pkg_install/lib/ftpio.c
> /usr/src/usr.sbin/pkg_install/lib/file.c
> /usr/src/usr.sbin/pkg_install/add/perform.c
> and other related files for "wildcard" and expandURL, etc.
> 
> You may want to use that library.

Hmm. Seem quite dense. But I'm sure that there's a mechanism that does 
the same version-comparison inside pkgsrc's *.mk file. clue anyone?

> For perl or other examples, look at code from pkgsrc/pkgtools/ packages.

> Also, please consider making your code so it is easy to develop with new
> user interfaces (console and/or x11).
(Continue reading)

Manuel Bouyer | 1 Aug 2002 21:55

updated mailman package

Hi,
I've put an updated mailman package, based on feedback I got.  It's at:
ftp://ftp.antioche.eu.org/pub/bouyer/mailman2.0.12.tgz

changes with first version:
- now installs in $PREFIX/lib/mailman
- handle mm_cfg.py as config file as it could be customised
- reset permissions on $PREFIX/lib/mailman so that the tree is read-only
  for the mailman user. That way, no files should change once the package
  is installed, and should deinstall cleanly.

--

-- 
Manuel Bouyer <bouyer <at> antioche.eu.org>
--

Manuel Bouyer | 1 Aug 2002 21:57

Re: updated mailman package

On Thu, Aug 01, 2002 at 09:55:57PM +0200, Manuel Bouyer wrote:
> Hi,
> I've put an updated mailman package, based on feedback I got.  It's at:
> ftp://ftp.antioche.eu.org/pub/bouyer/mailman2.0.12.tgz
> 
> changes with first version:
> - now installs in $PREFIX/lib/mailman
> - handle mm_cfg.py as config file as it could be customised
> - reset permissions on $PREFIX/lib/mailman so that the tree is read-only
>   for the mailman user. That way, no files should change once the package
>   is installed, and should deinstall cleanly.

I forgot: switched to:
diffPYTHON_VERSIONS_ACCEPTED=   21 20
as it appears that the package will work with 2.1 too.

--

-- 
Manuel Bouyer <bouyer <at> antioche.eu.org>
--

Alistair Crooks | 1 Aug 2002 22:58

Re: Comparing version numbers

On Thu, Aug 01, 2002 at 01:36:35PM +0200, Julien Letessier wrote:
> Hi list,
> 
> I'm writing a dselect-like tool for NetBSD binary package repositories, 
> and was wondering if there is an 'official' reference / code blob about:
>   * how package version strings are to be compared;
>   * how requirement strings are to be expanded in a boolean expression.
> 
> pkg_info(1)'s man page gives strong hints about this, but is not really 
> a spec :)

Hmmm. OK, it's a fair cop, guv, I'll come quietly.

My only defence is that some time ago I beefed up the version comparison
code, and, although I modified the pkg_info(1) manual page, not enough
information was added.

Basically, all of the comparison work is done in

	pkg_install/lib/str.c

An array of 64-bit integers is constructed, using the rules in the comment
in line 156 (ish).

'.' encodes as '0'
'_' encodes as 'patchlevel', or '0'
'pl' encodes as 'patchlevel', or '0'
'rc' encodes as release candidate, which is -1
'nb' encodes as 'netbsd version', which is used after all the other tests

(Continue reading)

Greg A. Woods | 2 Aug 2002 01:15
X-Face
Favicon

Re: Comparing version numbers

[ On Thursday, August 1, 2002 at 22:58:42 (+0200), Alistair Crooks wrote: ]
> Subject: Re: Comparing version numbers
>
> 'rc' encodes as release candidate, which is -1

No, not just "-1".  How do you compare "1.rc2" against "1.rc3"?

I suggest that "rc" should mean "insert '.0.'":

	1.rc1	=>	1.0.1
	1.rc2	=>	1.0.2
	1.rc2.1	=>	1.0.2.1

and so on....

Unfortunately this can still be confused by bizzare numbering schemes,
but I think it's better than trying to figure out how to use negative
numbers when things get more complex....

(eg. 1.rc1, then 1.rc2, then 1.0, but correctly it should be 1.1)

-------------------------------------------------------------------------

Now if only all "vendors" would use this scheme that I use  :-)

Release Numbers:

We essentially follow the essence of the Berkeley CSRG version numbering
scheme for identifying releases.  That is to say we increment the third
number (3.7, 3.7.1, 3.7.2, etc.) whenever we generate a release of bug
(Continue reading)

Rene Hexel | 2 Aug 2002 02:47
Picon

Re: Comparing version numbers

On Fri, 2002-08-02 at 06:58, Alistair Crooks wrote:

> Basically, all of the comparison work is done in
> 
> 	pkg_install/lib/str.c
> 
> An array of 64-bit integers is constructed, using the rules in the comment
> in line 156 (ish).

  Thanks, Al, that was a good pointer.  I always had some sort of fuzzy
intuitive understanding of what's actually used for comparison, but it's
good to have a look at the real code.

> '_' encodes as 'patchlevel', or '0'

  I'm not sure I understand this part, though.  Here is a sniplet from
the code that does the encoding:

        if (*num == '_') {
                num += 1;
                if (isdigit(*(num + 1))) {
                        ap->v[ap->c++] = Dot;
                        return 1;

  Shouldn't that isdigit() part read

               if (isdigit(*num)) {

  instead?  'num' has already been incremented in the preceding line, so
that would check whether the next character is actually a digit.  The
(Continue reading)

Bernd Ernesti | 2 Aug 2002 08:38
Picon

Re: ntop2

On Tue, Jul 30, 2002 at 11:08:27AM -0400, Ciarcinski, Adam (ISS Brussels) wrote:
> Hi,
> 
> Does anybody have net/ntop2 working?
> For me it:
> 1. does not compile - I have to add --disable-intop

I guess you got this error:

/bin/sh ../libtool --mode=link cc  -g -I/pkgsrc/net/ntop2/work.i386/.buildlink/include -O2 -pipe
-L/pkgsrc/net/ntop2/work.i386/.buildlink/lib  -Wl,-R/usr/pkg/lib -o intop  argv.o command.o
getopt.o gnuline.o prompt.o intop.o init.o open.o close.o filter.o pcapmore.o sniff.o uptime.o
status.o lsdev.o nettable.o info.o swap.o hosts.o arp.o nbt.o top.o bind.o hash.o dump.o
../libntop.la -lreadline  -lncurses -lpthread -lresolv
-L/pkgsrc/net/ntop2/work.i386/.buildlink/lib -lintl  -lcrypt -lm -lz -lssl -lcrypto
mkdir .libs
cc -g -I/pkgsrc/net/ntop2/work.i386/.buildlink/include -O2 -pipe -Wl,-R/usr/pkg/lib -o
.libs/intop argv.o command.o getopt.o gnuline.o prompt.o intop.o init.o open.o close.o filter.o
pcapmore.o sniff.o uptime.o status.o lsdev.o nettable.o info.o swap.o hosts.o arp.o nbt.o top.o
bind.o hash.o dump.o  -L/pkgsrc/net/ntop2/work.i386/.buildlink/lib ../.libs/libntop.so -lpcap
-lgdbm -lreadline -lncurses -lpthread -lresolv -lintl -lcrypt -lm -lz -lssl -lcrypto -Wl,--rpath -Wl,/usr/pkg/lib
gnuline.o: In function `history':
/pkgsrc/net/ntop2/work.i386/ntop/intop/gnuline.c:141: undefined reference to `history_list'

Hmm, I thought that this maybe because I don't have ncurses installed,
but the ncurses doesn't have this function so it must be a different library.

Ah, there is a libhistory library which has that function, but there is no -lhistory
while linking intop.

(Continue reading)


Gmane