# pkg_version and two ports



## Petz (May 5, 2010)

Hi All,

Please excuse if this is newbie question. But I am trying to build a FreeBSD system that will hopefully be used at my work and serve as the basis for a wider deployment of FreeBSD. As part of that I want to make sure it is maintained and as much as possible automated. I have setup jobs to run freebsd-update and portsnap. Something I have noted is that the two packages postgresql-contrib and en-freebsd-doc keep showing up in the version check.


```
root@djbsd1 /root ->pkg_version -vIL=
en-freebsd-doc-20090913             <   needs updating (index has 20100410)
postgresql-contrib-8.4.3_2          >   succeeds index (index has 8.2.15_2)
```


I have updated my ports tree with portsnap but still if I rebuild postgresql-contrib it is the same version 8.4.3_2? What am I missing? Is 8.2.15_2 out? Is it newer or not? I think it would be but pkg_version seems to think its not. Should I just ignore this package and run 
	
	



```
pkg_version -vIL'>'L=
```
 instead?

Again I have a similar issue with en-freebsd-doc. Though rather then build it from source (as I have seen other people complain about the large amount of dependencies required). I simple used pkg_delete and pkg_add -r. However I got the same version. Doing a serach in google I found a tar ball for the new version here
http://ftp.ussg.iu.edu/FreeBSD/ports/amd64/packages-8-stable/docs/en-freebsd-doc-20100410.tbz
But the main FreeBSD FTP Repositories seem to have the older 20090913
ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8.0-release/Latest/en-freebsd-doc.tbz

So is there actually updated documentation? Should I just download the new tarball and install it? Why aren't the main FTP repo's up to date?

Regards Petz


----------



## jb_fvwm2 (May 5, 2010)

"succeeds" probably means you have not run
pkgdb -u OR pkgdb -F (iirc) since you rebuilt them.
...
8.4 is newer than 8.2, no worries. Except,
do you have backups?
....
The older packages in the repositories... AFAIK there
is only so much hardware upstream to build.  Three times
as many machines, there might be more packages available.
...
Someone might clarify or make a slight correction.


----------



## Petz (May 5, 2010)

jb_fvwm2 said:
			
		

> "succeeds" probably means you have not run
> pkgdb -u OR pkgdb -F (iirc) since you rebuilt them.
> ...
> 8.4 is newer than 8.2, no worries. Except,
> ...



Ah I thought it was 8.4.15_2 for some reason not 8.2.15_2. So your right it is an older version I can ignore with the pkg_version flags I posted earlier. Why is the index out of date though for pkg_version? I didn't find 'pkgdb' on my system or in ports or a man page. After looking on google its part of the port-mgmt/portupgrade. Is this the only way to get the indexes updated? I have been using portsnap to update the ports tree and portmaster to install stuff so I haven't got portupgrade (and therefore pkgdb) installed.


----------



## SirDice (May 5, 2010)

If you used csup to update your ports tree the /usr/ports/INDEX-? file isn't updated. This will fix that:

```
cd /usr/ports/
make index
```

The -I option to pkg_version will tell it to use the INDEX-? file. If you remove that option pkg_version will look at the port's Makefiles. This is obviously quite slower so the best thing to do is to update your index.


----------



## DutchDaemon (May 5, 2010)

(which portsnap will do automatically, so consider switching to portsnap(8))


----------



## Petz (May 11, 2010)

Thanks guys. I have rebuilt the index as per your suggestion and that fixed the issue. I guess at some stage myself or someone else ran a csup update instead of portsnap.

Any idea on the FreeBSD doc port?

```
en-freebsd-doc-20090913             <   needs updating (index has 20100410)
```


----------



## DutchDaemon (May 11, 2010)

From your first post I conclude that you're trying to install packages for 8.0-RELEASE. These are built once (when RELEASE comes out) and never touched after. If you want newer versions, you will have to point your PACKAGESITE variable to the 8-STABLE packages (see pkg_add(1) and search the forums for PACKAGESITE).


----------



## Petz (May 25, 2010)

Thanks Dutch that is a good tip. It isn't the full solution but it helped me work it out. Apart from your tip I found that.

1. I need to be more patient. I guess Freebsd-doc is a port after all. So like other ports if I want the latest I should get off my arse and build it myself from the port. Which is what pkg_version is getting the version info from to tell me its out of date.

2. I need to set a better source location for pkg_add. Now that you provided me with the know how to use pkg_add -r with an alternate source. I went in search of the now released en-freebsd-doc-20100519 which pkg_version shows is out.

```
root@djbsd1 /usr/ports/misc/help2man ->pkg_version -vIL=
en-freebsd-doc-20090913             <   needs updating (index has 20100519)
```

Interestingly if you look at the link below,
ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/Latest/en-freebsd-doc.tbz

You may notice that the FTP server actually has the file as symbolic link to
May 12 2010 21:24         Link en-freebsd-doc.tbz -> ../All/en-freebsd-doc-20100410.tbz 

Not only is the linked file missing but the new package has been built 
ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/All/en-freebsd-doc-20100519.tbz
May 23 2010 03:51 564654323 en-freebsd-doc-20100519.tbz

So to get this package I need to.

```
setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/All/
pkg_add -r en-freebsd-doc-20100519
```

This is much better!!!! Had I been trying to get this package each day after it hit ports. The package would have been available 4 days after ports.

Just out of curiosity why does the FTP 'Latest' folder exist? What is different to the packages there to the ones in 'All'? Most things(I didn't check them all) in 'Latest' seem to be links to the 'All' folder? Is this just to maintain some sort of legacy naming? Should I be using 'Latest' or 'All' if I ever need other binary packages?


----------



## DutchDaemon (May 25, 2010)

The /Latest directory has packages by 'name', so it understands pkg_add -r bash. Because it is a symlink to the actual and most recent 'versioned filename' you don't have to type in the full file/version name everytime you want to add a package. It's simply a matter of convenience. That's why pkg_add -r en-freebsd-doc will work when you use /Latest as your package site. The fact that it actually pulls in /All/en-freebsd-doc-20100519 (which you don't need to memorise!) is of secondary importance.


----------



## Petz (May 25, 2010)

*Solved*



			
				DutchDaemon said:
			
		

> The /Latest directory has packages by 'name', so it understands pkg_add -r bash. Because it is a symlink to the actual and most recent 'versioned filename' you don't have to type in the full file/version name everytime you want to add a package. It's simply a matter of convenience. That's why pkg_add -r en-freebsd-doc will work when you use /Latest as your package site. The fact that it actually pulls in /All/en-freebsd-doc-20100519 (which you don't need to memorise!) is of secondary importance.



Now that you have said that its quite obvious why the two locations exist. Thanks again. So I guess use /Latest unlesss I am after something specific. Such as my case were the symlink is broken(points to the old version which was removed from /All).


----------

