CVS tree to NSI: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
m (Updated author and download links, and changed format of some pages.) |
m (Updated author links.) |
||
Line 1: | Line 1: | ||
{|align=right | |||
|<small>Author: [[{{ns:2}}:titoo|titoo]] ([[{{ns:3}}:titoo|talk]], [[{{ns:-1}}:Contributions/titoo|contrib]])</small> | |||
|} | |||
<br style="clear:both;"> | |||
== Description == | == Description == | ||
Recurse through a CVS tree to create the File CreateDirectory SetOutPath directives | Recurse through a CVS tree to create the File CreateDirectory SetOutPath directives | ||
Line 59: | Line 63: | ||
Enjoy... | Enjoy... | ||
If you want to give a credit just create a link to [http://www.xhtml.net/ xhtml.net] on your webpage. | If you want to give a credit just create a link to [http://www.xhtml.net/ xhtml.net] on your webpage. | ||
Revision as of 23:14, 29 April 2005
Author: titoo (talk, contrib) |
Description
Recurse through a CVS tree to create the File CreateDirectory SetOutPath directives This is a perl script.
Example
Example to have the results in a text file:
perl listfilesnsi.pl v:/icas/work $INSTDIR\work > test.txt
It gives something like:
CreateDirectory "$INSTDIR\work" SetOutPath "$INSTDIR\work" File "v:\icas\work\graf.csv" File "v:\icas\work\MIX.CSV" File "v:\icas\work\NAME.CSV" File "v:\icas\work\PLOT.CSV" File "v:\icas\work\SURFACE.CSV" File "v:\icas\work\WATER.CSV" etc....
It avoids all the CVS folders.
#!/usr/bin/perl use File::Find; (@ARGV<2) && (die "Must specify a start dir and a start dir remplacement\n"); $startdir = $ARGV[0]; $remplace = $ARGV[1]; $currentdir = ""; %hash = (); @fichiers = (); find(\&handleFind, $startdir); exit; sub handleFind { my $foundFile = $File::Find::name; my $dir = $File::Find::dir; if ($dir =~ m/\/CVS$/) { return true; } if ($foundFile =~ m/\/CVS$/) { return true; } if ($currentdir ne $dir) { $currentdir = $dir; $dir =~ s/$startdir/$remplace/i; $dir =~ s/\//\\/gi; print "CreateDirectory \"$dir\"\n"; print "SetOutPath \"$dir\"\n"; } if (!(-d $foundFile)) { $foundFile =~ s/\//\\/gi; print "File \"" . $foundFile . "\"\n"; } }
Very simple... Enjoy... If you want to give a credit just create a link to xhtml.net on your webpage.