Fix `distdir' to use relative paths only.

2007-11-24 Thread Ralf Wildenhues
Hello,

Here's a suggestion for how to fix `distdir' to not depend on absolute
paths (so that users can build in a pwd that contains spaces).  It
reuses an algorithm from gnulib-tool's func_relativize (thanks, Bruno!)
to allow to compute a correct relative path even in the presence of
something like this in an inner Makefile.am:
  SUBDIRS = ../subdir2

(yes, there is a test like this in the Automake testsuite).

Does anybody see problems with it?

Cheers,
Ralf

Fix the distdir target to cope with spaces in absolute file names.

* lib/am/distdir.am: Quote all instances of $(distdir) and
$(top_distdir).  They could contain white space, coming from
a toplevel package bootstrapped with an older Automake version.
(am__relativize): New macro, taken from gnulib code, written by
Bruno Haible.
(distdir): Use it to compute relative paths to distdir and
top_distdir for enclosed subpackages.
Also, quote $(distuninstallcheck_dir).
* lib/am/texinfos.am: Likewise, quote $(distdir).

diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index ce547fd..fdafa9d 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006  Free Software
+## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007  Free Software
 ## Foundation, Inc.
 
 ## This program is free software; you can redistribute it and/or modify
@@ -25,11 +25,46 @@ distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
 
 am__remove_distdir = \
-  { test ! -d $(distdir) \
-|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
-  rm -fr $(distdir); }; }
+  { test ! -d $(distdir) \
+|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+  rm -fr $(distdir); }; }
+
 endif %?TOPDIR_P%
 
+if %?SUBDIRS%
+## computes a relative pathname RELDIR such that DIR1/RELDIR = DIR2.
+## Input:
+## - DIR1relative pathname, relative to the current directory
+## - DIR2relative pathname, relative to the current directory
+## Output:
+## - reldir  relative pathname of DIR2, relative to DIR1
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n $$dir1; do \
+first=`echo $$dir1 | sed -e $$sed_first`; \
+if test $$first != .; then \
+  if test $$first = ..; then \
+dir2=`echo $$dir0 | sed -e $$sed_last`/$$dir2; \
+dir0=`echo $$dir0 | sed -e $$sed_butlast`; \
+  else \
+first2=`echo $$dir2 | sed -e $$sed_first`; \
+if test $$first2 = $$first; then \
+  dir2=`echo $$dir2 | sed -e $$sed_rest`; \
+else \
+  dir2=../$$dir2; \
+fi; \
+dir0=$$dir0/$$first; \
+  fi; \
+fi; \
+dir1=`echo $$dir1 | sed -e $$sed_rest`; \
+  done; \
+  reldir=$$dir2
+endif %?SUBDIRS%
+
 .PHONY: distdir
 distdir: $(DISTFILES)
 ##
@@ -51,7 +86,7 @@ endif %?TOPDIR_P%
 ##
 if %?TOPDIR_P%
$(am__remove_distdir)
-   test -d $(distdir) || mkdir $(distdir)
+   test -d $(distdir) || mkdir $(distdir)
 endif %?TOPDIR_P%
 ##
 ##
@@ -140,15 +175,15 @@ endif %?TOPDIR_P%
 ## as Tru64) will magically create an empty directory in `.'
dir=`echo /$$file | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file  test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
-   cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+   cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
  else \
 ## Test for file existence because sometimes a file gets included in
 ## DISTFILES twice.  For example this happens when a single source
 ## file is used in building more than one program.
-   test -f $(distdir)/$$file \
-   || cp -p $$d/$$file $(distdir)/$$file \
+   test -f $(distdir)/$$file \
+   || cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
  fi; \
done
@@ -161,18 +196,26 @@ endif %?TOPDIR_P%
 ## directory, then we use `distdir' instead of `top_distdir'; this lets
 ## us work correctly with an enclosing package.
 ##
