[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?
From: |
Eric Blake |
Subject: |
Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd? |
Date: |
Mon, 16 May 2011 15:52:20 -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 03:44 PM, Sam Steingold wrote:
>> * Eric Blake <address@hidden> [2011-05-16 15:30:04 -0600]:
>>
>>> why doesn't vc-list-files accept a list of directories?
>>
>> Patches welcome; seems like a useful addition.
>
> @@ -61,16 +61,10 @@ EOF
> shift; shift ;;
> esac
>
> -dir=
> -case $# in
> - 0) ;;
> - 1) dir=$1 ;;
> - *) echo "$0: too many arguments" 1>&2
> - echo "Usage: $0 [-C srcdir] [DIR]" 1>&2; exit 1;;
> -esac
> -
> -test "x$dir" = x && dir=.
> +dirs=$*
This isn't safe if any arguments contain whitespace. Why not iterate
directly over $@ in that case, rather than assigning to an intermediate
$dirs only to then reiterate?
> +test "x$dirs" = x && dirs=.
Which means this would be written:
test $# = 0 && set .
>
> +for dir in $dirs; do
> if test -d .git; then
> test "x$dir" = x. \
> && dir= sed_esc= \
> @@ -108,6 +102,7 @@ else
> echo "$0: Failed to determine type of version control used in `pwd`" 1>&2
> exit 1
> fi
> +done
>
Of course, we'd want to reindent the loop body, as well.
>> Where is it hard-coded? We've been trying to get rid of hard-coded
>> aspects, but we can only fix things as they are pointed out.
>
> --- /home2/sds/src/clisp/current/gnulib/top/maint.mk 2011-05-16
> 16:32:49.000000000 -0400
> +++ /home2/sds/src/clisp/current/maint.mk 2011-05-16 17:20:23.000000000
> -0400
> @@ -681,7 +681,7 @@ sc_useless_cpp_parens:
> # #if HAVE_HEADER_H that you remove, be sure that your project explicitly
> # requires the gnulib module that guarantees the usability of that header.
> gl_assured_headers_ = \
> - cd $(gnulib_dir)/lib && echo *.in.h|sed 's/\.in\.h//g'
> + cd $(gnulib_dir) && echo *.in.h|sed 's/\.in\.h//g'
NACK. This is one case where we are looking at the gnulib source
directory (such as $GNULIB_SRCDIR), to see files from gnulib.git, and
_not_ in the resulting --libdir location of your project. This
hard-code is correct.
> -v_etc_file = $(gnulib_dir)/lib/version-etc.c
> +v_etc_file = $(gnulib_dir)/version-etc.c
Same NACK. Again, this is a case where we are looking at a file living
in gnulib.git, and not what got copied into your project.
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?, (continued)
- Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?, Eric Blake, 2011/05/16
- Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?, Sam Steingold, 2011/05/16
- Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?, Eric Blake, 2011/05/16
- Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?, Karl Berry, 2011/05/16
- Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?, Eric Blake, 2011/05/16
- Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?, Sam Steingold, 2011/05/16
- Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?, Eric Blake, 2011/05/16
- Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?, Sam Steingold, 2011/05/16
- Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?, Eric Blake, 2011/05/16
- Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?, Sam Steingold, 2011/05/16
- Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?,
Eric Blake <=
- [PATCH] vc-list-files: accept multiple directory operands, Eric Blake, 2011/05/16