* Re: [Qemu-devel] [PATCH] configure
@ 2007-05-09 8:51 Juergen Keil
2007-05-09 9:18 ` Jeff Chua
2007-05-09 13:50 ` Joachim Henke
0 siblings, 2 replies; 14+ messages in thread
From: Juergen Keil @ 2007-05-09 8:51 UTC (permalink / raw)
To: qemu-devel
> Thiemo Seufer wrote:
> Jeff Chua wrote:
> [snip]
> > @@ -567,7 +567,8 @@
> > fi
> >
> > # Check if tools are available to build documentation.
> > -if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then
> > +if [ -x "`which texi2html 2>/dev/null`" \
> > + -a -x "`which pod2man 2>/dev/null`" ]; then
>
> Under which circumstances does "which" complain about unavailable
> executables?
Isn't the use of "which" wrong, anyway?
"which" belongs to csh/tcsh, and tells you about csh's/tcsh's idea
about a command or a csh command alias.
IMO, for a /bin/sh (or bash) script, using the "type" command would
be a better idea.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH] configure
2007-05-09 8:51 [Qemu-devel] [PATCH] configure Juergen Keil
@ 2007-05-09 9:18 ` Jeff Chua
2007-05-09 9:40 ` Andreas Schwab
2007-05-09 13:50 ` Joachim Henke
1 sibling, 1 reply; 14+ messages in thread
From: Jeff Chua @ 2007-05-09 9:18 UTC (permalink / raw)
To: Juergen Keil, qemu-devel
On 5/9/07, Juergen Keil <jk@tools.de> wrote:
> Isn't the use of "which" wrong, anyway?
>
> "which" belongs to csh/tcsh, and tells you about csh's/tcsh's idea
> about a command or a csh command alias.
>
> IMO, for a /bin/sh (or bash) script, using the "type" command would
> be a better idea.
"which" returns the first path, "type" returns all paths.
# type awk
awk is /bin/awk
awk is /usr/bin/awk
# which awk
/bin/awk
# type foo
-bash: type: foo: not found
Either way would work, but even with "type", it still needs to be
"type foo 2>/dev/null".
Thanks,
Jeff.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH] configure
2007-05-09 9:18 ` Jeff Chua
@ 2007-05-09 9:40 ` Andreas Schwab
2007-05-09 14:55 ` Jeff Chua
0 siblings, 1 reply; 14+ messages in thread
From: Andreas Schwab @ 2007-05-09 9:40 UTC (permalink / raw)
To: qemu-devel
"Jeff Chua" <jeff.chua.linux@gmail.com> writes:
> On 5/9/07, Juergen Keil <jk@tools.de> wrote:
>
>> Isn't the use of "which" wrong, anyway?
>>
>> "which" belongs to csh/tcsh, and tells you about csh's/tcsh's idea
>> about a command or a csh command alias.
>>
>> IMO, for a /bin/sh (or bash) script, using the "type" command would
>> be a better idea.
>
> "which" returns the first path, "type" returns all paths.
You want "type -p".
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH] configure
2007-05-09 9:40 ` Andreas Schwab
@ 2007-05-09 14:55 ` Jeff Chua
2007-05-09 17:10 ` Andreas Schwab
0 siblings, 1 reply; 14+ messages in thread
From: Jeff Chua @ 2007-05-09 14:55 UTC (permalink / raw)
To: qemu-devel
On 5/9/07, Andreas Schwab <schwab@suse.de> wrote:
> "Jeff Chua" <jeff.chua.linux@gmail.com> writes:
> > "which" returns the first path, "type" returns all paths.
>
> You want "type -p".
# type awk
awk is /bin/awk
awk is /usr/bin/awk
# type -p awk
/bin/awk
/usr/bin/awk
# type foo
-bash: type: foo: not found
# type -p foo
#
Interesting. "type -p foo" does the same as "type foo 2>/dev/null",
but only if "foo" is not found. Tried that on "awk" above, and it
prints the paths.
Thanks,
Jeff.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH] configure
2007-05-09 14:55 ` Jeff Chua
@ 2007-05-09 17:10 ` Andreas Schwab
0 siblings, 0 replies; 14+ messages in thread
From: Andreas Schwab @ 2007-05-09 17:10 UTC (permalink / raw)
To: qemu-devel
"Jeff Chua" <jeff.chua.linux@gmail.com> writes:
> # type awk
> awk is /bin/awk
> awk is /usr/bin/awk
> # type -p awk
> /bin/awk
> /usr/bin/awk
You are not using type, but type -a.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH] configure
2007-05-09 8:51 [Qemu-devel] [PATCH] configure Juergen Keil
2007-05-09 9:18 ` Jeff Chua
@ 2007-05-09 13:50 ` Joachim Henke
2007-05-09 14:04 ` Thiemo Seufer
1 sibling, 1 reply; 14+ messages in thread
From: Joachim Henke @ 2007-05-09 13:50 UTC (permalink / raw)
To: qemu-devel
On Wed, 2007-05-09 at 10:51 +0200, Juergen Keil wrote:
> Isn't the use of "which" wrong, anyway?
>
> "which" belongs to csh/tcsh, and tells you about csh's/tcsh's idea
> about a command or a csh command alias.
>
> IMO, for a /bin/sh (or bash) script, using the "type" command would
> be a better idea.
Yes, 'which' is not reliable.
I already posted a patch regarding Mac OS X here:
http://lists.gnu.org/archive/html/qemu-devel/2007-04/msg00649.html
It fixes gcc detection only, because the other tools, that are detected
by which, are installed anyway. This is of course not clean, but worked
for the time.
--
Joachim Henke
http://base91.sourceforge.net/j-o/
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH] configure
2007-05-09 13:50 ` Joachim Henke
@ 2007-05-09 14:04 ` Thiemo Seufer
2007-05-09 15:58 ` [Qemu-devel] " Ben Pfaff
0 siblings, 1 reply; 14+ messages in thread
From: Thiemo Seufer @ 2007-05-09 14:04 UTC (permalink / raw)
To: Joachim Henke; +Cc: qemu-devel
Joachim Henke wrote:
> On Wed, 2007-05-09 at 10:51 +0200, Juergen Keil wrote:
> > Isn't the use of "which" wrong, anyway?
> >
> > "which" belongs to csh/tcsh, and tells you about csh's/tcsh's idea
> > about a command or a csh command alias.
> >
> > IMO, for a /bin/sh (or bash) script, using the "type" command would
> > be a better idea.
>
> Yes, 'which' is not reliable.
"type" appears to be bash-specific, at least according to the bash
documentation, so I stuck with "which" for now.
Thiemo
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Qemu-devel] Re: [PATCH] configure
2007-05-09 14:04 ` Thiemo Seufer
@ 2007-05-09 15:58 ` Ben Pfaff
0 siblings, 0 replies; 14+ messages in thread
From: Ben Pfaff @ 2007-05-09 15:58 UTC (permalink / raw)
To: qemu-devel
Thiemo Seufer <ths@networkno.de> writes:
> Joachim Henke wrote:
>> On Wed, 2007-05-09 at 10:51 +0200, Juergen Keil wrote:
>> > Isn't the use of "which" wrong, anyway?
>> >
>> > "which" belongs to csh/tcsh, and tells you about csh's/tcsh's idea
>> > about a command or a csh command alias.
>> >
>> > IMO, for a /bin/sh (or bash) script, using the "type" command would
>> > be a better idea.
>>
>> Yes, 'which' is not reliable.
>
> "type" appears to be bash-specific, at least according to the bash
> documentation, so I stuck with "which" for now.
You could use "command -v" from SUSv3.
--
Ben Pfaff
http://benpfaff.org
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH] configure
@ 2007-05-09 3:39 Ben Taylor
0 siblings, 0 replies; 14+ messages in thread
From: Ben Taylor @ 2007-05-09 3:39 UTC (permalink / raw)
To: Thiemo Seufer, qemu-devel; +Cc: Jeff Chua
---- Jeff Chua <jeff.chua.linux@gmail.com> wrote:
> For those who does minimal install. In this case, texi2html would not
> be available on the system. I've seen quite a few systems without
> texi2html.
>
> Again, the patch is not a MUST, but it's nice not to see unnecessary warning.
I suppose you could do a -n "`texi2html -verbose 2>&1 | head -1 |grep 'This is texi2html'`"
which would be more representative if you have texi2html or not.
Ben
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Qemu-devel] [PATCH] configure
@ 2007-05-08 15:43 Jeff Chua
2007-05-08 21:00 ` Thiemo Seufer
0 siblings, 1 reply; 14+ messages in thread
From: Jeff Chua @ 2007-05-08 15:43 UTC (permalink / raw)
To: qemu-devel
Avi had suggest I post this patch here so that it can be included in qemu
instead of kvm.
Here's a little patch to silent ...
- sdl-config when SDK is compiled without static library
- texi2html when not found
Thanks,
Jeff
--- kvm/qemu/configure.org 2007-05-07 20:36:59 +0800
+++ kvm/qemu/configure 2007-05-07 20:40:58 +0800
@@ -523,8 +523,8 @@
# static link with sdl ?
if test "$sdl" = "yes" ; then
aa="no"
-`$sdl_config --static-libs | grep \\\-laa > /dev/null` && aa="yes"
-sdl_static_libs=`$sdl_config --static-libs`
+`$sdl_config --static-libs 2>/dev/null | grep \\\-laa > /dev/null` && aa="yes"
+sdl_static_libs=`$sdl_config --static-libs 2>/dev/null`
if [ "$aa" = "yes" ] ; then
sdl_static_libs="$sdl_static_libs `aalib-config --static-libs`"
fi
@@ -567,7 +567,8 @@
fi
# Check if tools are available to build documentation.
-if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then
+if [ -x "`which texi2html 2>/dev/null`" \
+ -a -x "`which pod2man 2>/dev/null`" ]; then
build_docs="yes"
fi
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH] configure
2007-05-08 15:43 Jeff Chua
@ 2007-05-08 21:00 ` Thiemo Seufer
2007-05-09 0:18 ` Jeff Chua
0 siblings, 1 reply; 14+ messages in thread
From: Thiemo Seufer @ 2007-05-08 21:00 UTC (permalink / raw)
To: Jeff Chua; +Cc: qemu-devel
Jeff Chua wrote:
[snip]
> @@ -567,7 +567,8 @@
> fi
>
> # Check if tools are available to build documentation.
> -if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then
> +if [ -x "`which texi2html 2>/dev/null`" \
> + -a -x "`which pod2man 2>/dev/null`" ]; then
Under which circumstances does "which" complain about unavailable
executables?
Thiemo
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH] configure
2007-05-08 21:00 ` Thiemo Seufer
@ 2007-05-09 0:18 ` Jeff Chua
2007-05-09 0:41 ` Thiemo Seufer
0 siblings, 1 reply; 14+ messages in thread
From: Jeff Chua @ 2007-05-09 0:18 UTC (permalink / raw)
To: Thiemo Seufer; +Cc: qemu-devel
For those who does minimal install. In this case, texi2html would not
be available on the system. I've seen quite a few systems without
texi2html.
Again, the patch is not a MUST, but it's nice not to see unnecessary warning.
Thanks,
Jeff.
On 5/9/07, Thiemo Seufer <ths@networkno.de> wrote:
> Jeff Chua wrote:
> [snip]
> > @@ -567,7 +567,8 @@
> > fi
> >
> > # Check if tools are available to build documentation.
> > -if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then
> > +if [ -x "`which texi2html 2>/dev/null`" \
> > + -a -x "`which pod2man 2>/dev/null`" ]; then
>
> Under which circumstances does "which" complain about unavailable
> executables?
>
>
> Thiemo
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH] configure
2007-05-09 0:18 ` Jeff Chua
@ 2007-05-09 0:41 ` Thiemo Seufer
2007-05-09 3:22 ` Jeff Chua
0 siblings, 1 reply; 14+ messages in thread
From: Thiemo Seufer @ 2007-05-09 0:41 UTC (permalink / raw)
To: Jeff Chua; +Cc: qemu-devel
Jeff Chua wrote:
> For those who does minimal install. In this case, texi2html would not
> be available on the system. I've seen quite a few systems without
> texi2html.
>
> Again, the patch is not a MUST, but it's nice not to see unnecessary
> warning.
I don't see a warning for e.g. "which foo" on my system. Could you
describe your system and paste the output the which command produces
there?
> Thanks,
> Jeff.
>
>
> On 5/9/07, Thiemo Seufer <ths@networkno.de> wrote:
> >Jeff Chua wrote:
> >[snip]
> >> @@ -567,7 +567,8 @@
> >> fi
> >>
> >> # Check if tools are available to build documentation.
> >> -if [ -x "`which texi2html`" ] && [ -x "`which pod2man`" ]; then
> >> +if [ -x "`which texi2html 2>/dev/null`" \
> >> + -a -x "`which pod2man 2>/dev/null`" ]; then
> >
> >Under which circumstances does "which" complain about unavailable
> >executables?
> >
> >
> >Thiemo
> >
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Qemu-devel] [PATCH] configure
2007-05-09 0:41 ` Thiemo Seufer
@ 2007-05-09 3:22 ` Jeff Chua
0 siblings, 0 replies; 14+ messages in thread
From: Jeff Chua @ 2007-05-09 3:22 UTC (permalink / raw)
To: Thiemo Seufer; +Cc: qemu-devel
On 5/9/07, Thiemo Seufer <ths@networkno.de> wrote:
> I don't see a warning for e.g. "which foo" on my system. Could you
> describe your system and paste the output the which command produces
> there?
# which foo
which: no foo in
(/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/games:/usr/local/samba/sbin:/usr/local/samba/bin:/etc/rc.d:/root/scripts2:/root/cc2:/usr/local/apache2/bin:/usr/local/squid/sbin:/opt/java/bin:/usr/local/netpbm/bin:/usr/local/ssh/bin:/usr/local/ssl/bin:/usr/lib/yp:.:/usr/vbin:/usr/local/python/bin:/usr/local/tcl/bin:/usr/local/kvm/bin:/usr/local/perl/bin:/db/oracle/db1/bin:/root/oracle2:/usr/local/git/bin:/opt/sybase/bin)
# echo $?
1
# which vi
/usr/bin/vi
# echo $?
0
Thanks,
Jeff.
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2007-05-09 17:17 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-09 8:51 [Qemu-devel] [PATCH] configure Juergen Keil
2007-05-09 9:18 ` Jeff Chua
2007-05-09 9:40 ` Andreas Schwab
2007-05-09 14:55 ` Jeff Chua
2007-05-09 17:10 ` Andreas Schwab
2007-05-09 13:50 ` Joachim Henke
2007-05-09 14:04 ` Thiemo Seufer
2007-05-09 15:58 ` [Qemu-devel] " Ben Pfaff
-- strict thread matches above, loose matches on Subject: below --
2007-05-09 3:39 [Qemu-devel] " Ben Taylor
2007-05-08 15:43 Jeff Chua
2007-05-08 21:00 ` Thiemo Seufer
2007-05-09 0:18 ` Jeff Chua
2007-05-09 0:41 ` Thiemo Seufer
2007-05-09 3:22 ` Jeff Chua
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 NNTP newsgroup(s).