aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorJoerg Wunsch <joerg@FreeBSD.org>1995-07-23 17:34:00 +0000
committerJoerg Wunsch <joerg@FreeBSD.org>1995-07-23 17:34:00 +0000
commit37e0d97047b43ddc0a42b48d0a5b9f82dad260c9 (patch)
tree6146689699f7d65608631053dc6b62998d85b458 /gnu
parentfb2deeabfba13e8eb0c814e36dd686e9e8587593 (diff)
Notes
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/cvs/contrib/easy-import.perl51
-rw-r--r--gnu/usr.bin/cvs/contrib/easy-import.pl51
2 files changed, 74 insertions, 28 deletions
diff --git a/gnu/usr.bin/cvs/contrib/easy-import.perl b/gnu/usr.bin/cvs/contrib/easy-import.perl
index 59d407a913d1..fb3ad03a01df 100644
--- a/gnu/usr.bin/cvs/contrib/easy-import.perl
+++ b/gnu/usr.bin/cvs/contrib/easy-import.perl
@@ -8,6 +8,7 @@
#
# Written by Jörg Wunsch, 95/03/07, and placed in the public domain.
#
+# $Id$
require "complete.pl";
require "getopts.pl";
@@ -15,15 +16,24 @@ require "getopts.pl";
sub scan_opts
{
- &Getopts("n");
+ local($status);
- $dont_do_it = "-n" if $opt_n;
+ $status = &Getopts("nv");
- die "usage: $0 [-n] [moduledir]\n" .
- " -n: don't do any commit, show only\n"
- unless $#ARGV <= 0;
+ $dont_do_it = "-n" if $opt_n;
+ if($opt_v) {
+ print STDERR '$Source$ $Revision$' . "\n"; # 'emacs kludge
+ exit 0;
+ }
+ die "usage: $0 [-v] [-n] [moduledir]\n" .
+ " -n: don't do any commit, show only\n" .
+ " -v: show program version\n"
+ unless $status && $#ARGV <= 0;
- $moduledir = $ARGV[0] if $#ARGV == 0;
+ if($#ARGV == 0) {
+ $moduledir = $ARGV[0];
+ shift;
+ }
}
sub lsdir
@@ -172,8 +182,25 @@ sub lsmodules
sub checktag
{
# check a given string for tag rules
- local($s) = @_;
- return 0 if($s !~ /^[A-Za-z][A-Za-z0-9_]*$/);
+ local($s, $name) = @_;
+ local($regexp);
+
+ if($name eq "vendor") { $regexp = '^[A-Z][A-Z0-9_]*$'; }
+ elsif($name eq "release") { $regexp = '^[a-z][a-z0-9_]*$'; }
+ else {
+ print STDERR "Internal error: unknown tag name $name\n";
+ exit(2);
+ }
+
+ if($s !~ /$regexp/) {
+ print "\a${us}Valid $name tags must match the regexp " .
+ "$regexp.${ue}\n";
+ return 0;
+ }
+ if($s =~ /^RELENG/) {
+ print "\a${us}Tags must not start with the word \"RELENG\".${ue}\n";
+ return 0;
+ }
return 1;
}
@@ -288,9 +315,7 @@ for(;;) {
$| = 0;
$vtag = <>;
chop $vtag;
- last if &checktag($vtag);
- print "\a${us}Valid tags must match the regexp " .
- "^[A-Za-z][A-Za-z0-9_]*\$.${ue}\n";
+ last if &checktag($vtag, "vendor");
}
for(;;) {
@@ -299,9 +324,7 @@ for(;;) {
$| = 0;
$rtag = <>;
chop $rtag;
- last if &checktag($rtag);
- print "\a${us}Valid tags must match the regexp " .
- "^[A-Za-z][A-Za-z0-9_]*\$.${ue}\n";
+ last if &checktag($rtag, "release");
}
diff --git a/gnu/usr.bin/cvs/contrib/easy-import.pl b/gnu/usr.bin/cvs/contrib/easy-import.pl
index 59d407a913d1..fb3ad03a01df 100644
--- a/gnu/usr.bin/cvs/contrib/easy-import.pl
+++ b/gnu/usr.bin/cvs/contrib/easy-import.pl
@@ -8,6 +8,7 @@
#
# Written by Jörg Wunsch, 95/03/07, and placed in the public domain.
#
+# $Id$
require "complete.pl";
require "getopts.pl";
@@ -15,15 +16,24 @@ require "getopts.pl";
sub scan_opts
{
- &Getopts("n");
+ local($status);
- $dont_do_it = "-n" if $opt_n;
+ $status = &Getopts("nv");
- die "usage: $0 [-n] [moduledir]\n" .
- " -n: don't do any commit, show only\n"
- unless $#ARGV <= 0;
+ $dont_do_it = "-n" if $opt_n;
+ if($opt_v) {
+ print STDERR '$Source$ $Revision$' . "\n"; # 'emacs kludge
+ exit 0;
+ }
+ die "usage: $0 [-v] [-n] [moduledir]\n" .
+ " -n: don't do any commit, show only\n" .
+ " -v: show program version\n"
+ unless $status && $#ARGV <= 0;
- $moduledir = $ARGV[0] if $#ARGV == 0;
+ if($#ARGV == 0) {
+ $moduledir = $ARGV[0];
+ shift;
+ }
}
sub lsdir
@@ -172,8 +182,25 @@ sub lsmodules
sub checktag
{
# check a given string for tag rules
- local($s) = @_;
- return 0 if($s !~ /^[A-Za-z][A-Za-z0-9_]*$/);
+ local($s, $name) = @_;
+ local($regexp);
+
+ if($name eq "vendor") { $regexp = '^[A-Z][A-Z0-9_]*$'; }
+ elsif($name eq "release") { $regexp = '^[a-z][a-z0-9_]*$'; }
+ else {
+ print STDERR "Internal error: unknown tag name $name\n";
+ exit(2);
+ }
+
+ if($s !~ /$regexp/) {
+ print "\a${us}Valid $name tags must match the regexp " .
+ "$regexp.${ue}\n";
+ return 0;
+ }
+ if($s =~ /^RELENG/) {
+ print "\a${us}Tags must not start with the word \"RELENG\".${ue}\n";
+ return 0;
+ }
return 1;
}
@@ -288,9 +315,7 @@ for(;;) {
$| = 0;
$vtag = <>;
chop $vtag;
- last if &checktag($vtag);
- print "\a${us}Valid tags must match the regexp " .
- "^[A-Za-z][A-Za-z0-9_]*\$.${ue}\n";
+ last if &checktag($vtag, "vendor");
}
for(;;) {
@@ -299,9 +324,7 @@ for(;;) {
$| = 0;
$rtag = <>;
chop $rtag;
- last if &checktag($rtag);
- print "\a${us}Valid tags must match the regexp " .
- "^[A-Za-z][A-Za-z0-9_]*\$.${ue}\n";
+ last if &checktag($rtag, "release");
}