#! /bin/sh
#
-# Copyright (C) 2002-2008 Free Software Foundation, Inc.
+# Copyright (C) 2002-2009 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# - modules list of modules, including 'dummy' if needed
func_modules_add_dummy ()
{
+ # Determine whether any module provides a lib_SOURCES augmentation.
have_lib_SOURCES=
sed_remove_backslash_newline=':a
/\\$/{
# Ignore .h files since they are not compiled.
case "$file" in
*.h) ;;
- *) have_lib_SOURCES=yes ;;
+ *)
+ have_lib_SOURCES=yes
+ break 2
+ ;;
esac
done
fi
# Test whether there are some source files in subdirectories.
for f in `func_get_filelist "$module"`; do
case $f in
- lib/*/*.c) uses_subdirs=yes ;;
+ lib/*/*.c)
+ uses_subdirs=yes
+ break
+ ;;
esac
done
fi
# Test whether there are some source files in subdirectories.
for f in `func_get_filelist "$module"`; do
case $f in
- lib/*/*.c | tests/*/*.c) uses_subdirs=yes ;;
+ lib/*/*.c | tests/*/*.c)
+ uses_subdirs=yes
+ break
+ ;;
esac
done
fi
func_verify_nontests_module
if test -n "$module"; then
all_files=`func_get_filelist $module`
- lib_files=`for f in $all_files; do \
- case $f in \
- lib/*) echo $f ;; \
- esac; \
- done | sed -e 's,^lib/,,'`
- if test -n "$lib_files"; then
- use_libtests=true
- break
- fi
+ # Test whether some file in $all_files lies in lib/.
+ for f in $all_files; do
+ case $f in
+ lib/*)
+ use_libtests=true
+ break 2
+ ;;
+ esac
+ done
fi
done
sed -e "s|^$anchor||" < "$destdir/$dir$ignore" | LC_ALL=C sort > "$tmp"/ignore
(func_reset_sigpipe
echo "$dir_added" | sed -e '/^$/d' | LC_ALL=C sort -u \
- | LC_ALL=C join -v 2 "$tmp"/ignore - > "$tmp"/ignore-added
+ | LC_ALL=C join -v 1 - "$tmp"/ignore > "$tmp"/ignore-added
echo "$dir_removed" | sed -e '/^$/d' | LC_ALL=C sort -u \
- | LC_ALL=C join -v 2 "$tmp"/ignore - > "$tmp"/ignore-removed
+ | LC_ALL=C join -v 1 - "$tmp"/ignore > "$tmp"/ignore-removed
)
if test -s "$tmp"/ignore-added || test -s "$tmp"/ignore-removed; then
if $doit; then
echo "Updating $destdir/$dir$ignore (backup in $destdir/$dir${ignore}~)"
mv -f "$destdir/$dir$ignore" "$destdir/$dir$ignore"~
- { sed -e 's,^,/^,' -e 's,$,\$/d,' < "$tmp"/ignore-removed
- if test -n "$anchor"; then sed -e "s,^,/^${doubly_escaped_anchor}," -e 's,$,\$/d,' < "$tmp"/ignore-removed; fi
+ { sed -e 's,/,\\/,g' -e 's,^,/^,' -e 's,$,\$/d,' < "$tmp"/ignore-removed
+ if test -n "$anchor"; then sed -e 's,/,\\/,g' -e "s,^,/^${doubly_escaped_anchor}," -e 's,$,\$/d,' < "$tmp"/ignore-removed; fi
} > "$tmp"/sed-ignore-removed
{ cat "$destdir/$dir$ignore"~
sed -e "s|^|$anchor|" < "$tmp"/ignore-added
if test -f $m4base/gettext.m4; then
func_execute_command ${AUTOPOINT} --force || func_exit 1
for f in $m4base/*.m4~; do
- mv -f $f `echo $f | sed -e 's,~$,,'` || func_exit 1
+ if test -f $f; then
+ mv -f $f `echo $f | sed -e 's,~$,,'` || func_exit 1
+ fi
done
fi
func_execute_command ${ACLOCAL} -I $m4base || func_exit 1
if test -f ../$m4base/gettext.m4; then
func_execute_command ${AUTOPOINT} --force || func_exit 1
for f in ../$m4base/*.m4~; do
- mv -f $f `echo $f | sed -e 's,~$,,'` || func_exit 1
+ if test -f $f; then
+ mv -f $f `echo $f | sed -e 's,~$,,'` || func_exit 1
+ fi
done
fi
func_execute_command ${ACLOCAL} -I ../$m4base || func_exit 1