John Burrell wrote:


________________________________
From: blfs-dev <[email protected]> on behalf of Bruce Dubbs 
<[email protected]>
Sent: Friday, September 23, 2016 9:36 PM
To: BLFS Development List
Subject: Re: [blfs-dev] Changes in Bash-4.4

John Burrell wrote:
Among the changes from 4.3 to 4.4 is this one:


"qq. There is a new option settable in config-top.h that makes multiple directory 
arguments to `cd' a fatal error."

The relevant Define variable in config-top.h is CD_COMPLAINS and it is set by 
default.

You have to undefine this to get the 4.3 behavior.

This explains why my install scripts started failing. By default you can't:

unzip jasper-*.zip
cd jasper-*

It depends on how many matches you get with jasper-*.  If there is only
one match, you are OK.

True, but if you have the source file and the unpacked version in the same dir 
(the usual case for me) it doesn't work.

Here is an example - jasper-1.900.1.zip is the only file in a dir. I did unzip 
jasper*.zip and then

cd jasper-* gave me the following (using set -x):

+ cd jasper-1.900.1 jasper-1.900.1.zip
bash: cd: too many arguments

So I, and probably others too, will have to undefine CD_COMPLAINS in order to 
make it work sensibly or use a more complicated method - something like:

SrcName=jasper-
gotoDir=$(zipinfo -1 ${SrcName}*.zip | grep -m1 /)
unzip ${SrcName}*.zip
cd $gotoDir

which is horrible in comparison to using *

I'm afraid I do not have a lot of sympathy for using a command in an undocumented way.

How about:

VERSION=1.900.1
tar -xf jasper-$VERSION.*
cd jasper-$VERSION


For the standard tar files, it it a little easier:

PROGRAM=libpng-1.6.24
tar -xf $DIR/$PROGRAM.tar.?z* || exit 1
cd $PROGRAM

There are many other places where PROGRAM can be used, e,g,

$SUDO mkdir -v                            /usr/share/doc/$PROGRAM &&
$SUDO install -v README libpng-manual.txt /usr/share/doc/$PROGRAM

Where SUDO and DIR are defined in a sourced file.

  -- Bruce


--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to