develooper Front page | perl.perl5.porters | Postings from September 2013

Re: [perl #48885] perl-5.10 config failure: broken filexp

Thread Previous
From:
H.Merijn Brand
Date:
September 13, 2013 10:56
Subject:
Re: [perl #48885] perl-5.10 config failure: broken filexp
Message ID:
20130913125606.22eb1eb0@pc09.procura.nl
On Fri, 13 Sep 2013 09:54:57 +0100, Nicholas Clark <nick@ccl4.org>
wrote:

> On Thu, Sep 12, 2013 at 05:54:00PM -0700, James E Keenan via RT wrote:
> > On Mon May 07 17:29:02 2012, jkeenan wrote:
> > > On Wed Dec 19 11:47:55 2007, doughera wrote:
> > > > On Wed, 19 Dec 2007, l . mai @ web . de wrote:
> > > > 
> > > > > This is what happens when I run perl-5.10.0/Configure:
> > > > > 
> > > > > ...
> > > > > Installation prefix to use? (~name ok) [/usr/local] ~/usr/local
> > > > > filexp: can't locate home directory for: 
> > > > > Directory ~/usr/local doesn't exist.  Use that name anyway? [n]  
> 
> > > > > The bash documentation says:
> > > > > |                          Each PATTERN undergoes tilde expansion,
> > > > > |  parameter expansion, command substitution, and arithmetic
> > > > > |  expansion.
> > > > > 
> > > > > So C<case "$1" in ~/*|~)> never matches '~' because the ~ is expanded
> > > > > by the case statement. The fix is to put \\ before each ~ in
> > Configure,
> > > > > which causes \~ to be written to filexp.
> > > > 
> > > > Excellent diagnosis.  Thank you.  The code in question was actually 
> > > > written over 20 years ago (you'll find it in perl1) and was written
> > to be 
> > > > executed under /bin/sh, which did not expand ~ at the time, so this
> > > wasn't 
> > > > an issue.  The problem has remained hidden because most users who try
> > > this 
> > > > apparently have /bin/csh installed, so the  /bin/csh -f -c "glob \$1"
> > > > command did the right thing.
> > > > 
> > > > Your suggestion makes a lot of sense; we'll have to try it on some old 
> > > > Bourne shells and make sure they don't complain.
> 
> > Configure mavens:  Is there still work to be done in this ticket?
> 
> No. It turns out that I independently figured out the cause of this bug about
> 3 months later, and that it dated from Perl 1.
> 
> [I had encountered it both on my girlfriend's laptop and on a shell account
> on a friend's machine earlier, but until then hadn't worked out why it was
> only those two machines. CSH considered harmful, for hiding our bugs from us
> :-)]
> 
> I can see from a git blame of Configure that I pushed the first half of the
> fix suggested here as change 33318 (commit f16e9d76b4f2d50c), and Merijn
> effectively applied the second as
> 
> commit 4137585d161068477223a004b005a7b78ff03d8e
> Author: H.Merijn Brand <h.m.brand@xs4all.nl>
> Date:   Fri Feb 15 16:41:12 2008 +0000
> 
>     Resync with metaconfig. Escape the last ~.
>     
>     p4raw-id: //depot/perl@33321
> 
> 
> 
> I didn't realise that proper old-fashioned Bourne shells didn't expand ~
> (And I didn't realise that the rules had changed for ~. I know that ^ used
> to be |) so I didn't consider it as something that needed testing.
> 
> The fix appears to have been merged to maint-5.10 before 5.10.1 shipped,
> and we've had no feedback that we broke it for anyone.
> 
> So we actually fixed this a long time ago, but didn't realise that there was
> an open ticket for it. Sorry about that lack of feedback.
> 
> Nicholas Clark

/me deletes whole thread from p5p mailbox.
I actually still had it from the start back in 19 Dec 2007 10:03:44

James, thanks again for this dirty work

-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.19   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/        http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About