* zsh breaks configure scripts
@ 2002-03-04 14:51 Eric Norum
2002-03-04 14:58 ` [Fink-devel] " Peter O'Gorman
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Eric Norum @ 2002-03-04 14:51 UTC (permalink / raw)
To: zsh-workers; +Cc: fink-devel
Apple uses zsh as /bin/sh on Mac OS X. Unfortunately zsh has a
`feature' that breaks many autoconf configure scripts. The scripts
contain lines like:
if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && .......
The problem is that the zsh cd command insists on printing the directory!
The offending code is in cd_new_pwd() in Src/builtins.c around line 1047:
if (unset(PUSHDSILENT) && func != BIN_CD && isset(INTERACTIVE))
printdirstack();
else if (doprintdir) {
fprintdir(pwd, stdout);
putchar('\n');
}
I suggest that the fprintdir/putchar be called only in interactive
shells:
if (unset(PUSHDSILENT) && func != BIN_CD && isset(INTERACTIVE))
printdirstack();
else if (doprintdir && isset(INTERACTIVE)) {
fprintdir(pwd, stdout);
putchar('\n');
}
--
Eric Norum <eric.norum@usask.ca>
Department of Electrical Engineering
University of Saskatchewan
Saskatoon, Canada.
Phone: (306) 966-5394 FAX: (306) 966-5407
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Fink-devel] zsh breaks configure scripts
2002-03-04 14:51 zsh breaks configure scripts Eric Norum
@ 2002-03-04 14:58 ` Peter O'Gorman
2002-03-04 17:19 ` Bart Schaefer
2002-03-04 15:19 ` Borsenkow Andrej
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Peter O'Gorman @ 2002-03-04 14:58 UTC (permalink / raw)
To: Eric Norum; +Cc: zsh-workers, fink-devel
And why are you sending this here? Fink has no control over
which shell Apple decides to ship, although they will eventually
move to using bash as /bin/sh, probably not until 10.2 or even
later...
Peter
On Monday, March 4, 2002, at 11:51 PM, Eric Norum wrote:
> Apple uses zsh as /bin/sh on Mac OS X. Unfortunately zsh has a
> `feature' that breaks many autoconf configure scripts. The
> scripts contain lines like:
> if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && .......
>
> The problem is that the zsh cd command insists on printing the
> directory!
>
> The offending code is in cd_new_pwd() in Src/builtins.c around
> line 1047:
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: zsh breaks configure scripts
2002-03-04 14:51 zsh breaks configure scripts Eric Norum
2002-03-04 14:58 ` [Fink-devel] " Peter O'Gorman
@ 2002-03-04 15:19 ` Borsenkow Andrej
2002-03-04 15:26 ` Peter Stephenson
2002-03-04 15:42 ` Alexandre Duret-Lutz
3 siblings, 0 replies; 6+ messages in thread
From: Borsenkow Andrej @ 2002-03-04 15:19 UTC (permalink / raw)
To: 'Eric Norum', zsh-workers
>
> Apple uses zsh as /bin/sh on Mac OS X. Unfortunately zsh has a
> `feature' that breaks many autoconf configure scripts. The scripts
> contain lines like:
> if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && .......
>
> The problem is that the zsh cd command insists on printing the
directory!
>
> The offending code is in cd_new_pwd() in Src/builtins.c around line
1047:
> if (unset(PUSHDSILENT) && func != BIN_CD && isset(INTERACTIVE))
> printdirstack();
> else if (doprintdir) {
> fprintdir(pwd, stdout);
> putchar('\n');
> }
>
> I suggest that the fprintdir/putchar be called only in interactive
> shells:
> if (unset(PUSHDSILENT) && func != BIN_CD && isset(INTERACTIVE))
> printdirstack();
> else if (doprintdir && isset(INTERACTIVE)) {
> fprintdir(pwd, stdout);
> putchar('\n');
> }
>
Looking at different shells here:
sh does not print anything at all
ksh and bash do not print anything is we cd relative to empty CDPATH
element (the best I can explain it):
bor@itsrm2% ksh
$ cd
$ CDPATH=:; cd tmp
$ cd
$ CDPATH=.:/tmp; cd tmp
/home/bor/tmp
$ cd
$ CDPATH=:/tmp;cd tmp
$ cd
$ CDPATH=/tmp:; cd tmp
$ exit
May be we should just follow the suite?
-andrej
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: zsh breaks configure scripts
2002-03-04 14:51 zsh breaks configure scripts Eric Norum
2002-03-04 14:58 ` [Fink-devel] " Peter O'Gorman
2002-03-04 15:19 ` Borsenkow Andrej
@ 2002-03-04 15:26 ` Peter Stephenson
2002-03-04 15:42 ` Alexandre Duret-Lutz
3 siblings, 0 replies; 6+ messages in thread
From: Peter Stephenson @ 2002-03-04 15:26 UTC (permalink / raw)
To: zsh-workers; +Cc: Eric Norum
Eric Norum wrote:
> Apple uses zsh as /bin/sh on Mac OS X. Unfortunately zsh has a
> `feature' that breaks many autoconf configure scripts. The scripts
> contain lines like:
> if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && .......
>
> The problem is that the zsh cd command insists on printing the directory!
> I suggest that the fprintdir/putchar be called only in interactive
> shells:
That looks fine. I'll put this on the 4.0 line, too. It could be made
an option, but it's not really worth it. It's a bit of a nasty hack to
inform the user which directory they're going into if it's not obvious.
This seems to cover the likely problems without hurting anyone.
Index: Src/builtin.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/builtin.c,v
retrieving revision 1.70
diff -u -r1.70 builtin.c
--- Src/builtin.c 22 Feb 2002 21:59:43 -0000 1.70
+++ Src/builtin.c 4 Mar 2002 15:22:52 -0000
@@ -1059,11 +1059,13 @@
pwd = new_pwd;
set_pwd_env();
- if (unset(PUSHDSILENT) && func != BIN_CD && isset(INTERACTIVE))
- printdirstack();
- else if (doprintdir) {
- fprintdir(pwd, stdout);
- putchar('\n');
+ if (isset(INTERACTIVE)) {
+ if (unset(PUSHDSILENT) && func != BIN_CD)
+ printdirstack();
+ else if (doprintdir) {
+ fprintdir(pwd, stdout);
+ putchar('\n');
+ }
}
/* execute the chpwd function */
--
Peter Stephenson <pws@csr.com> Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK Tel: +44 (0)1223 392070
**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential
and/or privileged material.
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by
persons or entities other than the intended recipient is
prohibited.
If you received this in error, please contact the sender and
delete the material from any computer.
**********************************************************************
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: zsh breaks configure scripts
2002-03-04 14:51 zsh breaks configure scripts Eric Norum
` (2 preceding siblings ...)
2002-03-04 15:26 ` Peter Stephenson
@ 2002-03-04 15:42 ` Alexandre Duret-Lutz
3 siblings, 0 replies; 6+ messages in thread
From: Alexandre Duret-Lutz @ 2002-03-04 15:42 UTC (permalink / raw)
To: zsh-workers; +Cc: Eric Norum
>>> "Eric" == Eric Norum <eric.norum@usask.ca> writes:
Eric> Apple uses zsh as /bin/sh on Mac OS X. Unfortunately zsh has a
Eric> `feature' that breaks many autoconf configure scripts. The scripts
Eric> contain lines like:
Eric> if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && .......
Aside: Recent Autoconfs (2.52 I think) and Automake (>=1.5a)
have workarounds to support Zsh in this area. Basically they
now use `CDPATH=${ZSH_VERSION+.}:' when needed.
[...]
--
Alexandre Duret-Lutz
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Fink-devel] zsh breaks configure scripts
2002-03-04 14:58 ` [Fink-devel] " Peter O'Gorman
@ 2002-03-04 17:19 ` Bart Schaefer
0 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2002-03-04 17:19 UTC (permalink / raw)
To: Peter O'Gorman, Eric Norum; +Cc: zsh-workers, fink-devel
On Mar 4, 11:58pm, Peter O'Gorman wrote:
} Subject: Re: [Fink-devel] zsh breaks configure scripts
}
} And why are you sending this here? Fink has no control over
} which shell Apple decides to ship, although they will eventually
} move to using bash as /bin/sh, probably not until 10.2 or even
} later...
I presume he's sending it there because if you removed the bogus
CDPATH assignment from the test, zsh wouldn't print anything.
} On Monday, March 4, 2002, at 11:51 PM, Eric Norum wrote:
}
} > Apple uses zsh as /bin/sh on Mac OS X. Unfortunately zsh has a
} > `feature' that breaks many autoconf configure scripts. The
} > scripts contain lines like:
} > if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" && .......
} >
} > The problem is that the zsh cd command insists on printing the
} > directory!
The end resulting directory is printed only if zsh got there by following
a path in CDPATH.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-03-04 17:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-04 14:51 zsh breaks configure scripts Eric Norum
2002-03-04 14:58 ` [Fink-devel] " Peter O'Gorman
2002-03-04 17:19 ` Bart Schaefer
2002-03-04 15:19 ` Borsenkow Andrej
2002-03-04 15:26 ` Peter Stephenson
2002-03-04 15:42 ` Alexandre Duret-Lutz
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
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).