summaryrefslogtreecommitdiff
path: root/Tools/scripts/modulesupdate
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/scripts/modulesupdate')
-rwxr-xr-xTools/scripts/modulesupdate34
1 files changed, 21 insertions, 13 deletions
diff --git a/Tools/scripts/modulesupdate b/Tools/scripts/modulesupdate
index bc01ae37720e..c5a0bbce1f37 100755
--- a/Tools/scripts/modulesupdate
+++ b/Tools/scripts/modulesupdate
@@ -39,28 +39,39 @@ sub lsmodules
%rv = ();
- open(CVS, "cvs -R co -c|") || die "cvs: $!";
+ print "Checking out the modules database...\n";
+ system("cvs -R co modules") && die "failed.\n";
+
+ my $start_read = 0;
+
+ open(CVS, "<modules/modules") || die "$!";
while(<CVS>) {
- chomp;
- chomp;
- ($mname,$mpath) = split;
- next if $mname eq "";
- $rv{$mname} = $mpath;
+ if (/!!MERGE!!/g) {
+ $start_read = 1;
+ }
+
+ if ($start_read && /^[^ #]/) {
+ chomp;
+ chomp;
+ ($mname,$mpath) = split;
+ next if $mname eq "";
+ $rv{$mname} = $mpath;
+ }
}
close(CVS);
return %rv;
}
+$tmpdir=`mktemp -d -t mu`;
+chomp $tmpdir;
+chdir $tmpdir or die "$tmpdir: $!";
+
my %cvsmods = &lsmodules;
my $modulename = shift;
my $modulepath = shift;
my $dont_do_it = "";
-$tmpdir=`mktemp -d -t mu`;
-chomp $tmpdir;
-chdir $tmpdir or die "$tmpdir: $!";
-
if ($modulepath eq "") {
print "Error: Must specify both modulename and modulepath\n";
&goodbye(1);
@@ -88,9 +99,6 @@ if ($mod eq "") {
$cmd = "/^" . $mod . "[ \t]/\ni\n";
}
-print "Checking out the modules database...\n";
-system("cvs -R co modules") && die "failed.\n";
-
my $len = length($modulename);
print "Inserting new module...\n";
open(ED, "|ed modules/modules") || die "Cannot start ed\n";