Echilon
Echilon

Reputation: 10244

Excluding .svn directories with WinRar

I have a PowerShell script I use for creating distributions that copies compiled files from a few places and zips them up with winrar. In the script, I change to a directory containing the folders I want to run and execute this:

Invoke-Expression ($WinRAR + " a " + $zipPath + " " + $WinRARFilter + " " + $DistName + "-zip " + $WinRAROpts)

Which actually executes this:

E:\Progs\WinRar\WinRar.exe a C:\Users\Echilon\Documents\Coding\ResourceBlender-Express\trunk\dist\resourceblender-express_1.44-zip.zip -x*\.svn\* -x*\.svn -x\.svn resourceblender-express-zip -r -s -m5 -inul

Yet none of the .svn directories are excluded from the zip file. This used to work and I have no idea why it doesn't now, but I can't get it to exclude the right files.

The full script is on codeplex at http://resourceblender.codeplex.com/sourcecontrol/changeset/view/27742?projectName=resourceblender#456701 (at the bottom of the script)

Could someone with some experience in PowerShell shed some light on this please?

Upvotes: 3

Views: 6136

Answers (6)

mike
mike

Reputation: 51

This is a PowerShell issue. I put the same command in the Command Prompt and BOOM!

winrar a -ehs -x*\.svn\* -u -r -afrar -m3 "dest file.rar" "source folder"

Upvotes: 2

Andrea Gramazio
Andrea Gramazio

Reputation: 131

I had the same problem, solved using:

-x*.svn\

I use WinRar v3.93 for Windows. Please note the final backslash.

Upvotes: 13

HaxElit
HaxElit

Reputation: 4073

I ended up using

-x*\.svn*

This will ignore the actual .svn folder and not just everything inside of it. I'm also using WinRAR 3.80. Have you tried updating your version of winrar ?

Thought the svn export method worked out a lot better for me cuz I didn't get all the debug builds and misc .dlls

Upvotes: -1

PlageMan
PlageMan

Reputation: 792

I had the same problem and found this page with no solution, so for other people googling it the correct switch is :

-x*\.svn\*

Upvotes: 1

Ilya Kochetov
Ilya Kochetov

Reputation: 18443

I agree with Neil Butterworth comment regarding the use of the svn export command being more appropriate in this case. Talking about WinRar you might consider using an -e switch to skip hidden folders (.svn is a hidden folder) and an -ep switch to exclude it by name.

Please refer to WinRar manual for more information

Upvotes: 1

anon
anon

Reputation:

The right way of doing this is to perform a svn export which will create a copy of the project without the .svn directories (and anything else not version controlled) and then do the zip.

Upvotes: 11

Related Questions