[114136] trunk/dports/databases/postgis2/Portfile

Ryan Schmidt ryandesign at macports.org
Sun Dec 1 00:15:37 PST 2013


The epoch line is no more a wart than any other line of the Portfile… it’s just a syntax for accomplishing a task.

On Dec 1, 2013, at 01:47, Vincent Habchi wrote:

> Blair:
>> That’s right, they can never be removed.
> 
> Thanks.
> By the way, what was the ‘epoch’ meant for, initially? 

You mean in this port? or generally?

In general, port versions increase. 1.0 is followed by 1.0.1 is followed by 1.1 is followed by 2.0. However sometimes version numbers change in such a way that they appear, based on the normal rules, to decrease. For example, if a project does not assign version numbers, the port maintainer may have invented a version number that looks like a date, such as “20090103”. This is fine until a real version of the software is released, such as “1.0”. When that happens, version “20090103” will appear to the normal MacPorts version comparison procedure (vercmp) to be greater than “1.0” though it should in fact be considered to be less. That is the time when you increase the epoch from its default “0” to a higher number, such as “1”.

“port outdated” shows you ports MacPorts thinks are outdated. That list includes ports whose versions are greater (i.e. upgrade 1.0_0 to 1.1_0), those whose versions are the same and whose revisions are greater (i.e. upgrade 1.0_0 to 1.0_1), and those whose epoch is greater (i.e. 20090103_0 (epoch 0) to 1.0_0 (epoch 1)).

You added the epoch line to this port in r95593 when you updated the port from version “2.0.1-svn” to version “2.0.1”; without this, MacPorts would not have known that “2.0.1” should be considered to be greater than “2.0.1-svn” and this update would not have been displayed to users in “port outdated”. If you are unsure how vercmp will behave for any given versions, you can test it out by using the vercmp script in my users directory:

$ ~/macports/users/ryandesign/scripts/vercmp 2.0.1-svn 2.0.1
MacPorts considers 2.0.1-svn to be greater than 2.0.1.

Now that the epoch line is in this port, it can never be removed or decreased, otherwise MacPorts will not show any future updates to users in “port outdated”.

This is not a problem. This is the situation the “epoch” keyword was designed to address. It should not be our goal to avoid using the epoch keyword; it should be our goal to understand how the epoch keyword works and to use it for its intended purpose such that users can be told the true version of the software that they are installing, not a made-up version number the maintainer invented to avoid using the epoch keyword.

To complete the trio, the revision keyword is intended for situations where the maintainer wishes to change the files the port installs without changing the version of the software that is installed. 





More information about the macports-dev mailing list