comparison of version numbers in pkg

Hi, I am trying to update a pkg from a local pkg file, and pkg seems to think that the already installed version is the most recent one.
On the other hand, pkg version is on my side..
I am quite certain that the error is on my side (I created those packages), but do not see it.

Code:
root@xxxx:/home/usas-adm/packages # pkg info srhr
srhr-0.5.5
Name           : srhr
Version        : 0.5.5
Installed on   : Tue Apr 18 08:57:55 2023 CEST
Origin         : local/srhr
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : local
Options        :
    git            : 0.5.5
    ref            : 0.5.5
    utc            : 20230418-0657
Annotations    :
    FreeBSD_version: 1301000
Flat size      : 11.9MiB
Description    :
SpaceRider HotRedundancy application
root@xxxx:/home/usas-adm/packages # pkg info --file srhr-1.1.1.pkg
srhr-1.1.1
Name           : srhr
Version        : 1.1.1
Origin         : local/srhr
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : local
Options        :
    git            : 1.1.1
    ref            : 1.1.1
    utc            : 20240222-1828
Annotations    :
    FreeBSD_version: 1301000
Flat size      : 12.3MiB
Description    :
SpaceRider HotRedundancy application
root@xxxx:/home/usas-adm/packages # pkg version -t 0.5.5 1.1.0
<
root@xxxx:/home/usas-adm/packages # pkg add srhr-1.1.1.pkg
Installing srhr-1.1.1...
the most recent version of srhr-0.5.5 is already installed
 
pkg add -f srhr-1.1.1.pkg will force the install (you can also use this to force install of an older package).

Not sure what the problem is. Maybe the 0.5.5 version also had an PORTEPOCH?
 
Hi,
thank you for your answers so far!
The package contains commercial software by my company and is not published.
I install it without a (local/remote) repository.

I am aware of delete/add and force, but am looking for a clean way to update a version.
 
T-Daemon pkg install -U is working, thanks for that!

unclean: I understand that the pkg database will not get corrupted by these actions. It is more of an aesthetic matter, I think.
A package with a higher version number should be updated normally.
If a package has a lower version number than the currently installed one, I expect that I have to confirm that I really want that "rollback".

SirDice : PORTEPOCH is not in use. All the packages have been created by me, with the same script, I just increased the version numbers.

Well, I now have enough methods to chose from.
Again, thank you to all for your help!
 
Besides, why do you consider delete/add and force as unclean?
A pkg-upgrade(8) is actually a pkg-delete(8) followed by a pkg-add(8) anyway.
A package with a higher version number should be updated normally.
That I agree with. It should just automatically pick it up. It's odd, don't quite understand why it's not doing that. Have you tried a pkg update -f? That sometimes helps.
If a package has a lower version number than the currently installed one, I expect that I have to confirm that I really want that "rollback".
Not on FreeBSD's pkg(8). It will just complain a more recent version has already been installed then bail out. In order to 'rollback' you're going to have to use the -f option.
 
A package with a higher version number should be updated normally.
That I agree with. It should just automatically pick it up. It's odd, don't quite understand why it's not doing that.
That pkg-add(8) issue was subject on the Github repository for pkg issues over 9 years ago. It was closed then as "completed". Looks like it has never been resolved:

Unable to manually update package with pkg add #1132

(Found the workaround from post # 5 there.)

Have you tried a pkg update -f? That sometimes helps.
I don't think that's going to help.

Looks like srhr is a unofficial port/package, no record in the official ports tree, including deleted ports.
The package contains commercial software by my company and is not published.
I install it without a (local/remote) repository.
 
Indeed, the current behaviour of pkg add seems to be to only check whether the package is already installed:

The version is not checked there.

This given, I would have to use a local repository if I wanted version checks with updates.
But since I am the one who provides the update and I want to execute it, there is not much sense behind asking myself
if I want to do it. The whole systems runs in a protected environment, so in my case it's safe to use one of the above methods.
 
Back
Top