HELP! nvidia-driver patch: Weird REPLACE_CMD and command-line-sed behaviour. HELP!
O. Hartmann
ohartman at zedat.fu-berlin.de
Tue Sep 10 14:26:18 UTC 2013
On Tue, 10 Sep 2013 08:16:18 -0600
John Hein <jhein at symmetricom.com> wrote:
> O. Hartmann wrote at 01:51 +0200 on Sep 10, 2013:
> > sed -i -e 's/\(\&virtual_address, size,\) \(VMFS_ANY_SPACE,\)$/ \
> > \1 0, \2/' work/NVIDIA-FreeBSD-x86_64-325.15/src/nvidia_subr.c
>
> In a makefile shell command, you have to escape $ signs
> if you want them to be used as $ signs in the shell context.
>
> .
> .
> > But putting the very same
> > sed-expression into the port's Makefile
> >
> > # Changes in vm_map_find() due to r255426
> > ..if ${OSVERSION} > 1000053
> > ${REINPLACE_CMD} -e 's/\(\&virtual_address, size,\) \
> > \(VMFS_ANY_SPACE,\)$/\1 0, \2/' \
> > \ ${WRKSRC}/src/nvidia_subr.c
> > ..endif
> >
> > (patch attached) gives this weird error:
> >
> > ===> Cleaning for nvidia-driver-325.15
> > ===> License NVIDIA accepted by the user
> > ===> Found saved configuration for nvidia-driver-325.08_1
> > ===> nvidia-driver-325.15 depends on file: /usr/local/sbin/pkg -
> > found ===> Fetching all distfiles required by nvidia-driver-325.15
> > for building ===> Extracting for nvidia-driver-325.15
> > => SHA256 Checksum OK for NVIDIA-FreeBSD-x86_64-325.15.tar.gz.
> > ===> Patching for nvidia-driver-325.15
> > sed: 1: "s/\(\&virtual_address, ...": unescaped newline inside
> > substitute pattern *** Error code 1
>
>
> make(1) evaluates $/ - which is likely empty which is why sed doesn't
> see the end of the expression before the newline. Hence the
> weird error (not so weird once it's understood).
>
> You want to use $$/ instead of $/ :
>
> .if ${OSVERSION} > 1000053
> ${REINPLACE_CMD} -e 's/\(\&virtual_address, size,\) \
> \(VMFS_ANY_SPACE,\)$$/\1 0, \2/' \
> \ ${WRKSRC}/src/nvidia_subr.c
> .endif
if things are understood, there s nothing scaring. Thanks, I didn't
realize that even the expression inside '' is eavluated by make.
Thanks to you I could provide the patch to my PR. Hopefuilly, there is
a committer soon.
Oliver
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20130910/a3ff18e5/attachment.sig>
More information about the freebsd-ports
mailing list