#!/usr/bin/env perl # This software is released under the same license and terms as perl # itself. # # This is a script for running svn status for multiple checkouts from # multiple repositories. It's meant to be run from cron every morning # to keep track of uncommitted files. # # The %roots hash below should contain paths to checkouts, or paths to # folders containing checkouts. If the path's value is 1, the script # will run svn status on any child folders that contain a .svn # directory. If the path's value is 0, svn status will be run on the # specified folder only. use strict; use warnings; use File::Glob ':globally'; my @paths_to_check; my %roots = ( '/var/www' => 1, '~/bin' => 0, '/path/to/checkout' => 0, '/etc/asterisk' => 0 ); while ( my ($base, $should_recurse) = each(%roots) ) { if ($should_recurse) { @paths_to_check = <$base/*>; } else { @paths_to_check = ($base); } foreach (@paths_to_check) { next unless -d; next unless -d "$_/.svn"; my $status = `svn status $_`; if ($status) { print $_, "\n"; print "-"x72, "\n"; print $status, "\n\n"; } } }