[46921] trunk/dports/devel

Ryan Schmidt ryandesign at macports.org
Sun Feb 22 16:33:09 PST 2009


On Feb 17, 2009, at 02:49, krischik at macports.org wrote:

> --- trunk/dports/devel/gnat-xmlada/Portfile	                         
> (rev 0)
> +++ trunk/dports/devel/gnat-xmlada/Portfile	2009-02-17 08:49:06 UTC  
> (rev 46921)
> @@ -0,0 +1,42 @@
> +# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t;  
> indent-tabs-mode: nil; c-basic-offset: 4 -*-
> +# $Id$
> +
> +PortSystem	    1.0
> +
> +name		    gnat-xmlada
> +version		    3.1
> +epoch		    20090126
> +revision	    1


Note that the initial revision of any given version of a port should  
be 0, not 1. This can be achieved by writing "revision 0" or by  
omitting the revision line entirely. Don't decrease it now, but keep  
this in mind for future port updates and submissions.

[snip]

> +distfiles	    xmlada-${version}-${epoch}.tar.bz2
> +worksrcdir	    xmlada-${version}-${epoch}

You can simplify these two lines to:

distname		xmlada-${version}-${epoch}


Note that it's not usual to include the epoch in the distfile name.  
In particular, you are using the epoch as if it is of less  
significance than the version number, but in fact, MacPorts treats  
the epoch as having the highest significance, more significant than  
the version or revision. The order of significance is epoch, then  
version, then revision.

The point of the epoch is so that you can downgrade a port to a  
previous version, if upstream mandates that e.g. due to a severe bug  
found in a new release, and still allow "port outdated" to work  
correctly, since "port outdated" (intentionally) only shows you ports  
that are "newer" than the version you have installed. There is a flag  
you can pass to "port outdated" to change that, but I forget what it  
is, and most users will not be using it, nor should they have to.

Another reason to use epoch is for ports that do not follow the  
customary version numbering scheme, e.g. ports that consider the  
version to be a floating point number instead of a dotted decimal.  
Most perl ports are in this situation. So for example MacPorts  
considers (dotted decimal) 1.10 to be greater than (dotted decimal)  
1.2 (because 10 is greater than 2), but in perl versioning, (floating  
point) 1.10 is less than (floating point) 1.2. So if you ever need to  
update a port from version 1.10 to version 1.2, you need to increase  
the epoch so MacPorts knows the new version is newer. At least until  
we have a more intelligent way of dealing with this, as proposed here:

http://trac.macports.org/ticket/11873


So, with that understanding of what the epoch is really for, you may  
want to consider including the date in the version instead, e.g.:

version		3.1-20090126

That way, if you need to update the port to 3.1-20090205, say, the  
user will see that in the output of "port outdated" (they will see  
"3.1-20090126 < 3.1-20090205"), whereas if you just change the epoch,  
the user will see "3.1 < 3.1" which will be confusing.

Consider the gcc44 or graphviz-devel ports which include the date in  
the version string.

In this case, you would change the line to just:

distname		xmlada-${version}

Note that you cannot remove or decrease the epoch, however; once a  
port has an epoch, it can never be removed or decreased, or else  
"port outdated" would not show new versions of the port to users who  
already had it installed.

> +use_bzip2	    yes
> +use_parallel_build  yes
> +use_configure	    yes

You can remove that last line since "use_configure yes" is the  
default when you do not use a portgroup (or even when you do use most  
portgroups, but for example the xcode portgroup defaults to  
"use_configure no" so you would have to specify "use_configure yes"  
if you wanted to override that).



More information about the macports-dev mailing list