+## Note that in the computation of the relative subdir, we make one
+## crucial assumption: that we never leave the outermost distdir,
+## and that there is never a trailing `..' in $subdir.  Some sanity
+## has to be expected from the user.
 if %?SUBDIRS%
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
  if test $$subdir = .; then :; else \
test -d $(distdir)/$$subdir \
|| $(MKDIR_P) $(distdir)/$$subdir \
|| exit 1; \
-   distdir=`$(am__cd) $(distdir)  pwd`; \
-   top_distdir=`$(am__cd) $(top_distdir)  pwd`; \
+   dir1=$$subdir; 

[SCM] GNU Automake branch, master, updated. Release-1-10-73-g88d1f07

2007-11-24 Thread Ralf Wildenhues
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project GNU Automake.

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=88d1f07e102807518eef06b1ff5279bb40eb2202

The branch, master has been updated
   via  88d1f07e102807518eef06b1ff5279bb40eb2202 (commit)
  from  f7c36c783469a3fbf43c787d7899efd1000dc989 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 88d1f07e102807518eef06b1ff5279bb40eb2202
Author: Ralf Wildenhues [EMAIL PROTECTED]
Date:   Sat Nov 24 09:53:05 2007 +0100

* configure.ac (ACLOCAL, AUTOMAKE): Fix quoting for rebuilding
rules, if the absolute build directory name contains white space.

---

Summary of changes:
 ChangeLog|5 +
 configure|4 ++--
 configure.ac |6 +++---
 3 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 01ee065..6ab9e8e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-11-24  Ralf Wildenhues  [EMAIL PROTECTED]
+
+   * configure.ac (ACLOCAL, AUTOMAKE): Fix quoting for rebuilding
+   rules, if the absolute build directory name contains white space.
+
 2007-11-22  Ralf Wildenhues  [EMAIL PROTECTED]
 
* aclocal.in (trace_used_macros): Quote input files.
diff --git a/configure b/configure
index 0896601..64d26f0 100755
--- a/configure
+++ b/configure
@@ -2217,8 +2217,8 @@ pkgvdatadir=\${datadir}/$PACKAGE-$APIVERSION
 
 # $AUTOMAKE and $ACLOCAL are always run after a `cd $top_srcdir',
 # hence `.' is really what we want for perllibdir, libdir, and acdir.
-ACLOCAL=perllibdir=`pwd`\/lib$PATH_SEPARATOR./lib\ `pwd`/aclocal --acdir=m4 
-I m4
-AUTOMAKE=perllibdir=`pwd`\/lib$PATH_SEPARATOR./lib\ `pwd`/automake 
--libdir=lib
+ACLOCAL=perllibdir=\`pwd`/lib$PATH_SEPARATOR./lib\ \`pwd`/aclocal\ 
--acdir=m4 -I m4
+AUTOMAKE=perllibdir=\`pwd`/lib$PATH_SEPARATOR./lib\ \`pwd`/automake\ 
--libdir=lib
 
 # Extract the first word of perl, so it can be a program name with args.
 set dummy perl; ac_word=$2
diff --git a/configure.ac b/configure.ac
index 9e08204..1bf5577 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 # Process this file with autoconf to produce a configure script.
 
-# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2006,
+# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
 # 2004, 2006, 2007  Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -49,8 +49,8 @@ AC_SUBST([pkgvdatadir], [\${datadir}/$PACKAGE-$APIVERSION])
 
 # $AUTOMAKE and $ACLOCAL are always run after a `cd $top_srcdir',
 # hence `.' is really what we want for perllibdir, libdir, and acdir.
