diff options
author | Renato Botelho <garga@FreeBSD.org> | 2006-05-16 15:44:29 +0000 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2006-05-16 15:44:29 +0000 |
commit | 3cf8cfc8cd44efecd519c30e8e1e67e02ca422ef (patch) | |
tree | 104c31e40815ebb6544035da877fddc9930c0b7a /Tools/scripts/modulesupdate | |
parent | - Update to 1.1 (diff) |
- 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)
Notes
Notes:
svn path=/head/; revision=162578
Diffstat (limited to 'Tools/scripts/modulesupdate')
-rwxr-xr-x | Tools/scripts/modulesupdate | 34 |
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"; |