summaryrefslogtreecommitdiff
path: root/d/sys/lampion/local/bin/scan-svnco
diff options
context:
space:
mode:
authorschodet2005-07-29 18:22:32 +0000
committerschodet2005-07-29 18:22:32 +0000
commit62662d162c217d2457df4abb9355165b79de816d (patch)
tree94a392f470988bef0f383d4075f86c9e6f73a156 /d/sys/lampion/local/bin/scan-svnco
parent1ae2a29d75aca1dc612aebe5238ec4df109c1418 (diff)
Ajout des scripts de mise à jour de svnco.
Diffstat (limited to 'd/sys/lampion/local/bin/scan-svnco')
-rwxr-xr-xd/sys/lampion/local/bin/scan-svnco56
1 files changed, 56 insertions, 0 deletions
diff --git a/d/sys/lampion/local/bin/scan-svnco b/d/sys/lampion/local/bin/scan-svnco
new file mode 100755
index 0000000..7b087e7
--- /dev/null
+++ b/d/sys/lampion/local/bin/scan-svnco
@@ -0,0 +1,56 @@
+#!/usr/bin/perl -w
+#
+# Ceci est un script sur mesure pour update-scnco.
+#
+use strict;
+
+sub find_files
+{
+ my ($dir, $want) = @_;
+ local $_;
+ my $d;
+ # Look for a Makefile.
+ if (-f "$dir/Makefile")
+ {
+ print $dir, "\n" if $want eq 'make';
+ # Only html keep running.
+ return unless $want eq 'html';
+ }
+ # For each file.
+ if (opendir $d, $dir)
+ {
+ while ($_ = readdir $d)
+ {
+ my $f = $dir . '/' . $_;
+ # Skip ., .., and hidden files.
+ next if /^\./;
+ # Skip Doxygen dirs.
+ next if $_ eq 'html';
+ # Skip robot www dir.
+ next if $_ eq 'www';
+ # Recurse to subdirs.
+ if (-d $f)
+ {
+ find_files ($f, $want);
+ }
+ # Find (aft) text files or recent html files.
+ elsif ($want eq 'txt' && /\.txt$/
+ || $want eq 'html' && /\.html$/ && -M $f < 10)
+ {
+ print $f, "\n";
+ }
+ }
+ closedir $d;
+ }
+}
+
+if (scalar @ARGV != 1 || $ARGV[0] !~ /^(?:make|txt|html)$/)
+{
+ print <<EOF;
+scan-svnco - scan a svn check out and find interresting files or directories.
+scan-svnco txt|make|html
+EOF
+ exit 1;
+}
+
+find_files ('.', @ARGV);