[69018] trunk/dports/math/pspp-devel/Portfile
Ryan Schmidt
ryandesign at macports.org
Mon Jun 21 01:57:08 PDT 2010
On Jun 20, 2010, at 10:04, snc at macports.org wrote:
> Revision: 69018
> http://trac.macports.org/changeset/69018
> Author: snc at macports.org
> Date: 2010-06-20 08:03:59 -0700 (Sun, 20 Jun 2010)
> Log Message:
> -----------
> update version, tweak versioning scheme to allow livecheck
>
> Modified Paths:
> --------------
> trunk/dports/math/pspp-devel/Portfile
>
> Modified: trunk/dports/math/pspp-devel/Portfile
> ===================================================================
> --- trunk/dports/math/pspp-devel/Portfile 2010-06-20 14:29:39 UTC (rev 69017)
> +++ trunk/dports/math/pspp-devel/Portfile 2010-06-20 15:03:59 UTC (rev 69018)
> @@ -5,10 +5,10 @@
>
> name pspp-devel
> set base_vers 0.7.5
> -set base_rev 20100610040508
> -set buildnum ga3b36e
> -version ${base_vers}
> -revision 1
> +set base_rev 20100620040502
> +set buildnum g551ae7
> +version ${base_vers}-${buildnum}
> +revision 2
> categories math
> license GPLv3+
> maintainers snc
> @@ -25,9 +25,9 @@
>
> master_sites http://pspp.benpfaff.org/~blp/pspp-master/${base_rev}
> distname pspp-${base_vers}-${buildnum}
> -checksums md5 36286f094d84ab023ceefa33a324383f \
> - sha1 ce416e0a64fd540102431c18df30636af931ee25 \
> - rmd160 a9563f0c07e4cd1f55482a65d55de7cfd90ccc2a
> +checksums md5 f2849950b85ca9ef0c0558c2fbfcec26 \
> + sha1 ed5c4d2d2bab5237bde4aef16568234036fa9aea \
> + rmd160 8466e7245cd65037bb05a5e35fc4d1cf34029006
>
> depends_build port:pkgconfig
> depends_lib port:gsl \
> @@ -109,3 +109,6 @@
> ${destroot}${applications_dir}/PSPP.app/Contents
> }
> }
> +
> +livecheck.url http://pspp.benpfaff.org/~blp/pspp-master/latest/
> +livecheck.regex <td>version<\\/td><td>(.*)<\\/td>
You never need to change the version field to accommodate the livecheck. That's why livecheck has its own fields, like livecheck.version.
Not only is it not necessary to put what you're calling buildnum into the version field, it's also not a good idea, because buildnum is not an increasing number. I mentioned this before, but let me give you a specific example.
Using this list
http://pspp.benpfaff.org/~blp/pspp-master/
we can see what this project's prior version numbers have looked like, along with their snapshot date. Let's pick a few chronologically:
20100215230959 0.7.4 g3bb162
20100217084144 0.7.4 gd92412
20100221040520 0.7.4 g736cad
20100228040509 0.7.4 g61e32c
20100320040502 0.7.4 ge369cd
20100407040507 0.7.4 gfbba41
20100502040503 0.7.4 g9389f9
As you can see, the third value, the one starting with g, does not strictly increase. Rather, it is a checksum or a hash of some sort.
If you had used the port version scheme you're using now for all of the above versions, you would have had to increase the epoch rather a lot to compensate for this non-increasingness. For example, to update from 0.7.4-gd92412 to 0.7.4-g736cad you would have had to increase the epoch (because "g736cad" is not greater than "gd92412"). And again when updating from 0.7.4-g736cad to 0.7.4-g61e32c ("g61e32c" is not greater than "g736cad"). And I would have thought again from 0.7.4-gfbba41 to 0.7.4-g9389f9, but for some reason, MacPorts considers "g9389f9" to be greater than "gfbba41". I guess I don't fully understand how rpm-vercomp works.
It would be better to ensure the components of the version field are numbers that always increase. I recommended using the snapshot date in the version number, as the molden and dcraw ports do. Or you could use both the snapshot date and the hash; this might be easier still.
For the molden and dcraw livecheck we are interested not only in the published version number but also the distfile date; since MacPorts livecheck can only check one value, I wrote a PHP script to get the two values and mash them together into a single value MacPorts can understand. This PHP script lives on my server and the molden and dcraw portfiles use it as their livecheck. For pspp-devel we want three values -- version, snapshot date, and hash. I've now updated that script to return this information about pspp-devel as well.
I present a patch to your portfile which I believe will result in easier updates and less work for you. Now updates are as simple as "sudo port livecheck", copy the version displayed and paste it into the version field in the port (just like for any other port), "sudo port -d checksum" to get the new checksums, paste them into the portfile, save, test, done.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pspp-devel.diff
Type: application/octet-stream
Size: 995 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20100621/db9576ee/attachment-0001.obj>
More information about the macports-dev
mailing list