-ACLOCAL=perllibdir=`pwd`\/lib$PATH_SEPARATOR./lib\ `pwd`/aclocal --acdir=m4 
-I m4
-AUTOMAKE=perllibdir=`pwd`\/lib$PATH_SEPARATOR./lib\ `pwd`/automake 
--libdir=lib
+ACLOCAL=perllibdir=\`pwd`/lib$PATH_SEPARATOR./lib\ \`pwd`/aclocal\ 
--acdir=m4 -I m4
+AUTOMAKE=perllibdir=\`pwd`/lib$PATH_SEPARATOR./lib\ \`pwd`/automake\ 
--libdir=lib
 
 AC_PATH_PROG(PERL, perl)
 if test -z $PERL; then


hooks/post-receive
--
GNU Automake




FYI: fix Automake rebuilding rules

2007-11-24 Thread Ralf Wildenhues
Applied to master.

Cheers,
Ralf

* configure.ac (ACLOCAL, AUTOMAKE): Fix quoting for rebuilding
rules, if the absolute build directory name contains white space.

diff --git a/configure.ac b/configure.ac
index 9e08204..1bf5577 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 # Process this file with autoconf to produce a configure script.
 
-# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2006,
+# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
 # 2004, 2006, 2007  Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -49,8 +49,8 @@ AC_SUBST([pkgvdatadir], [\${datadir}/$PACKAGE-$APIVERSION])
 
 # $AUTOMAKE and $ACLOCAL are always run after a `cd $top_srcdir',
 # hence `.' is really what we want for perllibdir, libdir, and acdir.
-ACLOCAL=perllibdir=`pwd`\/lib$PATH_SEPARATOR./lib\ `pwd`/aclocal --acdir=m4 
-I m4
-AUTOMAKE=perllibdir=`pwd`\/lib$PATH_SEPARATOR./lib\ `pwd`/automake 
--libdir=lib
+ACLOCAL=perllibdir=\`pwd`/lib$PATH_SEPARATOR./lib\ \`pwd`/aclocal\ 
--acdir=m4 -I m4
+AUTOMAKE=perllibdir=\`pwd`/lib$PATH_SEPARATOR./lib\ \`pwd`/automake\ 
--libdir=lib
 
 AC_PATH_PROG(PERL, perl)
 if test -z $PERL; then




Re: Fix `distdir' to use relative paths only.

2007-11-24 Thread Ralf Wildenhues
* Ralf Wildenhues wrote on Sat, Nov 24, 2007 at 09:27:12AM CET:
 @@ -161,18 +196,26 @@ endif %?TOPDIR_P%
  ## directory, then we use `distdir' instead of `top_distdir'; this lets
  ## us work correctly with an enclosing package.
  ##
 +## Note that in the computation of the relative subdir, we make one
 +## crucial assumption: that we never leave the outermost distdir,
 +## and that there is never a trailing `..' in $subdir.  Some sanity
 +## has to be expected from the user.

Never mind this comment.  Just pretend it doesn't exist.

Cheers,
Ralf




It gits on my nerves

2007-11-24 Thread Akim Demaille

I have been fighting with git for almost two hours
to put my patches in order and to apply them upstream.
I wish I could have spent some time on the patches themselves,
but I guess it'll come once I understand how git works :(

I'm stuck here, and I'm tired of it.  I can't seem to be
able to do what I want with a single repo, so I checkout
zillions of repos, I'll see later how git can really space,
I just want to be able to check this in.  Any help (*simple*
help, I don't need a lecture, I just want to type what's
needed for this to work and enjoy my weekend) appreciated!

  117  git clone git://git.sv.gnu.org/automake.git
  118  git branch ws master
  119  ls
  120  cd automake
  121  git branch ws master
  122  git diff
  123  git commit
  124  git commit -a
  125git checkout master
  126  history
  127  git pull
  128  git show
  129  git rebase master
  130  git merge ws
  131  git show
  132  git push
[EMAIL PROTECTED] ~/src/wd/automake $ git push   
10:11:43

fatal: The remote end hung up unexpectedly
error: failed to push to 'git://git.sv.gnu.org/automake.git'

Thanks!




Re: It gits on my nerves

