I do not know if this is PERL version dependent but I have had to add a minor patch to cvsweb.cgi for some time. I updated an existing patch file which I have included below. I am currently running PERL 5.20. Here is my error without the additional patch: Docs# perl -c cvsweb.cgi "my" variable $tmp masks earlier declaration in same statement at cvsweb.cgi line 1338. syntax error at cvsweb.cgi line 1195, near "$v qw(hidecvsroot hidenonreadable)" Global symbol "$v" requires explicit package name at cvsweb.cgi line 1197. Global symbol "$v" requires explicit package name at cvsweb.cgi line 1197. syntax error at cvsweb.cgi line 1276, near "}" (Might be a runaway multi-line << string starting on line 1267) syntax error at cvsweb.cgi line 1289, near "}" syntax error at cvsweb.cgi line 1295, near "}" syntax error at cvsweb.cgi line 1302, near "}" syntax error at cvsweb.cgi line 1312, near "}" syntax error at cvsweb.cgi line 1336, near "}" syntax error at cvsweb.cgi line 1338, near ""$tmp,v" }" cvsweb.cgi has too many errors. Docs# With the patch: Docs# perl -c cvsweb.cgi defined(@array) is deprecated at cvsweb.cgi line 2954. (Maybe you should just omit the defined()?) cvsweb.cgi syntax OK --- ./cvsweb.cgi.orig 2005-09-25 14:28:51.000000000 -0600 +++ ./cvsweb.cgi 2014-08-16 14:21:37.000000000 -0600 @@ -1,4 +1,4 @@ -#!/usr/bin/perl -T +#!!!PERL!! -wT # # cvsweb - a CGI interface to CVS trees. # @@ -214,7 +214,7 @@ # == EDIT this == # Locations to search for user configuration, in order: -for (catfile($mydir, 'cvsweb.conf'), '/usr/local/etc/cvsweb/cvsweb.conf') { +for (catfile($mydir, 'cvsweb.conf'), '!!PREFIX!!/etc/cvsweb/cvsweb.conf') { if (-r $_) { $config = $_; last; @@ -1192,7 +1192,7 @@ <legend>General options</legend> <input type="hidden" name="copt" value="1" /> EOF - for my $v qw(hidecvsroot hidenonreadable) { + for my $v (qw(hidecvsroot hidenonreadable)) { printf(qq{<input type="hidden" name="%s" value="%s" />\n}, $v, $input{$v} || 0); }
1) you want to attach patches, not put them in comments 2) There is a standard fix for perl shebangs. It's called "USES=shebangfile" and it's partner is SHEBANG_FILES= <list of files relative to WRKSRC> You can read about it in Mk/Uses/shebangfix.mk or just grep and category, you'll find plenty of examples. The other changes are best done with ${REINPLACE_CMD} I suspect.
(In reply to John Marino from comment #1) > The other changes are best done with ${REINPLACE_CMD} I suspect. you still need a patch for that qw fix though...
(In reply to John Marino from comment #1) > 1) you want to attach patches, not put them in comments Noted. > 2) There is a standard fix for perl shebangs. It's called > "USES=shebangfile" and it's partner is SHEBANG_FILES= <list of files > relative to WRKSRC> > > You can read about it in Mk/Uses/shebangfix.mk or just grep and category, > you'll find plenty of examples. > The shebang part of the patch is from the original patch. I simply updated the patch. > The other changes are best done with ${REINPLACE_CMD} I suspect.
(In reply to Dennis Glatting from comment #3) > The shebang part of the patch is from the original patch. I simply updated > the patch. I'm not following, it says you added "#!!!PERL!! -wT" which I assume !!PERL!! is replaced inline. Why don't you attach what the patch to the port should be to eliminate this confusion? Or is this it?
Created attachment 145884 [details] Previously proposed patch file.
(In reply to John Marino from comment #4) > (In reply to Dennis Glatting from comment #3) > > The shebang part of the patch is from the original patch. I simply updated > > the patch. > > I'm not following, it says you added "#!!!PERL!! -wT" which I assume > !!PERL!! is replaced inline. > > Why don't you attach what the patch to the port should be to eliminate this > confusion? Or is this it? Second try on a reply... I am not the maintainer and someone else updated the port for StageDir. I simply tried to keep my changes to a minimum. I recreated the patch file from "make makepatch". !!PERL!! and !!CVSROOT!! is part of the existing patch files. For !!PERL!! the unaltered code contains: #!/usr/bin/perl -T Why the alteration in patch files and subsequent alteration in the Makefile? Dunno. Wasn't there.
okay, so now we're back to the beginning. 1. this port is not staged, it will be deleted in 2 weeks 2. That post-patch thing with !!PERL!! is redundant to shebangfix. The rest of the patch can be handled with REINPLACE_CMD. however, unless #1 is solved, there's no point to this PR. it be obsolete.
(In reply to John Marino from comment #7) > okay, so now we're back to the beginning. > > 1. this port is not staged, it will be deleted in 2 weeks > 2. That post-patch thing with !!PERL!! is redundant to shebangfix. The rest > of the patch can be handled with REINPLACE_CMD. > > > however, unless #1 is solved, there's no point to this PR. it be obsolete. I use this port for Sarbanes-Oxley compliance. Specifically, my router and switch configurations are managed under RANCID where the diffs are made visible through a web interface using this port. Once, maybe twice, a year the auditors pull up the web page, click one or two things (I suspect without looking at content), then check the box. For me this is useful. The port has a number of problems, such as failing "make check-orphans" and portlint. I don't have a problem updating this port unless there is something better.
hmm, wait, this port is staged. I must have been looking at an older tree. some of what I said is still true I think.
(In reply to Dennis Glatting from comment #8) > I use this port for Sarbanes-Oxley compliance. Specifically, my router and > switch configurations are managed under RANCID where the diffs are made > visible through a web interface using this port. Once, maybe twice, a year > the auditors pull up the web page, click one or two things (I suspect > without looking at content), then check the box. For me this is useful. It's a moot point because it is staged, but had it not been staged, this wouldn't have mattered. Raising a hand with, "but I use it!" wouldn't stop the reaper. Only a PR staging it would. > The port has a number of problems, such as failing "make check-orphans" and > portlint. > > I don't have a problem updating this port unless there is something better. Actually I ran it through poudriere and it passes everything. But that post-patch command can be replace such that no patch is needed at all.
I'll take this. As-is it's not "patch-ready", there's a better way to fix this.
A commit references this bug: Author: marino Date: Sun Aug 17 00:30:19 UTC 2014 New revision: 365145 URL: http://svnweb.freebsd.org/changeset/ports/365145 Log: devel/cvsweb3: Update cvsweb3.cgi for newer versions of perl Remove patch to cvsweb3.cgi and implement all the necessary changes only with sed which is already being used and shebangfix. This change to the qw line is needed for the recent versions of perl. PR: 192712 Submitted by: Dennis Glatting Approved by: Just Fix It Changes: head/devel/cvsweb3/Makefile head/devel/cvsweb3/files/patch-cvsweb.cgi
okay, done.
(In reply to John Marino from comment #13) > okay, done. Thank you.