[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Useless -r argument in install-sh
From: |
Julien ÉLIE |
Subject: |
Re: Useless -r argument in install-sh |
Date: |
Mon, 15 Jun 2009 20:06:09 +0200 |
Hi Ralf,
Thanks for your answer.
In the latest libtool release (2.2.6a), there is an unnecessary
"-f" argument to $rmcmd here:
rmcmd="$rmprog -f"
Hmm. In general, this code is pretty tricky and I'm rather reluctant to
do lot of "clean-up" changes if we don't find actual problems with the
code.
As you speak about issues, I believe there may be one with how directories
are handled. We added that in the install-sh script shipped with INN
<http://inn.eyrie.org/trac/browser/trunk/support/install-sh>:
--- install-sh 2009-06-15 19:46:55.000000000 +0200
+++ install-sh2 2009-06-15 19:47:24.000000000 +0200
@@ -238,6 +238,10 @@
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
+ # Don't chown directories that already exist (added for INN).
+ if test $dstdir_status = 0; then
+ chowncmd=""
+ fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
But it is not enough. There are also problems with chgrp and this patch is
perhaps not at the right place.
I for instance obtain:
../support/install-sh -c -o news -g news -m 0550 -B .OLD inews
/home/news/bin/inews
../support/install-sh -c -o news -g uucp -m 04550 -B .OLD rnews
/home/news/bin/rnews
chgrp: modification du groupe de `/home/news/bin/_inst.29292_': Opération non
permise
make[1]: *** [install] Erreur 1
The chgrp operation is not allowed when "make update" is not run as root.
There is also a direct call to "rm" here:
rm -f "$dsttmp"
I think $doit $rmcmd might be used instead.
Hmm, this indeed looks inconsistent. $dsttmp is consistently removed
with plain rm, and $dst consistenly with $rmcmd, but $rmtmp isn't.
Unfortunately, there is no documentation about either of the variables,
so I'm still not quite sure what the expected semantics would be: either
let all temporary files be removed in any case, or let all removals be
done with $rmcmd.
Another possibility that seems plausible is that $rmcmd was introduced
only for the case of when plain rm would not work here: say, if we are
about to install a shared library which the rm program depends upon.
All right, though it is not well explained in the code.
Have a nice day,
--
Julien ÉLIE
« Mon âme a son secret, ma vie a son mystère. » (Félix Arvers)