etc/periodic: Use 'LINKS' to create links for 220.snapshot-hammer2
authorAaron LI <aly@aaronly.me>
Fri, 12 Jun 2020 14:58:42 +0000 (22:58 +0800)
committerAaron LI <aly@aaronly.me>
Fri, 12 Jun 2020 14:58:42 +0000 (22:58 +0800)
Avoid the ad-hoc 'ln' command.  In addition, the original linked-to
files are absolute paths but missing the '${DESTDIR}', so they can be on
two different installations.  Use 'LINKS' that creates hard-links to
fix this issue.

Reviewed-by: swildner, deef
etc/Makefile
etc/periodic/daily/Makefile

index 37f7a92..52f13c5 100644 (file)
@@ -170,8 +170,6 @@ upgrade_base:       upgrade_check preupgrade remove-obsolete-files
        cd ${UPGRADE_SRCDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
            ${DEFAULTS} ${DESTDIR}/etc/defaults
        cd ${UPGRADE_SRCDIR}/periodic; ${MAKE} install
        cd ${UPGRADE_SRCDIR}/defaults; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
            ${DEFAULTS} ${DESTDIR}/etc/defaults
        cd ${UPGRADE_SRCDIR}/periodic; ${MAKE} install
-       ${LN} -fs /etc/periodic/daily/220.snapshot-hammer2 ${DESTDIR}/etc/periodic/weekly/220.snapshot-hammer2
-       ${LN} -fs /etc/periodic/daily/220.snapshot-hammer2 ${DESTDIR}/etc/periodic/monthly/220.snapshot-hammer2
        mkdir -p ${DESTDIR}/etc/rc.d
        cd ${UPGRADE_SRCDIR}/rc.d; ${MAKE} install
        cd ${UPGRADE_SRCDIR}/devd; ${MAKE} install
        mkdir -p ${DESTDIR}/etc/rc.d
        cd ${UPGRADE_SRCDIR}/rc.d; ${MAKE} install
        cd ${UPGRADE_SRCDIR}/devd; ${MAKE} install
index 5504cf0..28517a3 100644 (file)
@@ -23,4 +23,7 @@ FILES=        100.clean-disks \
        500.queuerun \
        999.local
 
        500.queuerun \
        999.local
 
+LINKS= ${FILESDIR}/220.snapshot-hammer2 ${FILESDIR}/../weekly/220.snapshot-hammer2 \
+       ${FILESDIR}/220.snapshot-hammer2 ${FILESDIR}/../monthly/220.snapshot-hammer2
+
 .include <bsd.prog.mk>
 .include <bsd.prog.mk>