Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?

2011-05-16 Thread Eric Blake
On 05/16/2011 04:13 PM, Sam Steingold wrote:
>> VC_LIST_ALWAYS_EXCLUDE_REGEX = \
>>  ^(ChangeLog|configure|config.in.h|aclocal.m4)$$
> 
> does not work either.
> 
> also, this seems wrong because
> 
> 1. when VC_LIST_ALWAYS_EXCLUDE_REGEX is used, it is put inside ()

It's working just fine for libvirt:

# Files that should never cause syntax check failures.
VC_LIST_ALWAYS_EXCLUDE_REGEX = ^(HACKING|docs/news\.html\.in)$$

You may need to run 'make --debug' to figure out what's not working for
you, because I'm not seeing the problem locally.

-- 
Eric Blake   ebl...@redhat.com+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?

2011-05-16 Thread Sam Steingold
> * Eric Blake  [2011-05-16 15:57:43 -0600]:
>
> On 05/16/2011 03:56 PM, Sam Steingold wrote:
>> 
>> from the way VC_LIST_ALWAYS_EXCLUDE_REGEX is used, this appears to be TRT:
>> 
>> VC_LIST_ALWAYS_EXCLUDE_REGEX = ChangeLog|configure|config.in.h|aclocal.m4
>
> | outside () is different than (|).  Try:
>
> VC_LIST_ALWAYS_EXCLUDE_REGEX = \
>  ^(ChangeLog|configure|config.in.h|aclocal.m4)$$

does not work either.

also, this seems wrong because

1. when VC_LIST_ALWAYS_EXCLUDE_REGEX is used, it is put inside ()

2. my output looks like this:

../src/../src/configure:31052:#ifdef HAVE_UNISTD_H
../src/../src/configure:31330:#ifdef HAVE_UNISTD_H
../src/../src/configure:31425:#ifdef HAVE_UNISTD_H
../src/../src/configure:31538:#ifdef HAVE_UNISTD_H
../src/../src/configure:31562:#ifdef HAVE_UNISTD_H

so "^" does not look right.

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://dhimmi.com http://ffii.org http://memri.org http://truepeace.org
http://jihadwatch.org http://www.PetitionOnline.com/tap12009/
Experience comes with debts.



Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?

2011-05-16 Thread Eric Blake
On 05/16/2011 03:56 PM, Sam Steingold wrote:
> 
> from the way VC_LIST_ALWAYS_EXCLUDE_REGEX is used, this appears to be TRT:
> 
> VC_LIST_ALWAYS_EXCLUDE_REGEX = ChangeLog|configure|config.in.h|aclocal.m4

| outside () is different than (|).  Try:

VC_LIST_ALWAYS_EXCLUDE_REGEX = \
 ^(ChangeLog|configure|config.in.h|aclocal.m4)$$

-- 
Eric Blake   ebl...@redhat.com+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?

2011-05-16 Thread Sam Steingold
> * Eric Blake  [2011-05-16 15:45:00 -0600]:
>
> On 05/16/2011 03:36 PM, Karl Berry wrote:
>> > warnings about HAVE_ALLOCA_H in ChangeLog, aclocal.m4, and configure.
>> 
>> Why should there ever be a warning about an occurrence of HAVE_ALLOCA_H
>> in the ChangeLog?  Just wondering.
>
> Only because the filters haven't been tuned to exclude non-source files
> by default for all of the syntax check rules.  It's not too hard to add
> ChangeLog to a permanent per-file exemption, by adding:
>
> VC_LIST_ALWAYS_EXCLUDE_REGEX = ^ChangeLog$$
>
> to cfg.mk.  Modify that regex as needed to permanently skip other files
> from the maint.mk syntax checks.

from the way VC_LIST_ALWAYS_EXCLUDE_REGEX is used, this appears to be TRT:

VC_LIST_ALWAYS_EXCLUDE_REGEX = ChangeLog|configure|config.in.h|aclocal.m4

however, it has no effect.

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://jihadwatch.org http://openvotingconsortium.org http://truepeace.org
http://mideasttruth.com http://memri.org http://dhimmi.com
.ACMD setaloiv siht gnidaeR



Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?

