]> git.donarmstrong.com Git - bin.git/blobdiff - sa
add reset usb bus command
[bin.git] / sa
diff --git a/sa b/sa
index 6772c51d0fdf5d4b6c9130fd08081a369a462a29..acf37dff3827ffc7d70ba98c366fa8920d2e39c0 100755 (executable)
--- a/sa
+++ b/sa
@@ -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};
@@ -96,9 +97,11 @@ 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;
      }
 }