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/addport | |
parent | c332272201546c22a79ae8049930f8a2fc0274ee (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/addport')
-rwxr-xr-x | Tools/scripts/addport | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/Tools/scripts/addport b/Tools/scripts/addport index 351d9479f564..fc133d1ee3ec 100755 --- a/Tools/scripts/addport +++ b/Tools/scripts/addport @@ -34,7 +34,7 @@ # Id: addport,v 1.5 2000/04/22 22:19:43 mharo Exp (perl conversion) # $FreeBSD$ # -# MAINTAINER= will@FreeBSD.org +# MAINTAINER= garga@FreeBSD.org # use Cwd "abs_path"; @@ -53,6 +53,7 @@ sub usage(); sub contains($@); sub lsports(); sub lastcomment(); +sub addmodule($); my %opts; @@ -98,6 +99,7 @@ my $sshmod; if( !defined $ENV{"CVS_RSH"} ) { $ENV{CVS_RSH} = "ssh"; } +my $portsdir = $ENV{PORTSDIR} ? $ENV{PORTSDIR} : '/usr/ports'; my $make = "make"; my $portlint = `which portlint`; chomp $portlint; my $plint_args = "-N -a -c -t"; @@ -105,6 +107,7 @@ my $perl = "perl"; my $cp = "cp"; my $mv = "mv"; my $rm = "rm"; +my $modulesupdate = ( -f "/usr/local/bin/modulesupdate" ? "/usr/local/bin/modulesupdate" : "$portsdir/Tools/scripts/modulesupdate" ); # vars required for commitfile my $descr; my $portversion; my $pkgcomment; my $tmp; my $pkgcommentlen; my $comment; my $orig; @@ -112,7 +115,7 @@ my $tmp2; my $offset; my $commitfile = ""; $tmp = $tmp2 = $offset = 0; chomp(my $myhost = lc(hostname())); -$moduleshost = "freefall.freebsd.org" if ($moduleshost eq ""); +$moduleshost = $myhost if ($moduleshost eq ""); # SSH is always required nowadays... pcvs.FreeBSD.org isn't shell accessible. $ssh = "$ENV{CVS_RSH} $h -l $u"; @@ -358,9 +361,7 @@ foreach my $thisdir (@dirs) { chdir "$tmpdir/$category" or err(1, "$tmpdir/$category"); system("$cvs $n ci $commitfile Makefile $portname") && errx(1, "cvs commit failed, aborting."); if (!$nomodules && ($n ne "-n")) { - print "*** If you have problems with the below modulesupdate command, PLEASE\n"; - print "*** ensure that you can login to $h from $moduleshost!\n"; - system("$sshmod env CVSROOT=$repo $perl /usr/local/bin/modulesupdate $module ports/$category/$portname") && errx(1, "adding port to modules failed, aborting."); + addmodule("$sshmod env CVSROOT=$repo $perl $modulesupdate $module ports/$category/$portname") && errx(1, "adding port to modules failed, aborting."); } } @@ -511,3 +512,15 @@ sub lastcomment() { } return $num; } + +# this adds the module +sub addmodule($) { + my ($command) = @_; + + print "*** If you have problems with the below modulesupdate command, PLEASE\n"; + print "*** ensure that you can login to $h from $moduleshost!\n"; + do { + system($command); + } while ( ($? != 0) && !prompt("Add module failed, retry? ") ); + return $?; +} |