Page 1 of 1

How to Use wget to Download Code::Blocks from SVN

Posted: Wed May 15, 2019 9:18 pm
by spflanze
To download the daily source code the Tortoise SVN is not useful to me because after a few files downloaded I get this error:

Code: Select all

Error running context: An existing connection was forcibly closed by the remote host. 
This error is repeatable regardless of how many times I clean the local directory and update it. This is not an error I have been able to solve, nor was the IT department here at work able to. I conclude the problem is at the website.

So I attempted the same thing using the wget command in Cygwin. In Cygwin's terminal emulator I went to the directory I wanted the download in and executed the command:

Code: Select all

 wget -N -e robots=off -r -np -c --tries=100 http://svn.code.sf.net/p/codeblocks/code/trunk
Where:
-N downloads and replaces a file only if the file on the server later than the local one, or if the local one is not present.
-e robots=off tells it to ignore the website's robots.txt file, which would otherwise block this download.
-r recursively downloads all subdirectories.
-np prevents it from downloading the entire site. It is a mnemonic for "no parent".
-c makes possible resumption of a disrupted download.
--tries=100 will cause it to retry failed downloads up to 100 times.

My expectation was that all in the directory at http://svn.code.sf.net/p/codeblocks/code/trunk and its subdirectories would be downloaded. What I got instead was that all in the directory at http://svn.code.sf.net/p/codeblocks/code and its subdirectories, including the targeted trunk directory, were downloaded.

I got what I wanted, namely the trunk directory. But a lot of time was spent downloading unneeded files. Why did this happen?

My OS is Windows 7.

Re: How to Use wget to Download Code::Blocks from SVN

Posted: Fri May 17, 2019 3:39 am
by spflanze
I have figured this out. To get only the trunk directory it must be followed by a / character in the command. The correct command is:

Code: Select all

 wget -N -e robots=off -r -np -c --tries=100 http://svn.code.sf.net/p/codeblocks/code/trunk/