dhcpcd-discuss

Re: `make install` will not overwrite just-created hooks

Roy Marples

Mon Jul 15 09:05:12 2019

Hi Kristopher

On 14/07/2019 04:16, Kristopher John Gamrat wrote:
---------------------> PLEASE REPLY BELOW THIS MESSAGE <---------------------

I am trying to compile dhcpcd version 7.2.3 on CentOS 7. I am running into an
issue with `make install` (output pasted below): it reports that it will not
overwrite the just-created files that belong in /usr/libexec/dhcpcd-hooks .
Indeed, when I look at the directory it's installing to, all the hooks are
there, but as you can see in the output, they *shouldn't* already be there
since there isn't any indication that they were installed before the error
was produced (i.e. before it
enters /home/piki/rpmbuild/BUILD/dhcpcd-7.2.3/hooks ). I remember some
weirdness a few months ago caused by CentOS using an old version of make --
could this be more weirdness on CentOS' end (gosh-darn those software
archaeologists!), or is this something in dhcpcd?

make version is 3.82
gcc version is 4.8.5 (I can try with clang if requested)

I used Centos-7.6.1810 and whatever came with it. I don't think this is anything gcc related.


=============================================================================
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.rIk8K9
+ umask 022
+ cd /home/piki/rpmbuild/BUILD
+ '[' /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64 '!=' / ']'
+ rm -rf /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64
++ dirname /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64
+ mkdir -p /home/piki/rpmbuild/BUILDROOT
+ mkdir /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64
+ cd dhcpcd-7.2.3
+ echo 'make DESTDIR=/home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64
install'
make DESTDIR=/home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64 install
+ make DESTDIR=/home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64 install
for x in src hooks; do cd $x; make install || exit $?; cd ..; done
make[1]: Entering directory `/home/piki/rpmbuild/BUILD/dhcpcd-7.2.3/src'
install -d /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/usr/sbin
install -m 0555
dhcpcd /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/usr/sbin
install -d /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/var/db/dhcpcd
for x in ; do cd $x; make proginstall || exit $?; cd ..; done
install -d /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/usr/share/man/man5
install -m 0444
dhcpcd.conf.5 /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/usr/share/man/man5
install -d /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/usr/share/man/man8
install -m 0444
dhcpcd.8 /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/usr/share/man/man8
install -d /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/etc
# Install a new default config if not present
test -e /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/etc/dhcpcd.conf ||
\
         install -m 0644
dhcpcd.conf /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/etc
# Attempt to move files from sysconfig to dbdir
if
[ ! -e /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/var/db/dhcpcd/duid -a
\
     -e /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/etc/dhcpcd.duid ];
\
then \
mv /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/etc/dhcpcd.duid \
                 /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/var/db/dhcpcd/duid;
\
fi
if
[ ! -e /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/var/db/dhcpcd/secret -a
\
     -e /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/etc/dhcpcd.secret ];
\
then \
mv /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/etc/dhcpcd.secret
\
                 /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/var/db/dhcpcd/secret;
\
fi
# Move leases to new location
for lease
in /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/var/db/dhcpcd/../dhcpcd-*.lease*;
do \
         [ -f "$lease" ] || continue; \
         newlease=$(basename "$lease" | sed -e "s/dhcpcd-//"); \
mv "$lease" /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/var/db/dhcpcd/"$newlease";
\
done
# Move RDM monotonic to new location
if
[ ! -e /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/var/db/dhcpcd/rdm_monotonic -a
\
     -e /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/var/db/dhcpcd/../dhcpcd-rdm.monotonic ];
\
then \
mv /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/var/db/dhcpcd/../dhcpcd-rdm.monotonic
\
                 /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/var/db/dhcpcd/rdm_monotonic;
\
fi
make[1]: Leaving directory `/home/piki/rpmbuild/BUILD/dhcpcd-7.2.3/src'
make[1]: Entering directory `/home/piki/rpmbuild/BUILD/dhcpcd-7.2.3/hooks'
install -d /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/usr/libexec
install -m 0555
dhcpcd-run-hooks /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/usr/libexec
install -d /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/usr/libexec/dhcpcd-hooks
install -m 0444 01-test 02-dump 20-resolv.conf 30-hostname 50-ntp.conf 01-test
02-dump 10-wpa_supplicant 15-timezone 20-resolv.conf 29-lookup-hostname
30-hostname 50-dhcpcd-compat
50-yp.conf /home/piki/rpmbuild/BUILDROOT/dhcpcd-7.2.3-1.el7.x86_64/usr/libexec/dhcpcd-hooks

Here is the error.
You have specified the scripts twice!
Here is how dhcpcd constructs what to install

SCRIPTSDIR=     ${HOOKDIR}
SCRIPTS=        01-test 02-dump
SCRIPTS+=       20-resolv.conf
SCRIPTS+=       30-hostname
SCRIPTS+=       ${HOOKSCRIPTS}

So is your rpm build putting these scripts into HOOKSCRIPTS as well? That would be an error.

Roy

References:
`make install` will not overwrite just-created hooksKristopher John Gamrat
Archive administrator: postmaster@marples.name