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.
Responsible Changed From-To: freebsd-ports->trevor over to maintainer
State Changed From-To: open->closed committed with some changes--thank you
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
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