[osgeo4w-dev] genini fix

Frank Warmerdam warmerdam at pobox.com
Mon Aug 3 10:35:04 EDT 2009


Jürgen E. Fischer wrote:
> Hi,
> 
> I notices that the qgis nightly builds weren't picked up for the setup.ini.
> This was due to the package version not being compared lexically, but not
> numerically.
> 
> I applied following fix:
> 
> --- genini      2008-03-15 06:08:42.000000000 -0800
> +++ /home/jef/genini    2009-08-02 21:45:03.000000000 -0700
> @@ -170,7 +170,20 @@
>      }
> 
>      return if $explicit;
> -    my @files = sort grep{!/-src\.tar.bz2/} glob("$d/*.tar.bz2");
> +    my @files = sort {
> +                        my($an,$av,$ap) = ($a =~ /(.*)-([^-]+)-(\d+).tar.bz2$/);
> +                        my($bn,$bv,$bp) = ($b =~ /(.*)-([^-]+)-(\d+).tar.bz2$/);
> +
> +                        if( defined $ap && defined $bp ) {
> +                                return ($an ne $bn) ?
> +                                        $an cmp $bn :
> +                                        $av ne $bv ?
> +                                                $av cmp $bv :
> +                                                $ap <=> $bp;
> +                        } else {
> +                                return $a cmp $b;
> +                        }
> +                } grep { !/-src\.tar.bz2/ } glob("$d/*.tar.bz2");
>      if (!@files) {
>          myerror "not enough package files in $d";
>          return;
> 
> 
> That also explains why I couldn't use the revision number as package number
> earlier.  Any opinions on switching to that now?

Jürgen,

I can't follow the change (my regex/perl foo is too weak).  Is the problem
that genini wasn't properly identifying which was the most recent version
due to the way versions are compared?  If so, there is a way of explicitly
listing the current and previous version in the setup.hint file and I wonder
if that would be a more appropriate way to control things.

If not, could you please confirm that this change does not affect the
setup.ini output for any other package?  I'm worried about it altering the
version for something else and us not realizing for some time.

I find genini very slow, and at some point I'd like to rewrite it in some
more efficient form.  I'm not really sure what part is the slow part.  But
Currently the genini step often times out on me if anything else is happening
on the machine at the same time.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the osgeo4w-dev mailing list