From bbb593693036c1aaea1e262a2d023aae5cfb35f2 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 25 Sep 2008 16:02:58 +0200 Subject: [PATCH] Oops, tweak last commit so that it also works in the first gnulib-tool run. --- ChangeLog | 5 +++++ gnulib-tool | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8098603e1..d49d1a87d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-09-25 Bruno Haible + + * gnulib-tool (func_import): When computing the edits, consider not + only the Makefile.ams that exist but also those that will be generated. + 2008-09-25 Simon Josefsson * modules/sys_select-tests (Depends-on): Remove sys_select itself, diff --git a/gnulib-tool b/gnulib-tool index ffeaefb69..40527683e 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -2929,12 +2929,19 @@ func_import () fi func_note_Makefile_am_edit "" ACLOCAL_AMFLAGS "-I ${m4base}" { - # Find the first parent directory of $m4base that contains a Makefile.am. + # Find the first parent directory of $m4base that contains or will contain + # a Makefile.am. sed_last='s,^.*/\([^/][^/]*\)//*$,\1/, s,//*$,/,' sed_butlast='s,[^/][^/]*//*$,,' dir1="${m4base}/"; dir2="" - while test -n "$dir1" && test ! -f "${destdir}/${dir1}Makefile.am"; do + while test -n "$dir1" \ + && ! { test -f "${destdir}/${dir1}Makefile.am" \ + || test "${dir1}Makefile.am" = "$sourcebase/$makefile_am" \ + || test "./${dir1}Makefile.am" = "$sourcebase/$makefile_am" \ + || { test -n "$inctests" \ + && { test "${dir1}Makefile.am" = "$testsbase/$makefile_am" \ + || test "./${dir1}Makefile.am" = "$testsbase/$makefile_am"; }; }; }; do dir2=`echo "$dir1" | sed -e "$sed_last"`"$dir2" dir1=`echo "$dir1" | sed -e "$sed_butlast"` done -- 2.11.0