# Missing UPDATING anymore



## chrbr (Oct 14, 2015)

This is on-topic from time to time. To avoid that issue I run a script as user as below:

```
#!/bin/sh
sudo /usr/sbin/portsnap fetch update
/usr/sbin/pkg version -v | /usr/bin/grep need
if test $((`/usr/bin/stat -f "%a-%m" /usr/ports/UPDATING`)) -ne 0
then
echo "*******************************************************"
echo "************ /usr/ports/UPDATING modified *************"
echo "*******************************************************"
sudo touch /usr/ports/UPDATING
fi
sudo pkg audit -F
```
I run it on a SSD where update of access time is switched off. Otherwise the 9th line might be skipped. The method is copied from x11/biff. BTW: Sometimes only the text messages are updated. But it triggers the message as well. May be others have a similar solution already.

Kind regards and happy updating !


----------



## SirDice (Oct 15, 2015)

This bit:

```
/usr/sbin/pkg version -v | /usr/bin/grep need
```
Is probably better do it like this:

```
/usr/sbin/pkg version -vl'<'
```
Or

```
/usr/sbin/pkg version -vL'='
```
The last one will also trigger on ports that are ahead or are missing.


----------



## chrbr (Oct 15, 2015)

Dear SirDice,
yes, thank you. This is much smarter. I will use the second option you have proposed because it covers more cases. Now I have read pkg-version(8). It gives more information than just pkg(8). Next time will check the references at the bottom of the man pages carefully. They are not there just to fill up the pages. Thank you!


----------



## SirDice (Oct 15, 2015)

Depending on your situation you might also want to add -R for checking against the remote package repository or -I for checking against the local /usr/ports/INDEX-*.


----------



## chrbr (Oct 15, 2015)

Is the remote package repository server supposed to be a machine in the local network which might pick up the ports for all other machines? Or is it one of the offical FreeBSD servers? May be one of those which compiles the ports to packages?


----------



## SirDice (Oct 16, 2015)

The remote repository is the one that shows up with `pkg -vv`. Which can be the official servers or your own. Depending on how you configured pkg(8).


----------

