How can you re-copy a port to your system?

Suppose I want to get a fresh copy of a port. For example if I rename a port directory in the ports tree or completely delete one how can I get the system to re-download that directory again? I tried pkgdb -fu nothing, then portsnap update told me it was already up to date, then portupgrade -arR but still the directory didn't get copied over. Also tried portsnap fetch update.
 
in your case i would use csup utility.

But, i suggest you delete all ports tree and use portsnap fetch extract, and then portsnap fetch update (next time, to update ports tree)

portsnap is much, much faster when updating ports, than csup.

normally you don't need to move, rename files/directories in ports tree.

so:
1) rm -R /usr/ports/*
2) portsnap fetch extract

and when in a day, week, month you want to update ports run:
portsnap fetch update


portsnap fetch extract will be slow, because it needs to fetch entire ports tree for first time.
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/updating-upgrading-portsnap.html

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/ports-using.html
 
"in your case i would use csup utility."

Why?

"But, i suggest you delete all ports tree and use portsnap fetch extract,"

Why, I don't want to replace the whole tree just one port.

"...and then portsnap fetch update (next time, to update ports tree)"

That's what I did, it's not working.

"portsnap is much, much faster when updating ports, than csup."

That's what I'm using it.

"normally you don't need to move, rename files/directories in ports tree."

Ya I know, I looked at a Makefile with vi and not sure if I screwed it up so want to get the original files all back.

"portsnap fetch extract will be slow, because it needs to fetch entire ports tree for first time."

Ya, that's why I don't want to redo the whole thing just one port.

How?

So I repeat, how do I replace one port, not the whole tree?
 
I renamed /usr/ports/x11-wm/awesome to /usr/ports/x11-wm/awesom then typed portsnap extract /usr/ports/x11-wm/awesome and it just went back to the command line and didn't do anything. Shouldn't it see that the directory awesome doesn't exist and copy it back over?
 
Try [cmd=]portsnap extract x11-wm/awesome [/cmd] instead.

Code:
# portsnap extract x11-wm/awesome
/usr/ports/x11-wm/awesome/
/usr/ports/x11-wm/awesome2/
 
Thank you, that worked. But why doesn't it work when you give the whole path? So you just give it the next directory up only? I looked at man page and couldn't see that mentioned anywhere.
 
The ports tree is 'hardcoded' to /usr/ports, so the path is omitted from the portsnap tarball. It would be nice if that 'wrong' portsnap command would give some diagnostic output ('port not found', or something similar), but it just fails silently. By the way, the same logic goes for portmaster (a port can be installed using [cmd=]portmaster x11-wm/awesome[/cmd]).
 
Back
Top