Bug 41121 - print/acroread5: 2 sed_inplace problems
Summary: print/acroread5: 2 sed_inplace problems
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Trevor Johnson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-29 13:40 UTC by KOMATSU Shinichiro
Modified: 2002-08-19 20:20 UTC (History)
0 users

See Also:


Attachments
file.diff (591 bytes, patch)
2002-07-29 13:40 UTC, KOMATSU Shinichiro
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description KOMATSU Shinichiro 2002-07-29 13:40:02 UTC
o sed_inplace's -i option must take an argument. 
  According to -current's man page of sed(1),

    -i extension
        Edit files in-place, saving backups with the specified extension.
	If a zero-length extension is given, no backup will be saved.

  If no argument is supplied to -i, eg. 

      sed_inplace -i -E 's:Linux):FreeBSD|Linux):g' ${WRKDIR}/INSTALL

  backup file ${WRKDIR}/INSTALL-E is created.
  So, $REINPLACE_ARGS must be -i '' instead of just -i.

o Because sed_inplace -i has a problem with read-only files,
  write permission bit must be set to target file.

How-To-Repeat: 
Run make as a normal (non-root) user:

    % make
    ......(snip)......
    ===>  Configuring for acroread-5.06
    /usr/local/bin/sed_inplace -i -E 's:Linux):FreeBSD|Linux):g' /usr/local/ports/print/acroread5/work/INSTALL
    sed_inplace: stdout: Bad file descriptor
    *** Error code 1

    Stop in /usr/local/ports/print/acroread5.

This is the second problem.

If make intall is run as root, the second problem does not occur,
but an extra file /usr/local/Acrobat5/bin/acroread-E is created.
This is the first problem.
Comment 1 Christian Weisgerber freebsd_committer freebsd_triage 2002-07-29 21:30:13 UTC
Responsible Changed
From-To: freebsd-ports->trevor

over to maintainer
Comment 2 Trevor Johnson freebsd_committer freebsd_triage 2002-08-08 12:52:27 UTC
State Changed
From-To: open->closed

committed with some changes--thank you
Comment 3 bradyn 2002-08-19 19:31:29 UTC
Just spotted this today.  We're running 4.6-STABLE, with freshly
cvsupped ports tree (i.e.  r1.42 of print/acroread/Makefile).

I'm not sure if I'm seeing a problem here (not knowing sed_inplace
;-), but as the "-i" argument to ${REINPLACE_ARGS} was removed
between 1.41, and 1.42, the "make install" stage doesn't patch the
installed file.

The patch below seems to fix it for me, using either sed_inplace, or
pure sed, on STABLE.

However, if there's some newer version of sed_inplace out there,
that doesn't require the "-i" argument, then REINPLACE_ARGS might
want to be made part of a conditional which tests for ${OSVERSION},
similar to that used in bsd.port.mk for REINPLACE_CMD (as I'm
buggered if I know how to make conditionals work with multi-word
strings in BSD make ;-)

[also minor nit fixed with  an extraneous "-E" argument].

-- 
	Niall



--- Makefile.orig	Mon Aug 19 19:00:44 2002
+++ Makefile	Mon Aug 19 19:04:15 2002
@@ -21,7 +21,7 @@
 
 USE_LINUX=	yes
 USE_REINPLACE=	yes
-REINPLACE_ARGS=	-E
+REINPLACE_ARGS=	-i '' -E
 NO_FILTER_SHLIBS=	yes
 
 .if ${ARCH} == "i386"
@@ -44,7 +44,7 @@
 	${REINPLACE_CMD} 's:Linux):FreeBSD|Linux):g' ${PREFIX}/Acrobat5/bin/acroread
 	-@/compat/linux/usr/bin/strip ${PREFIX}/Acrobat5/Reader/intellinux/bin/acroread
 	@brandelf -t Linux ${PREFIX}/Acrobat5/Reader/intellinux/bin/acroread
-	${REINPLACE_CMD} -E 's:OSF1):FreeBSD|OSF1):g' ${PREFIX}/Acrobat5/bin/acroread
+	${REINPLACE_CMD} 's:OSF1):FreeBSD|OSF1):g' ${PREFIX}/Acrobat5/bin/acroread
 	@cd ${PREFIX}/Acrobat5/bin && \
 	  ${INSTALL_SCRIPT} ${PREFIX}/Acrobat5/bin/acroread \
 	     ${PREFIX}/bin/acroread5
Comment 4 Trevor Johnson 2002-08-19 20:17:40 UTC
Niall Brady wrote:

>  --- Makefile.orig	Mon Aug 19 19:00:44 2002
>  +++ Makefile	Mon Aug 19 19:04:15 2002
>  @@ -21,7 +21,7 @@
>
>   USE_LINUX=	yes
>   USE_REINPLACE=	yes
>  -REINPLACE_ARGS=	-E
>  +REINPLACE_ARGS=	-i '' -E
>   NO_FILTER_SHLIBS=	yes
>
>   .if ${ARCH} == "i386"
>  @@ -44,7 +44,7 @@
>   	${REINPLACE_CMD} 's:Linux):FreeBSD|Linux):g' ${PREFIX}/Acrobat5/bin/acroread
>   	-@/compat/linux/usr/bin/strip ${PREFIX}/Acrobat5/Reader/intellinux/bin/acroread
>   	@brandelf -t Linux ${PREFIX}/Acrobat5/Reader/intellinux/bin/acroread
>  -	${REINPLACE_CMD} -E 's:OSF1):FreeBSD|OSF1):g' ${PREFIX}/Acrobat5/bin/acroread
>  +	${REINPLACE_CMD} 's:OSF1):FreeBSD|OSF1):g' ${PREFIX}/Acrobat5/bin/acroread
>   	@cd ${PREFIX}/Acrobat5/bin && \
>   	  ${INSTALL_SCRIPT} ${PREFIX}/Acrobat5/bin/acroread \
>   	     ${PREFIX}/bin/acroread5

Thank you for the patch.  I have applied it.
-- 
Trevor Johnson