2007-11-24 Thread Akim Demaille


Le 24 nov. 07 à 10:18, Akim Demaille a écrit :

[EMAIL PROTECTED] ~/src/wd/automake $ git  
push  10:11:43

fatal: The remote end hung up unexpectedly
error: failed to push to 'git://git.sv.gnu.org/automake.git'


I have found pages reporting that this message is related to
permissions.  I suggest that the Automake page [1] make it clearer
that one should not use git:// to get write permissions.  Pointing
to Savannah's page about Git [2] would be very useful.

[EMAIL PROTECTED] ~/src/wd/automake $ git config remote.origin.url ssh://[EMAIL 
PROTECTED]/automake.git
[EMAIL PROTECTED] ~/src/wd/automake $ git push
fatal: '/automake.git': unable to chdir or not a git archive
fatal: The remote end hung up unexpectedly
error: failed to push to 'ssh://[EMAIL PROTECTED]/automake.git'

The problem is now that I don't seem to have write permissions
on Automake [3].  Could someone add me please?  Thanks in advance.

[1] http://sources.redhat.com/automake/
[2] http://savannah.gnu.org/maintenance/UsingGit
[3] http://savannah.gnu.org/project/memberlist.php?group=automake



Re: It gits on my nerves

2007-11-24 Thread Akim Demaille


Le 24 nov. 07 à 10:58, Akim Demaille a écrit :


[EMAIL PROTECTED] ~/src/wd/automake $ git config remote.origin.url ssh://[EMAIL 
PROTECTED]/automake.git


Fixed.

[EMAIL PROTECTED] ~/src/wd/automake $ git config remote.origin.url ssh://[EMAIL 
PROTECTED]/srv/git/automake.git

[EMAIL PROTECTED] ~/src/wd/automake $ git push   
11:00:47

updating 'refs/heads/master'
  from 88d1f07e102807518eef06b1ff5279bb40eb2202
  to   1d0c65c8894d499ad034c9cc189808d4ecd3db5c
 Also local refs/remotes/origin/master
Generating pack...
Done counting 4 objects.
Deltifying 4 objects...
 100% (4/4) done
Writing 4 objects...
 100% (4/4) done
Total 4 (delta 0), reused 0 (delta 0)
error: unable to create temporary sha1 filename ./objects/ 
tmp_obj_OVLl9H: Permission denied


fatal: failed to write object
unpack unpacker exited with error code
ng refs/heads/master n/a (unpacker error)
error: failed to push to 'ssh://[EMAIL PROTECTED]/srv/git/automake.git'


Someone seems to have added me though (thanks!).



Re: It gits on my nerves

2007-11-24 Thread Jim Meyering
Akim Demaille [EMAIL PROTECTED] wrote:
 The problem is now that I don't seem to have write permissions
 on Automake [3].  Could someone add me please?  Thanks in advance.

Hi Akim,

I've just added you.




Re: It gits on my nerves

2007-11-24 Thread Ralf Wildenhues
Hello Akim,

* Akim Demaille wrote on Sat, Nov 24, 2007 at 10:18:30AM CET:
 I have been fighting with git for almost two hours
 to put my patches in order and to apply them upstream.

I'm really sorry it's so much trouble for you.

   117  git clone git://git.sv.gnu.org/automake.git

This is a read-only checkout.  You need to use the git+ssh protocol in
order to do writes:
  git clone ssh://[EMAIL PROTECTED]/srv/git/automake.git

(assuming akim is your login).
http://savannah.gnu.org/maintenance/UsingGit explains it.


   118  git branch ws master

