diff options
author | will <will@FreeBSD.org> | 2000-12-30 10:20:13 +0800 |
---|---|---|
committer | will <will@FreeBSD.org> | 2000-12-30 10:20:13 +0800 |
commit | 42824d455ce32071c412a207a0b760c3d3299388 (patch) | |
tree | 00acbd396bd7c36015cd754b00c6fb0bb0112001 /Tools | |
parent | 0021f5e479e322149551265c412519e15bb03402 (diff) | |
download | freebsd-ports-gnome-42824d455ce32071c412a207a0b760c3d3299388.tar.gz freebsd-ports-gnome-42824d455ce32071c412a207a0b760c3d3299388.tar.zst freebsd-ports-gnome-42824d455ce32071c412a207a0b760c3d3299388.zip |
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.
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/scripts/addport | 26 |
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 |