From 62662d162c217d2457df4abb9355165b79de816d Mon Sep 17 00:00:00 2001 From: schodet Date: Fri, 29 Jul 2005 18:22:32 +0000 Subject: Ajout des scripts de mise à jour de svnco. --- d/sys/lampion/local/bin/scan-svnco | 56 ++++++++++++++++++++++++++++++++++++ d/sys/lampion/local/bin/update-svnco | 46 +++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100755 d/sys/lampion/local/bin/scan-svnco create mode 100755 d/sys/lampion/local/bin/update-svnco (limited to 'd/sys/lampion') 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 < /tmp/update-svnco-output + +# Update SVN. + +svn up || echo "Error in svn up" >&2 +for i in $(scan-svnco make) +do + make -C $i doc +done +for i in $(scan-svnco txt) +do + echo "AFT $i" + grep -q '^*Title' $i && aft $i && [[ -f $i-TOC ]] && aft $i +done + +exec 1> $readme + +cat <Codes : +------- + +a : électronique analogique. +b : bureau. +d : outils et méthodes de dévelopement. +i : informatique. +n : électronique numérique. +m : mécanique. +p : gestion de projet. + +Documentation récente : +----------------------- + +EOF +scan-svnco html | \ +sed -ne 's|^\./\(.*\)/\([^/]*\.html\)$|\1/\2|p' \ + -e 's|^\./\(.*\)/\([^/]*\)$|\1/\2|p' +echo '' -- cgit v1.2.3