OK, here you needed to `cd automake' first.

   119  ls
   120  cd automake
   121  git branch ws master

This creates branch ws but still leaves your current tree showing
master.

[...]

Maybe it helps if I show how I work:

- doing some work

# first, create a feature branch and check it out:
git checkout -b my-work-branch master

# Now, hack away:
while $not_done; do
  $edit
  git add changed-files
  git commit
done


- getting third-party changes into my tree:

# ensure your current tree is clean (all changes committed etc)...
# then, go back to master:
git checkout master
# get changes from upstream:
git pull
# now rebase my feature branch upon the new upstream tree:
git checkout my-work-branch
# (this may require multiple merging steps, read the output):
git rebase master


- publishing my finished changes:

# first, ensure my master is up to date wrt. upstream (see above).
# then, merge feature branch into master branch:
git checkout master
git merge my-work-branch
# (if you rebased the branch, then this should be a fast-forward.)

# now, finally publish:
git push


Hope that helps a bit.  Again, I'm happy to apply patches for you if you
like.

Cheers,
Ralf




Re: It gits on my nerves

2007-11-24 Thread Ralf Wildenhues
* Akim Demaille wrote on Sat, Nov 24, 2007 at 10:58:02AM CET:
 Le 24 nov. 07 à 10:18, Akim Demaille a écrit :
 
 [EMAIL PROTECTED] ~/src/wd/automake $ git  
 push  10:11:43
 fatal: The remote end hung up unexpectedly
 error: failed to push to 'git://git.sv.gnu.org/automake.git'
 
 I have found pages reporting that this message is related to
 permissions.  I suggest that the Automake page [1] make it clearer
 that one should not use git:// to get write permissions.  Pointing
 to Savannah's page about Git [2] would be very useful.

Done, thanks!

Cheers,
Ralf




Re: It gits on my nerves

2007-11-24 Thread Akim Demaille


Le 24 nov. 07 à 11:03, Ralf Wildenhues a écrit :


Hello Akim,

* Akim Demaille wrote on Sat, Nov 24, 2007 at 10:18:30AM CET:

I have been fighting with git for almost two hours
to put my patches in order and to apply them upstream.


I'm really sorry it's so much trouble for you.


It's because I'd like to use it without taking the time
to RTFM, so of course I'm inefficient, wasting not only
my time, but yours too :(  Sorry about this.

Thanks for the help!


Maybe it helps if I show how I work:


What I have been trying to do is making many changes
in  single tree, and them checking them in in different
branches, sort of a mixture between my usual svn method
(several changes, and svn ci FILES to select how I
serialize them) and git (making branches).  But I
couldn't find how to go back to the remote master
except by cloning several times.

I'm try to be more gitty from now on, and stop being svnish.





Re: It gits on my nerves

2007-11-24 Thread Ralf Wildenhues
* Akim Demaille wrote on Sat, Nov 24, 2007 at 11:16:57AM CET:
 
 What I have been trying to do is making many changes
 in  single tree, and them checking them in in different
 branches, sort of a mixture between my usual svn method
 (several changes, and svn ci FILES to select how I
 serialize them) and git (making branches).

I work roughly similar.  I hack away on a branch that contains
all kinds of ugly and unfinished changes.  Then to get more
organized, I create another branch (off of master) and merge or
cherry-pick the changes from the other branch.  The git manual
describes this in the creating the perfect patch series
chapter.

 But I
 couldn't find how to go back to the remote master
 except by cloning several times.

Hmm.  Do you mean something like
  git checkout [-b newbranch] origin/master

?

 I'm try to be more gitty from now on, and stop being svnish.

;-)

Cheers,
Ralf




[SCM] GNU Automake branch, master, updated. Release-1-10-75-g94e81d5

2007-11-24 Thread Akim Demaille
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project GNU Automake.

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=94e81d5582c92a4376744bc5e601f60773f63e71

The branch, master has been updated
   via  94e81d5582c92a4376744bc5e601f60773f63e71 (commit)
  from  1d0c65c8894d499ad034c9cc189808d4ecd3db5c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 94e81d5582c92a4376744bc5e601f60773f63e71
Author: Akim Demaille [EMAIL PROTECTED]
Date:   Sat Nov 24 12:24:22 2007 +0100

Ternary operator in lib/am files.

* automake.in (transform_token): New.
(transform): Use it.
Support %KEY?TRUE:FALSE%.
(make_paragraphs): Adjust the regexp to call %transform.
* lib/am/data.am, lib/am/libs.am, lib/am/lisp.am, lib/am/ltlib.am,
* lib/am/progs.am, lib/am/python.am, lib/am/scripts.am:
Use %KEY?TRUE:FALSE%.
* lib/am/inst-vars.am (am__strip_dir): Assign the result to f
to be more alike am__vpath_adj.
Adjust dependencies.

Signed-off-by: Akim Demaille [EMAIL PROTECTED]

---

Summary of changes:
 ChangeLog|   14 
 automake.in  |   79 +++---
 doc/Makefile.in  |   22 ++--
 lib/Automake/Makefile.in |   10 +++---
 lib/Makefile.in  |   10 +++---
 lib/am/Makefile.in   |6 ++--
 lib/am/data.am   |   17 +++--
 lib/am/inst-vars.am  |4 +-
 lib/am/libs.am   |   16 -
 lib/am/lisp.am   |   14 +++-
 lib/am/ltlib.am  |   19 +--
 lib/am/progs.am  |6 +--
 lib/am/python.am |   20 ---
 lib/am/scripts.am|   14 +++-
 lib/am/texinfos.am   |   16 +-
 m4/Makefile.in   |6 ++--
 16 files changed, 144 insertions(+), 129 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5fecbf8..a9c28e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2007-11-24  Akim Demaille  [EMAIL PROTECTED]
+
+   Ternary operator in lib/am files.
+   * automake.in (transform_token): New.
+   (transform): Use it.
+   Support %KEY?TRUE:FALSE%.
+   (make_paragraphs): Adjust the regexp to call %transform.
+   * lib/am/data.am, lib/am/libs.am, lib/am/lisp.am, lib/am/ltlib.am,
+   * lib/am/progs.am, lib/am/python.am, lib/am/scripts.am:
+   Use %KEY?TRUE:FALSE%.
+   * lib/am/inst-vars.am (am__strip_dir): Assign the result to f
+   to be more alike am__vpath_adj.
+   Adjust dependencies.
+
 2007-11-24  Akim Demaille  [EMAIL PROTECTED]
 
* automake.in: Normalize white spaces.
diff --git a/automake.in b/automake.in
index 17d0241..efad097 100755
--- a/automake.in
+++ b/automake.in
@@ -6399,39 +6399,63 @@ sub flatten
   return $_;
 }
 
-# transform($TOKEN, \%PAIRS)
-# ==
+
+# transform_token ($TOKEN, \%PAIRS, $KEY)
+# ===
+# Return the value associated to $KEY in %PAIRS, as used on $TOKEN
+# (which should be ?KEY? or any of the special %% requests)..
+sub transform_token ($$$)
+{
+  my ($token, $transform, $key) = @_;
+  my $res = $transform-{$key};
+  prog_error Unknown key `$key' in `$token' unless defined $res;
+  return $res;
+}
+
+
+# transform ($TOKEN, \%PAIRS)
+# ===
 # If ($TOKEN, $VAL) is in %PAIRS:
