summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorWill Andrews <will@FreeBSD.org>2000-12-30 02:20:13 +0000
committerWill Andrews <will@FreeBSD.org>2000-12-30 02:20:13 +0000
commit51dc79714d62c98c930b06e5904c95d414eba891 (patch)
tree447c26a8ea560df62011c1ea924e77e69c0f5185 /Tools
parentAdd liblug 1.0.6, a very clean graphic library which can handle gif, pcx, targa, (diff)
Add new option: -c file : Pass a file containing the log message for the
new port. Slight hack used to obtain absolute path for the file. I'll probably change that to make it copy the file to the tmpdir instead. For now, this provides a stepping stone to use to begin automating commit log messages - with, of course, a chance to edit the file again.
Notes
Notes: svn path=/head/; revision=36452
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/addport26
1 files changed, 23 insertions, 3 deletions
diff --git a/Tools/scripts/addport b/Tools/scripts/addport
index 101f6e952e62..711acbcbf0cb 100755
--- a/Tools/scripts/addport
+++ b/Tools/scripts/addport
@@ -44,8 +44,9 @@ use strict;
my %opts;
-getopts('ad:fgh:imns:tu:', \%opts);
+getopts('ac:d:fgh:imns:tu:', \%opts);
+my $c = $opts{'c'} if ($opts{'c'} ne "");
my $nomodules = $opts{'g'};
my $distdir = $opts{'s'} if ($opts{'s'} ne "");
my $dir = $opts{'d'};
@@ -86,6 +87,24 @@ if ($myhost ne lc($h)) {
$repo = "$ENV{CVSROOT}" if $ENV{CVSROOT};
my $cvs = "cvs -d $repo";
+# Do commitfile checking.
+my $commitfile = "";
+# first check for relative paths then skip absolute, then add it to filenames.
+if ($c =~ m,.*/,) {
+ $c = "$currentdir/$c";
+} elsif ($c =~ m,/,) {
+ # do nothing
+} else {
+ # assume user passed something like "file"
+ $c = "$currentdir/$c";
+}
+if (-f $c) {
+ $commitfile = "EDITOR=\"cp $c\"";
+ print "\nRemember, you asked to use a commit file to read for the commit log.\n";
+ print "This means you'll get a message saying the log message was unchanged or\n";
+ print "not specified. Just tell it to continue and it will be committed.\n\n";
+}
+
# stuff that always happens when we start
BEGIN {
$tmpdir=`mktemp -d -t ap`;
@@ -235,7 +254,7 @@ foreach my $thisdir (@dirs) {
# commit the actual port.
chdir "$tmpdir/$category" or err(1, "$tmpdir/$category");
- system("$cvs $n ci Makefile $portname") && errx(1, "cvs commit failed, aborting.");
+ system("$commitfile $cvs $n ci Makefile $portname") && errx(1, "cvs commit failed, aborting.");
if (!$nomodules) {
system("$ssh $perl /usr/local/bin/modulesupdate $module ports/$category/$portname") && errx(1, "adding port to modules failed, aborting.");
}
@@ -290,7 +309,7 @@ print <<EOF;
authors: <will\@FreeBSD.org>, <mharo\@FreeBSD.org>
SYNOPSIS
- $0 [-h host] [-u user] [-s distdir] [-afimnt] -d directory
+ $0 [-h host] [-u user] [-s distdir] [-acfimnt] -d directory
Where "directory" contains the comma-delimited list
of root directories of new ports that you wish to
@@ -300,6 +319,7 @@ SYNOPSIS
OPTIONS
-a Perform checks on the port to make sure
there are no problems. Recommended.
+ -c file Use file in place of normal log message.
-f Do not fetch the distfile.
-h host Use a cvshost besides freefall.FreeBSD.org.
-i Interactive mode; allow more control over