# Shortcut to updating the entire ports tree prior to "pkg_version"



## jb_fvwm2 (May 7, 2012)

Suppose there is not enough space in /usr  to update the ports tree.
( I imagine other reasons exist for the use of the code below)

```
# run from the [FILE]/usr/ports[/FILE] where there exists a [FILE]supfile.file[/FILE]
for f in $(pkg_info -o /var/db/pkg/* | grep "/" ); do (csup -g -L 2 -i ports/"$f" supfile.file ); done
```

As a bonus, it will probably run alphabetically so one can see its progress (though take 
a looong time...) I would caution against using this one-liner where there are very many
ports installed.


----------



## jb_fvwm2 (May 20, 2012)

Just came across this command mentioned today... no time to test it in the above scenario, but it is a lot quicker than the usual legacy updating methods 
	
	



```
#... pkg_version that is # 
portmaster -L --index-only | egrep '(ew|ort) version|total install'
```
Works if one is online at least... using a temporary /tmp folder, though one would csup or something to have portmaster  correctly act upon the output.
.....
The 
	
	



```
portmaster -L --index-only | tee -a /tmp/newersions.txt
```
 works fine. So the first post is sort of obsolete. 
Then one can one-by-one add the packages remotely or from a thumbdrive...


----------



## jb_fvwm2 (Jan 21, 2013)

*First Post In Thread Obsolete*

The first post in this thread mentions csup, now obsolete.

This next trick pertains slightly to keeping ports upgraded, say if you use svn (subversion).

a...

```
###### run from where your local [FILE].tbz[/FILE] are stored
# packages#    ls -lac  /mnt/portmaster-download  | tail -3   
###### assumes the thumbdrive has your packages to backup from here to the thumbdrive
.....
###### One now has the latest packages on the thumbdrive.  One wants newer packages to it.
# packages#    find . -newer /mnt/portmaster-download/[color="green"]scite-3.2.4.tbz[/color]
               -print | rsync --progress --size-only --files-from - . /mnt/portmaster-download
```
Please note the dash, dot, target directory construct ending that command.
I was using a variant of this (gcp; sleep; ) in a one-liner loop but a forum search failed to find it, so am posting this other method here.
REASON:  I had long wondered the rsync "just-copy-newer" simplest method, having used a more complex one in backups, but that more complex one deletes also. This does not, as I've posted it;
... and I happened to run across it in a thread on a discussion list elsewhere on the web earlier today.


----------

