How do I recover a lost ports directory with svn?

Matthew Seaman matthew at FreeBSD.org
Tue Dec 26 17:50:07 UTC 2017


On 26/12/2017 16:58, Matthias Apitz wrote:
> On Tuesday, 26 December 2017 17:27:54 CET, Bob Willcox <bob at immure.com>
> wrote:
>> I accidently removed one of my ports subdirectories, devel/swig13, and
>> need to check it back out from svn. Unfortunately the documentation for
>> svn seems skimpy (at best) and I'm not able to come up with a command
>> and arguments that will allow me to check out this port's directory.
>>
>> Is there some way to do this (w/o removing everything and checking it
>> all out again)? Any help much appreciated.
>>
>> Thanks,
>> Bob
>>
> 
> cd /usr/ports
> svn up
> 
> or
> 
> svn up -rnnnnnn
> 

Careful now.  bapt removed the devel/swig13 port in r456846 about 5 days
ago now.

If the OP has a checked out ports tree from before r456846 ('svn info'
will show what revision you have) where he has accidentally deleted
devel/swig13, then he can do:

   # svn revert -R devel/swig13

If he's got a newer version than r456846 but wants to restore the last
version of devel/swig13 before it was removed, then he can either check
out a specific version of the entire tree:

   # svn up -r456800

or just the devel/swig13 subdirectory, leaving the rest of the tree alone:

   # svn up -r456800 devel/swig13

(you need to cd to the top directory, typically /usr/ports, for any of
these commands.)

Note that 'svn up' will revert both of the last two commands.  None of
these commands should need to pull down vast quantities of data from the
repository, as there's a pristine copy of the data in /usr/ports/.svn
including the revision history, so it's pretty easy to get an older
version of the tree checked out.

	Cheers,

	Matthew


	


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 992 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20171226/0da7d827/attachment.sig>


More information about the freebsd-questions mailing list