[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bootstrap symlink dependencies
From: |
Eric Blake |
Subject: |
Re: bootstrap symlink dependencies |
Date: |
Mon, 16 May 2011 13:43:53 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10 |
On 05/16/2011 01:40 PM, Paul Eggert wrote:
> lswords=`ls -1diL "$src" "$dst" 2>/dev/null` &&
> inum= && \
> for lsword in $lswords; do
> case $lsword in
> *[!0-9]*) ;;
> *) if test -z "$inum"; then
> inum=$lsword
> elif test $inum -ne $lsword; then
> inum=
> break
> fi ;;
> esac
> done &&
> test -n "$inum"
>
> This uses just one fork+exec too, but it doesn't use the
> XSI notion of %% and ##. It can be fooled if "$src"
> or "$dst" contains an integer surrounded by spaces, but
> any such errors cause it to fail in a conservative way
> (by doing needless remakes), and these errors should be
> rare so that's not so bad.
>
> It assumes [!0-9] works, though;
> is that a safe assumption these days?
Yes, autoconf has been using [!...] negated shell patterns for years
now, with no problems on Solaris /bin/sh or any other shell.
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- bootstrap symlink dependencies, Pádraig Brady, 2011/05/09
- Re: bootstrap symlink dependencies, Jim Meyering, 2011/05/13
- Re: bootstrap symlink dependencies, Paul Eggert, 2011/05/14
- Re: bootstrap symlink dependencies, Pádraig Brady, 2011/05/16
- Re: bootstrap symlink dependencies, Paul Eggert, 2011/05/16
- Re: bootstrap symlink dependencies, Jim Meyering, 2011/05/16
- Re: bootstrap symlink dependencies, Eric Blake, 2011/05/16
- Re: bootstrap symlink dependencies, Paul Eggert, 2011/05/16
- Re: bootstrap symlink dependencies,
Eric Blake <=
- Re: bootstrap symlink dependencies, Ralf Wildenhues, 2011/05/16
- Re: bootstrap symlink dependencies, Paul Eggert, 2011/05/16
- Re: bootstrap symlink dependencies, Pádraig Brady, 2011/05/16