2011-05-16 Thread Eric Blake
On 05/16/2011 03:44 PM, Sam Steingold wrote:
>> * Eric Blake  [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.0 -0400
> +++ /home2/sds/src/clisp/current/maint.mk 2011-05-16 17:20:23.0 
> -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   ebl...@redhat.com+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?

2011-05-16 Thread Eric Blake
On 05/16/2011 03:36 PM, Karl Berry wrote:
> > warnings about HAVE_ALLOCA_H in ChangeLog, aclocal.m4, and configure.
> 
> Why should there ever be a warning about an occurrence of HAVE_ALLOCA_H
> in the ChangeLog?  Just wondering.

Only because the filters haven't been tuned to exclude non-source files
by default for all of the syntax check rules.  It's not too hard to add
ChangeLog to a permanent per-file exemption, by adding:

VC_LIST_ALWAYS_EXCLUDE_REGEX = ^ChangeLog$$

to cfg.mk.  Modify that regex as needed to permanently skip other files
from the maint.mk syntax checks.

-- 
Eric Blake   ebl...@redhat.com+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?

2011-05-16 Thread Sam Steingold
> * Eric Blake  [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.



--- /home2/sds/src/clisp/current/gnulib/build-aux/vc-list-files 2011-05-03 
12:08:03.0 -0400
+++ /home2/sds/src/clisp/current/src/build-aux/vc-list-files2011-05-16 
17:42:00.0 -0400
@@ -2,7 +2,7 @@
 # List version-controlled file names.
 
 # Print a version string.
-scriptversion=2011-04-29.20; # UTC
+scriptversion=2011-05-16.21; # UTC
 
 # Copyright (C) 2006-2011 Free Software Foundation, Inc.
 
@@ -30,7 +30,7 @@ scriptversion=2011-04-29.20; # UTC
 postprocess=
 case $1 in
   --help) cat <&2
- echo "Usage: $0 [-C srcdir] [DIR]" 1>&2; exit 1;;
-esac
-
-test "x$dir" = x && dir=.
+dirs=$*
+test "x$dirs" = x && dirs=.
 
+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
 
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)

Diff finished.  Mon May 16 17:42:25 2011







>> (it would be 'src modules' for me)
>> why is $(srcdir)/lib/ hard-coded? I use gllib instead of lib.
>
> 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.mk2011-05-16 
16:32:49.0 -0400
+++ /home2/sds/src/clisp/current/maint.mk   2011-05-16 17:20:23.0 
-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'
 
 # Convert the list of names to upper case, and replace each space with "|".
 az_ = abcdefghijklmnopqrstuvwxyz
@@ -718,7 +718,7 @@ gl_extract_significant_defines_ = \
 # of macros that are guaranteed to be defined by parts of gnulib.
 define def_sym_regex
