From 3cf8cfc8cd44efecd519c30e8e1e67e02ca422ef Mon Sep 17 00:00:00 2001 From: Renato Botelho Date: Tue, 16 May 2006 15:44:29 +0000 Subject: - Change addport script to do the job locally instead connect to freefall every time to add a new module. If you want to still use old way, just use "-M freefall.FreeBSD.org" option - Take addport maintainership - When modulesupdate fail, ask user to retry - Change modulesupdate to work fine with addport Approved by: will (maintainer) --- Tools/scripts/modulesupdate | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'Tools/scripts/modulesupdate') 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, ") { - 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"; -- cgit v1.2.3