X-Git-Url: https://git.donarmstrong.com/?p=bin.git;a=blobdiff_plain;f=sa;h=acf37dff3827ffc7d70ba98c366fa8920d2e39c0;hp=6cacfda6cfebffdf09e8090faefaae8dd5fec0d8;hb=HEAD;hpb=f64548d3ff79193a56831fdb5c1bd7296b877cc4 diff --git a/sa b/sa index 6cacfda..acf37df 100755 --- a/sa +++ b/sa @@ -46,7 +46,7 @@ Display this manual. -use User; +#use User; use IO::File; use vars qw($DEBUG $VERBOSE); @@ -56,9 +56,10 @@ my %options = (quick => 1, help => 0, man => 0, verbose => 0, + hooks_only => 0, ); -GetOptions(\%options,'quick|Q+','quiet|q!','debug|d+','help|h|?','man|m','verbose|v+'); +GetOptions(\%options,'quick|Q+','quiet|q!','debug|d+','help|h|?','man|m','verbose|v+','hooks_only|hooks-only'); pod2usage() if $options{help}; pod2usage({verbose=>2}) if $options{man}; @@ -92,13 +93,15 @@ sub parse_config_file { } } -my $HOME=User->Home; +my $HOME=$ENV{HOME}; my $HOSTNAME=qx(hostname); $HOSTNAME=~s/\n//g; my $CAN_IGNORE_EXTERNALS = 0; -qx(svn --version) =~ /\(r(\d+)\)/; -if ($1 > 13838) { - $CAN_IGNORE_EXTERNALS = 1; +if (not $options{hooks_only}) { + qx(svn --version) =~ /\(r(\d+)\)/; + if ($1 > 13838) { + $CAN_IGNORE_EXTERNALS = 1; + } } sub available_config_files{ @@ -127,8 +130,8 @@ else { } while (my ($repo,$run_after) = each(%repos)) { - if (-e "$repo/.svn") { - print "Checking [$repo]\n"; + print "Checking [$repo]\n"; + if (-e "$repo/.svn" and not $options{hooks_only}) { system('svn', $command, (not $VERBOSE and $options{quiet})?'-q':(), @@ -138,7 +141,7 @@ while (my ($repo,$run_after) = each(%repos)) { $repo, ); } - if ($command =~ /^up(?:date)|checkout$/) { + if ($command =~ /^up(?:date)?|checkout$/) { system('sh', '-c',"$run_after $repo") if defined $run_after and length $run_after; } }