gen_h=$(gl_generated_headers_); \
-   (cd $(gnulib_dir)/lib;  \
+   (cd $(gnulib_dir);  \
  for f in *.in.h $(gl_other_headers_); do  \
perl -lne '$(gl_extract_significant_defines_)' $$f; \
  done; \
@@ -1049,7 +1049,7 @@ writable-files:
  test "$$fail" && exit 1 || : ;\
fi
 
-v_etc_file = $(gnulib_dir)/lib/version-etc.c
+v_etc_file = $(gnulib_dir)/version-etc.c
 sample-test = tests/sample-test
 texi = doc/$(PACKAGE).texi
 # Make sure that the copyright date in $(v_etc_file) is up to date.

Diff finished.  Mon May 16 17:43:03 2011



-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://pmw.org.il http://www.memritv.org http://honestreporting.com
http://mideasttruth.com http://www.PetitionOnline.com/tap12009/
char*a="char*a=%c%s%c;main(){printf(a,34,a,34);}";main(){printf(a,34,a,34);}



Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?

2011-05-16 Thread Karl Berry
> warnings about HAVE_ALLOCA_H in ChangeLog, aclocal.m4, and configure.

Why should there ever be a warning about an occurrence of HAVE_ALLOCA_H
in the ChangeLog?  Just wondering.



Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?

2011-05-16 Thread Eric Blake
On 05/16/2011 03:16 PM, Sam Steingold wrote:
>> * Eric Blake  [2011-05-16 14:13:29 -0600]:
>>
>> Import that module, possibly add a cfg.mk counterpart (hmm, we
>> probably ought to provide a template file for that; but you can use
>> coreutils.git/cfg.mk for an idea of how it can be customized), use GNU
>> make, and run 'make syntax-check' to catch a number of consistency
>> errors.  If you decide that a particular syntax check is inappropriate
>> for your project, cfg.mk will let you omit it.
> 
> it looks useful but _very_ hard to actually use.
> 
> why is maint.mk put into my top dir?

Because that's where GNUmakefile looks for it.

> shouldn't it go to src/build-aux/?

Patches welcome, but for now, all projects using it have lived with it
in the top directory.

> why doesn't vc-list-files accept a list of directories?

Patches welcome; seems like a useful addition.

> (it would be 'src modules' for me)
> why is $(srcdir)/lib/ hard-coded? I use gllib instead of lib.

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.

> 
> when I managed to get it "running", I got
> warnings about HAVE_ALLOCA_H in ChangeLog, aclocal.m4, and configure.

You can add per-file exemptions to particular rules, either via
top-level .x-sc files or via entries in cfg.mk (the latter being fewer
files to maintain).

-- 
Eric Blake   ebl...@redhat.com+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?

2011-05-16 Thread Sam Steingold
> * Eric Blake  [2011-05-16 14:13:29 -0600]:
>
> Import that module, possibly add a cfg.mk counterpart (hmm, we
> probably ought to provide a template file for that; but you can use
> coreutils.git/cfg.mk for an idea of how it can be customized), use GNU
> make, and run 'make syntax-check' to catch a number of consistency
> errors.  If you decide that a particular syntax check is inappropriate
> for your project, cfg.mk will let you omit it.

it looks useful but _very_ hard to actually use.

why is maint.mk put into my top dir?
shouldn't it go to src/build-aux/?
why doesn't vc-list-files accept a list of directories?
(it would be 'src modules' for me)
why is $(srcdir)/lib/ hard-coded? I use gllib instead of lib.

when I managed to get it "running", I got
warnings about HAVE_ALLOCA_H in ChangeLog, aclocal.m4, and configure.

thanks for the pointer though...
-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://www.memritv.org http://openvotingconsortium.org http://camera.org
http://thereligionofpeace.com http://iris.org.il http://mideasttruth.com
Those who can't write, write manuals.



Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?

2011-05-16 Thread Eric Blake
On 05/16/2011 02:10 PM, Sam Steingold wrote:
>> Absolutely!  In fact, the maintainer-mode module includes the
>> sc_prohibit_always_true_header_tests to help you check for files where
>> you can unconditionally include headers guaranteed by gnulib replacements.
> 
> there is no maintainer-mode in gnulib/modules.

Sorry for my typo; 'maintainer-makefile'.

> how do I use it?

Import that module, possibly add a cfg.mk counterpart (hmm, we probably
ought to provide a template file for that; but you can use
coreutils.git/cfg.mk for an idea of how it can be customized), use GNU
make, and run 'make syntax-check' to catch a number of consistency
errors.  If you decide that a particular syntax check is inappropriate
for your project, cfg.mk will let you omit it.

-- 
Eric Blake   ebl...@redhat.com+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?

2011-05-16 Thread Sam Steingold
> * Eric Blake  [2011-05-16 13:56:46 -0600]:
>
> On 05/16/2011 01:53 PM, Sam Steingold wrote:
>> DIUC that if I include the sys_time & unistd modules, I can write
>> 
>> #include 
>> #include 
>> 
>> instead of
>> 
>> #ifdef HAVE_SYS_TIME_H
>>  #include 
>> #endif
>> #ifdef HAVE_UNISTD_H
>>   #include 
>> #endif
>> 
>> ??
>> 
>> the same question for all the other headers...
>
> Absolutely!  In fact, the maintainer-mode module includes the
> sc_prohibit_always_true_header_tests to help you check for files where
> you can unconditionally include headers guaranteed by gnulib replacements.

there is no maintainer-mode in gnulib/modules.
how do I use it?

thanks!

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://openvotingconsortium.org http://honestreporting.com
http://camera.org http://thereligionofpeace.com http://truepeace.org
Genius is immortal, but morons live longer.



Re: do I need "ifdef HAVE_UNISTD_H" if I import unistd?

2011-05-16 Thread Eric Blake
On 05/16/2011 01:53 PM, Sam Steingold wrote:
> DIUC that if I include the sys_time & unistd modules, I can write
> 
> #include 
> #include 
> 
> instead of
> 
> #ifdef HAVE_SYS_TIME_H
>  #include 
> #endif
> #ifdef HAVE_UNISTD_H
>   #include 
> #endif
> 
> ??
> 
> the same question for all the other headers...

Absolutely!  In fact, the maintainer-mode module includes the
sc_prohibit_always_true_header_tests to help you check for files where
you can unconditionally include headers guaranteed by gnulib replacements.

-- 
Eric Blake   ebl...@redhat.com+1-801-349-2682
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature


do I need "ifdef HAVE_UNISTD_H" if I import unistd?

2011-05-16 Thread Sam Steingold
DIUC that if I include the sys_time & unistd modules, I can write

#include 
#include 

instead of

#ifdef HAVE_SYS_TIME_H
 #include 
#endif
#ifdef HAVE_UNISTD_H
  #include 
#endif

??

the same question for all the other headers...

thanks!

-- 
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 
11.0.60900031
http://openvotingconsortium.org http://pmw.org.il http://palestinefacts.org
http://www.memritv.org http://honestreporting.com http://truepeace.org
Politically Correct Chess: Translucent VS. Transparent.