#!/usr/bin/perl -w use strict; use Getopt::Long; #servers to sync with my @servers=('toast', 'crumpet','scone'); #options my $show_help=0; my $docopy=0; my @filelist=(); my @exfilelist=(); my $makelive=0; my $cvsupdate=0; my $apache=0; my $mysql=0; my $fast=0; my $revision=''; my $tracker=0; my $today=0; my $filesonly=0; GetOptions ( 'help', \$show_help, 'cvsupdate!', \$cvsupdate, 'svnupdate!', \$cvsupdate, 'makelive!', \$makelive, 'live!', \$docopy, 'r=s' => \$revision, "include=s" => \@filelist, "exclude=s" => \@exfilelist ); #explode the supplied list to our array @filelist = split(/,/,join(',',@filelist)); @exfilelist = split(/,/,join(',',@exfilelist)); #any command specified? if (!$cvsupdate && !$makelive && !$show_help) { print "No action specified, try channel --help\n\n"; exit; } # Show help? #------------------------------------------------- if ($show_help) { #print "arg is ". $ARGV[0]."\n"; print <) { if (/REVISIONS\['(.*?)'\]=(\d+)/) { $revs{$1} = $2; } } close (CODE); } foreach (@files) { (my $url = $_) =~ s/public_html//; print "checking revision for: $url"; $data = `svn info /var/www/channel_svn/$_ | grep "Last Changed Rev"`; if ($data =~ /: (\d+)/) { $revs{$url} = $1; print " :: $1\n"; } else { $revs{$url} = 1; print " :: unknown\n"; } } print "\n"; open (OUT, ">$folder/libs/conf/revisions.conf.php"); print OUT ""; close (OUT); } ############################################################################ 1;