CVS tree to NSI: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
m (Updated author links.) |
m (Adding new author and category links.) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{ | {{PageAuthor|titoo}} | ||
== 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 63: | Line 61: | ||
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. | ||
[[Category:Related Software]] |
Latest revision as of 11:53, 24 June 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.