public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
To: Titus von Boxberg <tvb377@gmx.de>
Cc: crossgcc@sourceware.org
Subject: Re: Split patch for Mac OS/ was Re: Help with Building toolchain with  crosstool-ng on Mac OS X 10.6.2  (Snow Leopard)
Date: Sat, 20 Feb 2010 20:33:00 -0000	[thread overview]
Message-ID: <201002202133.20696.yann.morin.1998@anciens.enib.fr> (raw)
In-Reply-To: <1BC3CDF6-F7D6-45D7-985F-20674D1B75B1@gmx.de>

Hello Titus, All!

On Friday 19 February 2010 07:15:25 Titus von Boxberg wrote:
> >> -has_or_abort prog="awk gawk" ver='^GNU Awk' err="GNU 'awk' was not found"
> >> +has_or_abort prog="gawk awk" ver='^GNU Awk' err="GNU 'awk' was not found"
> > Huh? Why do you need to switch the check ?
> As far as I remember has_or_abort did not check for the 2nd prog name, and
> the linux boxes in my company have gawk as well, so: pure lazyness ;-)
> awk is not called by ctng (at least not in incompatible
> ways) and many if not all tool configures look for gawk, anyway.
> Can insert that into the GNU wrapper --with-xx-list as well.

Well, if awk is indeed GNU awk, there's no need to test the second arg, of
course! So, this is a purely gratuituous change. Dropped.

> > [--SNIP--]
> >> -has_or_abort prog=stat ver='GNU coreutils'
> >> +has_or_abort prog=stat
> > 
> > One separate patch for that, please. I want to be able to revert just this
> > in case it breaks later, whithout reverting the whole patch.
> I kindly but strongly object.
> This patch by itself does not and can not break anything for
> GNU systems because stat really is a *core*util. I cannot think of a
> nonbroken GNU/Linux system where stat is not from GNU.

busybox' stat... Although that one supports the same formats as coreutils'.

And a system running the Linux kernel and a busybox-based userland is not
a GNU/Linux system, and I would not call that broken.

> I would even recommend to delete the line to make it consistent
> with readlink not being checked for as well, and because I
> cannot think of any nonbroken system without stat.
> What do you think of this?

I'd say that we should check for readlink also. This is an omission.

> > --> sed-portable:
> > Note however that there are many other places where sed is called with -r.
> > Did you make sure those where not impacted also?
> I'm pretty sure that this is the only location where the links to GNU
> tools have not yet been set up.

Yes. You're right. The other places use the wrapper. Thanks for pointing
this out!

> > --> stat-portable:
> > 
> >> diff --git a/scripts/build/internals.sh b/scripts/build/internals.sh
[--SNIP--]
> > And separate patch for that, please, as it's not related to the rest
> > of the patch.
> It is related because it replaces a non portable call to stat
> which is what the rest of this patch does, too.

Yes, but it fixes two different issues with stat. At least 'internals.sh'
and 'functions' can be in the same patch, but the populate hunks (below)
should be a separate patch.

> >> +            echo "OS unknown";
> > Redirect to stderr!
> CT_DoLog maybe?

Not available in populate...

> >> -src_inode=$(stat -c '%i' "${CT_ROOT_SRC_DIR}/.")
> >> -dst_inode=$(stat -c '%i' "${CT_ROOT_DST_DIR}/." 2>/dev/null || true)
> >> +src_inode=$(CT_getinode "${CT_ROOT_SRC_DIR}/.")
> >> +dst_inode=$(CT_getinode "${CT_ROOT_DST_DIR}/." 2>/dev/null || true)
> > 
> > Oh well, stderr is consigned to oblivion here, which means you wont see
> > the "OS unknown" error message anyway...
> > 
> >> if [ "${src_inode}" -eq "$((dst_inode+0))" ]; then
> >>     echo "$myname: source and destination are the same!"
> >>     exit 1
> > Separate patch, please.
> > Seems we can do way better here: move the '2>/dev/null || true' up into
> > the function.
> Imo such a function with a name suggesting general usability
> should normally complain visibly when the file was not found.
> So I would opt to leave the /dev/null where it is.
> Or didn't I get the message right?

Sorry, I was not clear enough. I meant smthg like:

CT_getinode() {
    case "$(uname -s)" in
        *BSD|Darwin) stat -f '%i' $1 2>/dev/null || true;;
        Linux)       stat -c '%i' $1 2>/dev/null || true;;
        *)           echo "OS unknown" >&2; exit 1;;
    esac
}

src_inode=$(CT_getinode "${CT_ROOT_SRC_DIR}/.")
dst_inode=$(CT_getinode "${CT_ROOT_DST_DIR}/.")

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
`------------------------------^-------^------------------^--------------------'



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

  reply	other threads:[~2010-02-20 20:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-02 23:24 tvb377
2010-02-03 23:17 ` Yann E. MORIN
2010-02-18 19:54 ` Yann E. MORIN
2010-02-18 20:33 ` Yann E. MORIN
2010-02-19  6:15   ` Titus von Boxberg
2010-02-20 20:33     ` Yann E. MORIN [this message]
2010-02-20 22:34       ` Titus von Boxberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201002202133.20696.yann.morin.1998@anciens.enib.fr \
    --to=yann.morin.1998@anciens.enib.fr \
    --cc=crossgcc@sourceware.org \
    --cc=tvb377@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).