[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Required files are only added once, even if two are needed.
From: |
Marius Vollmer |
Subject: |
Required files are only added once, even if two are needed. |
Date: |
17 Apr 2002 11:19:08 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 |
Hi,
I believe the following is a bug in automake 1.6.1.
When automake is instructed to install missing files, it will only do
so for one copy of each file although sometimes more than one is
needed. For example, in a package that has two subdirs containing
texi documentation, the first run of automake will install texinfo.tex
only in the first subdir. A second run of automake will then install
texinfo.tex in the second subdir, but that should have been done
during the first run already.
This happens because automake keeps a list of already added files, and
will refuse to add a file twice, even when the second copy would go to
a different directory.
(You might say it is a waste to have two identical copies of a file in
a package, and automake might warn about this, but it should work
nevertheless.)
Please see the attached example for more details. Extract the shar
somewhere, cd into the newly created automake-bug directory, and
observe:
$ aclocal
$ automake -a --foreign
one/Makefile.am:1: installing `one/mdate-sh'
one/Makefile.am:1: installing `one/texinfo.tex'
$ automake -a --foreign
two/Makefile.am:1: installing `two/mdate-sh'
two/Makefile.am:1: installing `two/texinfo.tex'
$ automake -a --foreign
$
It takes two runs of automake to add the missing files to both
directories. The third run finds everything to be in place.
What do you say?
#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2c).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 2002-04-17 11:02 CEST by <address@hidden>.
# Source directory was `/home/mvo/src/work/hacks'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 102 -rw-r--r-- automake-bug/configure.in
# 18 -rw-r--r-- automake-bug/Makefile.am
# 25 -rw-r--r-- automake-bug/one/Makefile.am
# 45 -rw-r--r-- automake-bug/one/one.texi
# 25 -rw-r--r-- automake-bug/two/Makefile.am
# 45 -rw-r--r-- automake-bug/two/two.texi
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
if test "$gettext_dir" = FAILED && test -f $dir/gettext \
&& ($dir/gettext --version >/dev/null 2>&1)
then
set `$dir/gettext --version 2>&1`
if test "$3" = GNU
then
gettext_dir=$dir
fi
fi
if test "$locale_dir" = FAILED && test -f $dir/shar \
&& ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
then
locale_dir=`$dir/shar --print-text-domain-dir`
fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
echo=echo
else
TEXTDOMAINDIR=$locale_dir
export TEXTDOMAINDIR
TEXTDOMAIN=sharutils
export TEXTDOMAIN
echo="$gettext_dir/gettext -s"
fi
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
shar_n= shar_c='
'
else
shar_n=-n shar_c=
fi
else
shar_n= shar_c='\c'
fi
if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f
200112312359.59 -a -f $$.touch; then
shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f
123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then
shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a
-f $$.touch; then
shar_touch='touch -am $3$4$5$6$2 "$8"'
else
shar_touch=:
echo
$echo 'WARNING: not restoring timestamps. Consider getting and'
$echo "installing GNU \`touch', distributed in GNU File Utilities..."
echo
fi
rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch
#
$echo $shar_n 'x -' 'lock directory' "\`_sh08924': "$shar_c
if mkdir _sh08924; then
$echo 'created'
else
$echo 'failed to create'
exit 1
fi
# ============= automake-bug/configure.in ==============
if test ! -d 'automake-bug'; then
$echo $echo_n 'x -' 'automake-bug: '$echo_c
if mkdir 'automake-bug'; then $echo 'created'; else $echo 'failed to create';
fi
fi
if test -f 'automake-bug/configure.in' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'automake-bug/configure.in' '(file already exists)'
else
$echo 'x -' extracting 'automake-bug/configure.in' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'automake-bug/configure.in' &&
AC_INIT
AM_INIT_AUTOMAKE(foo, 1.0)
X
AC_OUTPUT(Makefile
X one/Makefile
X two/Makefile)
SHAR_EOF
(set 20 02 04 17 10 54 46 'automake-bug/configure.in'; eval "$shar_touch") &&
chmod 0644 'automake-bug/configure.in' ||
$echo 'restore of' 'automake-bug/configure.in' 'failed'
if ( md5sum --help </dev/null 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1
\
&& ( md5sum --version </dev/null 2>&1 | grep -v 'textutils 1.12' )
>/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'automake-bug/configure.in:' 'MD5 check failed'
67605153047312c2ce9a371349fdb55a automake-bug/configure.in
SHAR_EOF
else
shar_count="`LC_ALL=C wc -c < 'automake-bug/configure.in'`"
test 102 -eq "$shar_count" ||
$echo 'automake-bug/configure.in:' 'original size' '102,' 'current size'
"$shar_count!"
fi
fi
# ============= automake-bug/Makefile.am ==============
if test -f 'automake-bug/Makefile.am' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'automake-bug/Makefile.am' '(file already exists)'
else
$echo 'x -' extracting 'automake-bug/Makefile.am' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'automake-bug/Makefile.am' &&
SUBDIRS = one two
SHAR_EOF
(set 20 02 04 17 10 50 05 'automake-bug/Makefile.am'; eval "$shar_touch") &&
chmod 0644 'automake-bug/Makefile.am' ||
$echo 'restore of' 'automake-bug/Makefile.am' 'failed'
if ( md5sum --help </dev/null 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1
\
&& ( md5sum --version </dev/null 2>&1 | grep -v 'textutils 1.12' )
>/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'automake-bug/Makefile.am:' 'MD5 check failed'
5a7734e40a701a0b349e0ab7a998131f automake-bug/Makefile.am
SHAR_EOF
else
shar_count="`LC_ALL=C wc -c < 'automake-bug/Makefile.am'`"
test 18 -eq "$shar_count" ||
$echo 'automake-bug/Makefile.am:' 'original size' '18,' 'current size'
"$shar_count!"
fi
fi
# ============= automake-bug/one/Makefile.am ==============
if test ! -d 'automake-bug/one'; then
$echo $echo_n 'x -' 'automake-bug/one: '$echo_c
if mkdir 'automake-bug/one'; then $echo 'created'; else $echo 'failed to
create'; fi
fi
if test -f 'automake-bug/one/Makefile.am' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'automake-bug/one/Makefile.am' '(file already exists)'
else
$echo 'x -' extracting 'automake-bug/one/Makefile.am' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'automake-bug/one/Makefile.am' &&
info_TEXINFOS = one.texi
SHAR_EOF
(set 20 02 04 17 10 50 30 'automake-bug/one/Makefile.am'; eval "$shar_touch")
&&
chmod 0644 'automake-bug/one/Makefile.am' ||
$echo 'restore of' 'automake-bug/one/Makefile.am' 'failed'
if ( md5sum --help </dev/null 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1
\
&& ( md5sum --version </dev/null 2>&1 | grep -v 'textutils 1.12' )
>/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'automake-bug/one/Makefile.am:' 'MD5 check failed'
30eabfc224aea4660a9e2f3aeb5b0e15 automake-bug/one/Makefile.am
SHAR_EOF
else
shar_count="`LC_ALL=C wc -c < 'automake-bug/one/Makefile.am'`"
test 25 -eq "$shar_count" ||
$echo 'automake-bug/one/Makefile.am:' 'original size' '25,' 'current size'
"$shar_count!"
fi
fi
# ============= automake-bug/one/one.texi ==============
if test -f 'automake-bug/one/one.texi' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'automake-bug/one/one.texi' '(file already exists)'
else
$echo 'x -' extracting 'automake-bug/one/one.texi' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'automake-bug/one/one.texi' &&
@setfilename one.info
X
@include version.texi
SHAR_EOF
(set 20 02 04 17 10 57 48 'automake-bug/one/one.texi'; eval "$shar_touch") &&
chmod 0644 'automake-bug/one/one.texi' ||
$echo 'restore of' 'automake-bug/one/one.texi' 'failed'
if ( md5sum --help </dev/null 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1
\
&& ( md5sum --version </dev/null 2>&1 | grep -v 'textutils 1.12' )
>/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'automake-bug/one/one.texi:' 'MD5 check failed'
a5a4c5c50a4606b3fa38e0757a00760d automake-bug/one/one.texi
SHAR_EOF
else
shar_count="`LC_ALL=C wc -c < 'automake-bug/one/one.texi'`"
test 45 -eq "$shar_count" ||
$echo 'automake-bug/one/one.texi:' 'original size' '45,' 'current size'
"$shar_count!"
fi
fi
# ============= automake-bug/two/Makefile.am ==============
if test ! -d 'automake-bug/two'; then
$echo $echo_n 'x -' 'automake-bug/two: '$echo_c
if mkdir 'automake-bug/two'; then $echo 'created'; else $echo 'failed to
create'; fi
fi
if test -f 'automake-bug/two/Makefile.am' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'automake-bug/two/Makefile.am' '(file already exists)'
else
$echo 'x -' extracting 'automake-bug/two/Makefile.am' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'automake-bug/two/Makefile.am' &&
info_TEXINFOS = two.texi
SHAR_EOF
(set 20 02 04 17 10 55 21 'automake-bug/two/Makefile.am'; eval "$shar_touch")
&&
chmod 0644 'automake-bug/two/Makefile.am' ||
$echo 'restore of' 'automake-bug/two/Makefile.am' 'failed'
if ( md5sum --help </dev/null 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1
\
&& ( md5sum --version </dev/null 2>&1 | grep -v 'textutils 1.12' )
>/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'automake-bug/two/Makefile.am:' 'MD5 check failed'
7e22c9e70dfa3cd37f591f5cf4629c73 automake-bug/two/Makefile.am
SHAR_EOF
else
shar_count="`LC_ALL=C wc -c < 'automake-bug/two/Makefile.am'`"
test 25 -eq "$shar_count" ||
$echo 'automake-bug/two/Makefile.am:' 'original size' '25,' 'current size'
"$shar_count!"
fi
fi
# ============= automake-bug/two/two.texi ==============
if test -f 'automake-bug/two/two.texi' && test "$first_param" != -c; then
$echo 'x -' SKIPPING 'automake-bug/two/two.texi' '(file already exists)'
else
$echo 'x -' extracting 'automake-bug/two/two.texi' '(text)'
sed 's/^X//' << 'SHAR_EOF' > 'automake-bug/two/two.texi' &&
@setfilename two.info
X
@include version.texi
SHAR_EOF
(set 20 02 04 17 10 58 00 'automake-bug/two/two.texi'; eval "$shar_touch") &&
chmod 0644 'automake-bug/two/two.texi' ||
$echo 'restore of' 'automake-bug/two/two.texi' 'failed'
if ( md5sum --help </dev/null 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1
\
&& ( md5sum --version </dev/null 2>&1 | grep -v 'textutils 1.12' )
>/dev/null; then
md5sum -c << SHAR_EOF >/dev/null 2>&1 \
|| $echo 'automake-bug/two/two.texi:' 'MD5 check failed'
38f7c20df64adfc8a851188e791751d8 automake-bug/two/two.texi
SHAR_EOF
else
shar_count="`LC_ALL=C wc -c < 'automake-bug/two/two.texi'`"
test 45 -eq "$shar_count" ||
$echo 'automake-bug/two/two.texi:' 'original size' '45,' 'current size'
"$shar_count!"
fi
fi
$echo $shar_n 'x -' 'lock directory' "\`_sh08924': " $shar_c
if rm -fr _sh08924; then
$echo 'removed'
else
$echo 'failed to remove'
fi
exit 0
- Required files are only added once, even if two are needed.,
Marius Vollmer <=