Don't require ${SYSDIR}/../COPYRIGHT to exist. Fall back to the

current date if we can't find it.

MFC After: 2 weeks
This commit is contained in:
Warner Losh 2014-12-22 19:10:21 +00:00
parent f9f0d902c1
commit 8757069658
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=276075

View File

@ -52,7 +52,11 @@ else
fi
b=share/examples/etc/bsd-style-copyright
year=$(sed -Ee '/^Copyright .* The FreeBSD Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT)
if [ -r "${SYSDIR}/../COPYRIGHT" ]; then
year=$(sed -Ee '/^Copyright .* The FreeBSD Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT)
else
year=$(date +%Y)
fi
# look for copyright template
for bsd_copyright in ../$b ../../$b ../../../$b /usr/src/$b /usr/$b
do