ports/140364: ports-mgmt/portupgrade-devel: #! line substitution is broken
Akinori MUSHA
knu at FreeBSD.org
Sat Nov 7 18:10:03 UTC 2009
Note: There was a bad value `non-critical<[' for the field `>Severity:'.
It was set to the default value of `serious'.
>Number: 140364
>Category: ports
>Synopsis: ports-mgmt/portupgrade-devel: #! line substitution is broken
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Nov 07 18:10:02 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: "Akinori MUSHA" <knu at FreeBSD.org>
>Release: FreeBSD 7.2-STABLE amd64
>Organization:
N/A
>Environment:
FreeBSD daemon.musha.org 7.2-STABLE FreeBSD 7.2-STABLE #10: Mon Sep 28 01:42:28 JST 2009 root at daemon.musha.org:/var/cache/obj/usr/src/sys/DAEMON amd64
>Description:
#! line substitution in portupgrade-devel is broken.
>How-To-Repeat:
Install portupgrade-devel and run `head -n1 /usr/local/sbin/portupgrade'.
If it shows `#!/usr/bin/env ruby', the line has not been properly processed.
>Fix:
sub() is not equivalent to $_.sub() but $_.sub!().
Just back out the modification as follows:
--- bin/Makefile.orig 2008-07-17 09:26:38.000000000 +0900
+++ bin/Makefile 2009-11-08 02:31:36.000000000 +0900
@@ -28,7 +28,7 @@ ${script}: ${script:T}
${RUBY} -pe ' \
if $$. == 1; \
if /^#!/; \
- $$_.sub(/^#!\s*\S*(\benv\s+)?\bruby/, "#!${RUBY}"); \
+ sub /^#!\s*\S*(\benv\s+)?\bruby/, "#!${RUBY}"; \
else; \
$$_ = "#!${RUBY}\n" + $$_; \
end; \
Or use the destructive method:
--- bin/Makefile.orig 2008-07-17 09:26:38.000000000 +0900
+++ bin/Makefile 2009-11-08 02:31:36.000000000 +0900
@@ -28,7 +28,7 @@ ${script}: ${script:T}
${RUBY} -pe ' \
if $$. == 1; \
if /^#!/; \
- $$_.sub(/^#!\s*\S*(\benv\s+)?\bruby/, "#!${RUBY}"); \
+ $$_.sub!(/^#!\s*\S*(\benv\s+)?\bruby/, "#!${RUBY}"); \
else; \
$$_ = "#!${RUBY}\n" + $$_; \
end; \
--
Akinori MUSHA / http://akinori.org/
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list