From e151cd19019334ae9caa61483e0bf520d0ad0f0f Mon Sep 17 00:00:00 2001 From: John Birrell Date: Thu, 10 Dec 1998 05:34:11 +0000 Subject: [PATCH] Add logic to check if any of the BIN1 files do not already exist in ${DESTDIR}/etc and an install target to install the missing ones. This allows new files like pam.conf to be installed by the first installworld after the file is added, but avoid clobbering files that might be customized. This should save some support questions. --- etc/Makefile | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/etc/Makefile b/etc/Makefile index 3e09565bb76b..e57bb1c796ac 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -1,5 +1,5 @@ # from: @(#)Makefile 5.11 (Berkeley) 5/21/91 -# $Id: Makefile,v 1.179 1998/10/08 06:12:04 markm Exp $ +# $Id: Makefile,v 1.180 1998/11/20 23:20:00 jdp Exp $ SUBDIR= sendmail @@ -149,4 +149,26 @@ distrib-dirs: rm -rf POSIX; \ ln -s C POSIX +# +# Check for missing files in ${DESTDIR}/etc. +# +_etc_missing= +.for _f in ${BIN1} +_g=${_f:T} +.if !exists(${DESTDIR}/etc/$(_g)) +_etc_missing+=$(_f) +.endif +.endfor + +# +# Install only those files which don't exist in the destination +# directory. This will install new files, but not update existing +# (possibly customized) files. +# +install: +.if (${_etc_missing} != "") + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${_etc_missing} \ + ${DESTDIR}/etc +.endif + .include