Added a couple command-line options.
authorWayne Davison <wayned@samba.org>
Wed, 20 Oct 2004 05:36:36 +0000 (05:36 +0000)
committerWayne Davison <wayned@samba.org>
Wed, 20 Oct 2004 05:36:36 +0000 (05:36 +0000)
verify-patches

index 29f48b3..8d2e8bd 100755 (executable)
@@ -1,6 +1,15 @@
 #!/usr/bin/perl
 
 use strict;
+use Getopt::Long;
+
+my($no_cvs, $minor_updates);
+
+&Getopt::Long::Configure('bundling');
+GetOptions(
+    'no-cvs|n' => \$no_cvs,
+    'minor-updates|u' => \$minor_updates,
+) or &usage;
 
 chdir('patches') if -d 'patches';
 
@@ -42,8 +51,10 @@ rsyncd.conf.5
 EOT
 close OUT;
 
-print "Using CVS to update the tmp/cvsdir copy of the source.\n";
-system qq|cvs -d "$root" co -d cvsdir rsync|;
+unless ($no_cvs) {
+    print "Using CVS to update the tmp/cvsdir copy of the source.\n";
+    system qq|cvs -d "$root" co -d cvsdir rsync|;
+}
 
 @ARGV = glob('../*.diff') unless @ARGV;
 
@@ -74,6 +85,7 @@ foreach my $diff (@ARGV) {
     if ($default =~ s/^D,// || $default eq 'N') {
        my $def = generate_new_patch($diff);
        $default = 'U,N' if $default eq 'N' && $def eq 'E';
+       $default = 'N' if !$minor_updates && $default eq 'U,N';
     }
 
     PROMPT:
@@ -261,3 +273,12 @@ sub restore_cvsdir
        }
     }
 }
+
+sub usage
+{
+    die <<EOT;
+Usage: $0 [OPTS] [DIFF-FILE...]
+ -n, --no-cvs          Don't update tmp/cvsdir at the start of the run
+ -u, --minor-updates   Suggest 'U' for even minor changes in the diff
+EOT
+}