Blame | Last modification | View Log | RSS feed
#!/usr/bin/perluse strict;use Getopt::Long;my $everything;my $quiet;GetOptions ( "all" => \$everything,"help" => \&usage,"quiet" => \$quiet,) or usage ();# Source and targetsmy $svn_repo = "https://svn.gadell.org/svn/PEEPS/trunk/";my %path = (site => "/var/www/html",perl => "/usr/local/lib/site_perl",util => "/root/util");# Error checkingusage ("No module (or -a) specified.") unless ($everything or scalar @ARGV);usage ("Module and -a specified, unclear what you want to do.") if ($everything and scalar @ARGV);map { usage ("Unknown module: '$_'.") unless defined $path{$_} } @ARGV;# Do the things.foreach (scalar @ARGV ? @ARGV : keys %path) {my @command = ("/usr/bin/svn", "export", $svn_repo.$_, $path{$_}, "--force", "--quiet");pop @command unless $quiet;print join (" ", @command, "\n") unless $quiet;system (@command);print "\n" unless $quiet;}sub usage {my $problem = shift // "";print "$problem\n" unless !$problem;print<<usage;./deploy.pl [-v] [-h] [-a | util | perl | site]Export latest files from svn.gadell.org.Optional:-q supress output-h This usage outputRequired (one of the following):-a Deploy all modulesutil Utility scriptsperl Perl modulessite Site filesusageexit;}