-#   - replaces %$TOKEN% with $VAL,
-#   - enables/disables ?$TOKEN? and ?!$TOKEN?,
-#   - replaces %?$TOKEN% with TRUE or FALSE.
-sub transform($$)
+#   - replaces %KEY% with $VAL,
+#   - enables/disables ?KEY? and ?!KEY?,
+#   - replaces %?KEY% with TRUE or FALSE.
+#   - replaces %KEY?IFTRUE%, %KEY:IFFALSE%, and %KEY?IFTRUE:IFFALSE% with
+# IFTRUE / IFFALSE, as appropriate.
+sub transform ($$)
 {
   my ($token, $transform) = @_;
 
-  if (substr ($token, 0, 1) eq '%')
+  # %KEY%.
+  # Must be before the following pattern to exclude the case
+  # when there is neither IFTRUE nor IFFALSE.
+  if ($token =~ /^%([\w\-]+)%$/)
 {
-  my $cond = (substr ($token, 1, 1) eq '?') ? 1 : 0;
-  $token = substr ($token, 1 + $cond, -1);
-  my $val = $transform-{$token};
-  prog_error Unknown %token% `$token' unless defined $val;
-  if ($cond)
-   {
- return $val ? 'TRUE' : 'FALSE';
-   }
-  else
-   {
- return $val;
-   }
+  return transform_token ($token, $transform, $1);
+}
+  # %KEY?IFTRUE%, %KEY:IFFALSE%, and %KEY?IFTRUE:IFFALSE%.
+  elsif ($token =~ /^%([\w\-]+)(?:\?([^?:%]+))?(?::([^?:%]+))?%$/)
+{
+  return transform_token ($token, $transform, $1) ? ($2 || '') : ($3 || 
'');
+  

[SCM] GNU Automake branch, master, updated. Release-1-10-76-g9c7aee9

2007-11-24 Thread Akim Demaille
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project GNU Automake.

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=9c7aee991634ac47e207fe54730afaa1b67dd2dc

The branch, master has been updated
   via  9c7aee991634ac47e207fe54730afaa1b67dd2dc (commit)
  from  94e81d5582c92a4376744bc5e601f60773f63e71 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
commit 9c7aee991634ac47e207fe54730afaa1b67dd2dc
Author: Akim Demaille [EMAIL PROTECTED]
Date:   Sat Nov 24 15:02:41 2007 +0100

Skip comments and empty lines in dirlist in the tests.

* defs.in (extra_includes): Skip comments and empty lines in dirlist.

Signed-off-by: Akim Demaille [EMAIL PROTECTED]

---

Summary of changes:
 ChangeLog |5 +
 tests/defs.in |9 -
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a9c28e4..12fc568 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2007-11-24  Akim Demaille  [EMAIL PROTECTED]
 
+   Skip comments and empty lines in dirlist in the tests.
+   * defs.in (extra_includes): Skip comments and empty lines in dirlist.
+
+2007-11-24  Akim Demaille  [EMAIL PROTECTED]
+
Ternary operator in lib/am files.
* automake.in (transform_token): New.
(transform): Use it.
diff --git a/tests/defs.in b/tests/defs.in
index d79d874..107bfe8 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -299,11 +299,10 @@ case $required in
 aclocaldir='@prefix@/share/aclocal'
 extra_includes=
 if test -f $aclocaldir/dirlist; then
-   extra_includes=`(tmp_inc=
-   while read LINE ; do
- tmp_inc=$tmp_inc -I $LINE
-   done
-   echo $tmp_inc)  $aclocaldir/dirlist`
+   extra_includes=`
+   $aclocaldir/dirlist \
+   sed -ne 's/#.*//;s/[ ][  ]*$//g;s/..*/ -I /p' |
+tr -d '\n'`
 else :; fi
 
 libtool_found=no


hooks/post-receive
--
GNU Automake




Re: It gits on my nerves

2007-11-24 Thread Ben Pfaff
Ralf Wildenhues [EMAIL PROTECTED] writes:

 I work roughly similar.  I hack away on a branch that contains
 all kinds of ugly and unfinished changes.  Then to get more
 organized, I create another branch (off of master) and merge or
 cherry-pick the changes from the other branch.  The git manual
 describes this in the creating the perfect patch series
 chapter.

This works just fine, of course.  Recently, I discovered the
fairly new command git rebase --interactive, which can
sometimes be even easier.  You might check it out, if you are not
already aware of it.
-- 
Ben Pfaff 
http://benpfaff.org