RHEL incompatibility in crosstool-ng build gdb native script

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

RHEL incompatibility in crosstool-ng build gdb native script

Michael Abbott-4
On line 180 of scripts/build/debug/300-gdb.sh we have the perfectly
reasonable command

        find "${CT_DEBUG_INSTALL_DIR}" -type f -name gdbserver \
            -exec rm -fv {} + 2>&1 |CT_DoLog ALL

Unfortunately it would seem that my version of find does not understand
the + separator, and for a successful build this needs to be replaced with
\; instead.

I seem to remember encountering this problem earlier, elsewhere in this
script.  Certainly this use of + is not necessary!


I'm building on Red Hat Enterprise Linux 4 (pretty old and hoary, but
that's the environment I'm stuck with here), and my find is GNU 4.1.20:

$ find --version
GNU find version 4.1.20
$

--
For unsubscribe information see http://sourceware.org/lists.html#faq

Reply | Threaded
Open this post in threaded view
|

Re: RHEL incompatibility in crosstool-ng build gdb native script

Martin Guy
>         find "${CT_DEBUG_INSTALL_DIR}" -type f -name gdbserver \
>             -exec rm -fv {} + 2>&1 |CT_DoLog ALL
>
>  Unfortunately it would seem that my version of find does not understand
>  the + separator, and for a successful build this needs to be replaced with
>  \; instead.
>
>  I seem to remember encountering this problem earlier, elsewhere in this
>  script.  Certainly this use of + is not necessary!

Or, to avoid running "rm" hundreds of times,
        -print | xargs -d\\n rm -fv 2>&1 | CT_DoLog ALL

    M

--
For unsubscribe information see http://sourceware.org/lists.html#faq

Reply | Threaded
Open this post in threaded view
|

Re: RHEL incompatibility in crosstool-ng build gdb native script

Martin Guy
> Or, to avoid running "rm" hundreds of times,
>         -print | xargs -d\\n rm -fv 2>&1 | CT_DoLog ALL

Ignore that - it only removes one file!

--
For unsubscribe information see http://sourceware.org/lists.html#faq

Reply | Threaded
Open this post in threaded view
|

Re: RHEL incompatibility in crosstool-ng build gdb native script

Yann E. MORIN
In reply to this post by Michael Abbott-4
Michael,
All,

On Monday 01 September 2008 10:17:17 Michael Abbott wrote:
> On line 180 of scripts/build/debug/300-gdb.sh we have the perfectly
> reasonable command
>         find "${CT_DEBUG_INSTALL_DIR}" -type f -name gdbserver \
>    -exec rm -fv {} + 2>&1 |CT_DoLog ALL

Fixed in trunk. Thank you!

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |   ^                |
| --==< ^_^ >==-- `------------.-------:  X  AGAINST      |  /e\  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |  """  conspiracy.  |
`------------------------------^-------^------------------^--------------------'


--
For unsubscribe information see http://sourceware.org/lists.html#faq

Reply | Threaded
Open this post in threaded view
|

Re: RHEL incompatibility in crosstool-ng build gdb native script

Brian Dessent
In reply to this post by Martin Guy
Martin Guy wrote:

> >         -print | xargs -d\\n rm -fv 2>&1 | CT_DoLog ALL
>
> Ignore that - it only removes one file!

What you want here is "-print0 | xargs -0 ...".  This allows filenames
with whitespace as well as only invoking the minimal number of rm
processes as dictated by the maximum argv length.

Brian

--
For unsubscribe information see http://sourceware.org/lists.html#faq

Reply | Threaded
Open this post in threaded view
|

Re: RHEL incompatibility in crosstool-ng build gdb native script

Yann E. MORIN
Brian,
All,

On Monday 01 September 2008 14:52:13 Brian Dessent wrote:
> What you want here is "-print0 | xargs -0 ...".  This allows filenames
> with whitespace as well as only invoking the minimal number of rm
> processes as dictated by the maximum argv length.

Well, it has only one file to remove, anyway... Using find here is a bit
overkill, but that's the easy way...

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |   ^                |
| --==< ^_^ >==-- `------------.-------:  X  AGAINST      |  /e\  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |  """  conspiracy.  |
`------------------------------^-------^------------------^--------------------'


--
For unsubscribe information see http://sourceware.org/lists.html#faq