From: Roy Marples Date: Thu, 20 Jun 2013 10:35:16 +0000 (+0000) Subject: Add RCSID and CVS headers when importing to NetBSD. X-Git-Tag: v6.0.0~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=400f3515aabd9c0b4aa9d3225d6309fb6e786a21;p=thirdparty%2Fdhcpcd.git Add RCSID and CVS headers when importing to NetBSD. --- diff --git a/Makefile b/Makefile index e11b4071..f8d2438b 100644 --- a/Makefile +++ b/Makefile @@ -122,6 +122,64 @@ import: tr ' ' '\n' | \ sort -u) /tmp/${DISTPREFIX}/compat; \ fi; + if test -n "${IMPORT_RCSID}"; then \ + for x in \ + /tmp/${DISTPREFIX}/*.c \ + /tmp/${DISTPREFIX}/compat/*.c \ + ; do \ + if test -e "$$x"; then \ + printf "${IMPORT_RCSID}\n\n" >"$$x".new; \ + cat "$$x" >>"$$x".new; \ + mv "$$x".new "$$x"; \ + fi; \ + done; \ + fi; + if test -n "${IMPORT_HID}"; then \ + for x in \ + /tmp/${DISTPREFIX}/*.h \ + /tmp/${DISTPREFIX}/compat/*.h \ + ; do \ + if test -e "$$x"; then \ + printf "${IMPORT_HID}\n\n" >"$$x".new; \ + cat "$$x" >>"$$x".new; \ + mv "$$x".new "$$x"; \ + fi; \ + done; \ + fi; + if test -n "${IMPORT_MANID}"; then \ + for x in \ + /tmp/${DISTPREFIX}/dhcpcd.8.in \ + /tmp/${DISTPREFIX}/dhcpcd-run-hooks.8.in \ + /tmp/${DISTPREFIX}/dhcpcd.conf.5.in \ + ; do \ + if test -e "$$x"; then \ + printf "${IMPORT_MANID}\n" >"$$x".new; \ + cat "$$x" >>"$$x".new; \ + mv "$$x".new "$$x"; \ + fi; \ + done; \ + fi; + if test -n "${IMPORT_SHID}"; then \ + for x in \ + /tmp/${DISTPREFIX}/dhcpcd-run-hooks.in \ + /tmp/${DISTPREFIX}/dhcpcd.conf \ + ; do \ + if test -e "$$x"; then \ + if test "$$(sed -ne 1p $$x)" = "#!/bin/sh" \ + ; then \ + echo "#!/bin/sh" > "$$x".new; \ + printf "${IMPORT_SHID}\n" >>"$$x".new; \ + echo "" >>"$$x".new; \ + sed 1d "$$x" >>"$$x".new; \ + else \ + printf "${IMPORT_SHID}\n" >>"$$x".new; \ + echo "" >>"$$x".new; \ + cat "$$x" >>"$$x".new; \ + fi; \ + mv "$$x".new "$$x"; \ + fi; \ + done; \ + fi; cd dhcpcd-hooks; ${MAKE} DISTPREFIX=${DISTPREFIX} $@ include Makefile.inc diff --git a/configure b/configure index 1fe383c0..8bcf1da3 100755 --- a/configure +++ b/configure @@ -720,6 +720,20 @@ done cd .. echo "HOOKSCRIPTS= $HOOKS" >>$CONFIG_MK +# Define any RCSIDs for import into 3rd party systems +case "$OS" in +netbsd) + echo "IMPORT_RCSID= \#include \\n" >>$CONFIG_MK + echo "IMPORT_RCSID+= __RCSID(\\\"\\\$\$NetBSD: \\\$\$\\\");" >> \ + $CONFIG_MK + echo "IMPORT_HID+= /* \\\$\$NetBSD: \\\$\$ */" >> \ + $CONFIG_MK + echo "IMPORT_MANID= .\\\\\\\\\\\" \\\$\$NetBSD: \$\$ " >> \ + $CONFIG_MK + echo "IMPORT_SHID= \# \\\$\$NetBSD: \$\$ " >>$CONFIG_MK + ;; +esac + echo echo " SYSCONFDIR = $SYSCONFDIR" echo " SBINDIR = $SBINDIR" diff --git a/dhcpcd-hooks/Makefile b/dhcpcd-hooks/Makefile index cf215c8a..c3ae1887 100644 --- a/dhcpcd-hooks/Makefile +++ b/dhcpcd-hooks/Makefile @@ -16,5 +16,16 @@ install: import: ${INSTALL} -d /tmp/${DISTPREFIX}/dhcpcd-hooks - ${INSTALL} -m ${NONBINMODE} ${SCRIPTS} /tmp/${DISTPREFIX}/dhcpcd-hooks - + for x in ${SCRIPTS}; do \ + t="/tmp/${DISTPREFIX}/dhcpcd-hooks/$$x"; \ + if test "$$(sed -ne 1p $$x)" = "#!/bin/sh"; then \ + echo "#!/bin/sh" >"$$t"; \ + printf "${IMPORT_SHID}\n" >>"$$t"; \ + echo "" >>"$$t"; \ + sed 1d "$$x" >>"$$t"; \ + else \ + printf "${IMPORT_SHID}\n" >"$$t"; \ + echo "" >>"$$t"; \ + cat "$$x" >>"$$t"; \ + fi; \ + done;