Solved A strange number added to my port version

I made a port, a simple one, for my kernel module.
Some time ago, the build and installation ended with the registration of a new package in the system with its name and current version (v1.0):
Bash:
$ uname -v
FreeBSD 14.3-STABLE stable/14-n271366-5835d34761a0 RHINO

$ pkg query %n-%v | grep bh17
bh1750-kmod-v1.0
But now I've built and installed the port and I see its name with a strange version number - the version itself and some number added to it (v1.0.1):
Bash:
$ uname -v
FreeBSD 14.3-STABLE stable/14-n271616-7c05f298cdcc OPI_PC

$ pkg query %n-%v | grep bh17
bh1750-kmod-v1.0.1.1402501

distinfo
Code:
TIMESTAMP = 1749637978
SHA256 (gpio/bh1750-kmod-v1.0.1.tar.bz2) = e6a47df2e70af3a904fee5f21796e58ced770bb2a703df624bfea60204988db8
SIZE (gpio/bh1750-kmod-v1.0.1.tar.bz2) = 25117

Makefile
Code:
PORTNAME= bh1750-kmod
DISTVERSION= v1.0.1
CATEGORIES= misc
DIST_SUBDIR= gpio
PKGREPOSITORY= ${PACKAGES}/${DIST_SUBDIR}/${ARCH}

MAINTAINER= user@mail
COMMENT= FreeBSD kernel driver for a BH1750FVI based light sensor

LICENSE= BSD2CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE

USES= kmod

# gitlab variables
USE_GITLAB= yes
GL_ACCOUNT= alexandermishin13
GL_PROJECT= bh1750-kmod
GL_TAGNAME= v1.0.1

SUB_FILES= pkg-message

post-install:
    ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
    (cd ${WRKSRC}/fdt-overlay && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR})

.include <bsd.port.mk>

What is this number? How can I remove it again from a version number as it breaks `pkg upgrade` for the string "v1.0.1402501" is greater than "v1.0.1.1402501" ?
 
The issue is primarily caused by the change in your versioning scheme, you went from X.Y to X.Y.Z. If the first version was v1.0.0 instead of v1.0 then this wouldn't have happened. Also you should probably set DISTVERSIONPREFIX= v and remove the 'v' from DISTVERSION.

In order for the system to pick up the version scheme change properly add PORTEPOCH= 1 and stick to the X.Y.Z version scheme.

 
Thank You!!! I believed there must be a rational explanation for this.
Looks like I need to tinker with OS_SUFX a bit or just follow the fixed port version format to get the version comparison to work properly.

Thanks for the links to docs too.
 
Looks like I need to tinker with OS_SUFX a bit or just follow the fixed port version format to get the version comparison to work properly.
You could make the version of the update 1.1 instead of 1.0.1, sticking to the 'previous' X.Y scheme.
 
I have removed the 'v' from DISTVERSION and the version comparison became more correct.
And I think it would be wise to follow the new module naming scheme without any variable manipulation.

Thanks for your help.
 
Back
Top