bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Generalize GNUmakefile, ...


From: Bruno Haible
Subject: Re: [PATCH] Generalize GNUmakefile, ...
Date: Sun, 23 Mar 2008 14:27:52 +0100
User-agent: KMail/1.5.4

Eric Blake wrote:
> | enhance gnulib-tool with a filename rewriting rule that transforms
> |   $GNULIBDIR/top/GNUmakefile   -->   $PACKAGEDIR/GNUmakefile
> 
> How about like this?

It's the right direction, but in the gnulib-tool part, a few things can be
done better:
  - In the first hunk, the indentation.
  - The second and third hunk are unnecessary: The user should simply use
    the filename without leading top/ in his Makefile.am snippet.
  - The fourth and fifth hunk don't need to introduce absolute filenames.

I'm applying this, for the gnulib-tool part.

2008-03-23  Eric Blake  <address@hidden>
            Bruno Haible  <address@hidden>

        Install files from top/ in the destination directory.
        * gnulib-tool (func_get_automake_snippet): Synthesize an EXTRA_DIST
        augmentation also for the files from top/.
        (func_import, func_create_testdir): Rewrite file names:
        top/filename -> filename.

*** gnulib-tool.orig    2008-03-23 14:18:06.000000000 +0100
--- gnulib-tool 2008-03-23 14:15:16.000000000 +0100
***************
*** 1370,1375 ****
--- 1370,1386 ----
          echo "EXTRA_DIST += "`echo "$buildaux_files" | sed -e 
"$sed_prepend_auxdir"`
          echo
        fi
+       # Synthesize an EXTRA_DIST augmentation also for the files from top/.
+       top_files=`for f in $all_files; do \
+                    case $f in \
+                      top/*) echo $f ;; \
+                    esac; \
+                  done | sed -e 's,^top/,,'`
+       if test -n "$top_files"; then
+         sed_prepend_topdir='s,^,$(top_srcdir)/,'
+         echo "EXTRA_DIST += "`echo "$top_files" | sed -e 
"$sed_prepend_topdir"`
+         echo
+       fi
        ;;
    esac
  }
***************
*** 2505,2518 ****
      s,^lib/,$cached_sourcebase/,
      s,^m4/,$cached_m4base/,
      s,^tests/,$cached_testsbase/,
!     s,^tests=lib/,$cached_testsbase/,"
    sed_rewrite_new_files="\
      s,^build-aux/,$auxdir/,
      s,^doc/,$docbase/,
      s,^lib/,$sourcebase/,
      s,^m4/,$m4base/,
      s,^tests/,$testsbase/,
!     s,^tests=lib/,$testsbase/,"
  
    # Create directories.
    { echo "$sourcebase"
--- 2516,2531 ----
      s,^lib/,$cached_sourcebase/,
      s,^m4/,$cached_m4base/,
      s,^tests/,$cached_testsbase/,
!     s,^tests=lib/,$cached_testsbase/,
!     s,^top/,,"
    sed_rewrite_new_files="\
      s,^build-aux/,$auxdir/,
      s,^doc/,$docbase/,
      s,^lib/,$sourcebase/,
      s,^m4/,$m4base/,
      s,^tests/,$testsbase/,
!     s,^tests=lib/,$testsbase/,
!     s,^top/,,"
  
    # Create directories.
    { echo "$sourcebase"
***************
*** 3444,3450 ****
      s,^doc/,$docbase/,
      s,^lib/,$sourcebase/,
      s,^m4/,$m4base/,
!     s,^tests/,$testsbase/,"
  
    # Create directories.
    for f in $files; do echo $f; done \
--- 3457,3464 ----
      s,^doc/,$docbase/,
      s,^lib/,$sourcebase/,
      s,^m4/,$m4base/,
!     s,^tests/,$testsbase/,
!     s,^top/,,"
  
    # Create directories.
    for f in $files; do echo $f; done \





reply via email to

[Prev in Thread] Current Thread [Next in Thread]