diff options
author | shaun <shaun@FreeBSD.org> | 2006-07-14 09:49:35 +0800 |
---|---|---|
committer | shaun <shaun@FreeBSD.org> | 2006-07-14 09:49:35 +0800 |
commit | 9e979d82a841e583f05e187ca1627685b7ce05f2 (patch) | |
tree | 627774f5038c4fa19dd2550cfab381bbcd8eacb7 /Tools/scripts | |
parent | aeea29419dfaa41f392221f2a682127591c9efbb (diff) | |
download | freebsd-ports-gnome-9e979d82a841e583f05e187ca1627685b7ce05f2.tar.gz freebsd-ports-gnome-9e979d82a841e583f05e187ca1627685b7ce05f2.tar.zst freebsd-ports-gnome-9e979d82a841e583f05e187ca1627685b7ce05f2.zip |
Add an option to the addport script: -b requests that any files in
${FILESDIR} which look like patches be treated as binary files. This
prevents RCS tags in patch fragments causing a problem for CVS.
Approved by: garga (maintainer),
ahze (mentor, implicit)
Diffstat (limited to 'Tools/scripts')
-rwxr-xr-x | Tools/scripts/addport | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/Tools/scripts/addport b/Tools/scripts/addport index e7c6aa863b29..d931807bc90a 100755 --- a/Tools/scripts/addport +++ b/Tools/scripts/addport @@ -57,12 +57,13 @@ sub addmodule($); my %opts; -getopts('ac:d:fgh:il:L:M:mns:tu:', \%opts); +getopts('abc:d:fgh:il:L:M:mns:tu:', \%opts); my $autofill_l = $opts{'l'}; my $autofill_L = $opts{'L'}; my $autofill = ($autofill_l ? $autofill_l : $autofill_L); my $c = $opts{'c'} if ($opts{'c'} ne ""); +my $binfiles = $opts{'b'}; my $nomodules = $opts{'g'}; my $distdir = $opts{'s'} if ($opts{'s'} ne ""); my $dir = $opts{'d'}; @@ -321,7 +322,23 @@ foreach my $thisdir (@dirs) { chdir $category or err(1,"$category"); system("$cp -PRp $thisdir ."); system("$cvs $n add `find $portname -type d | grep -v CVS`") && errx(1, "cvs add for dirs failed, aborting."); - system("$cvs $n add `find $portname -type f | grep -v CVS`") && errx(1, "cvs add for files failed, aborting."); + + my $gotfiles = 0; + if ($binfiles) { + if (-d "$portname/files") { + my (@pf, $fd); + opendir($fd, "$portname/files") and + @pf = grep { /^.*patch-.*$/ } readdir($fd); + $gotfiles = ++$#pf; + } + } + + if ($binfiles && $gotfiles > 0) { + system("$cvs $n add `find $portname -type f | grep -v CVS | grep -v '^$portname/files/.*patch-.*'`") && errx(1, "cvs add for files failed, aborting."); + system("$cvs $n add -ko `find $portname -type f | grep -v CVS | grep '^$portname/files/.*patch-.*'`") && errx(1, "cvs add for files failed, aborting."); + } else { + system("$cvs $n add `find $portname -type f | grep -v CVS`") && errx(1, "cvs add for files failed, aborting."); + } # figure out where the port name belongs in category Makefile my @ports = &lsports; @@ -417,7 +434,7 @@ authors: <will\@FreeBSD.org>, <mharo\@FreeBSD.org> SYNOPSIS $0 [-c commitfile] [-h host] [-l PR number] [-s distdir] [-u user] - [-afgimnt] -d directory + [-abfgimnt] -d directory Where "directory" contains the comma-delimited list of root directories of new ports that you wish to @@ -427,6 +444,8 @@ SYNOPSIS OPTIONS -a Perform checks on the port to make sure there are no problems. Recommended. + -b Add all patch-* files in \${FILESDIR} as binary + files (i.e. don't expand CVS tags) -c file Use file in place of normal log message. -f Do not fetch the distfile. -g Do not commit to CVSROOT/modules. |