]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Add RCSID and CVS headers when importing to NetBSD.
authorRoy Marples <roy@marples.name>
Thu, 20 Jun 2013 10:35:16 +0000 (10:35 +0000)
committerRoy Marples <roy@marples.name>
Thu, 20 Jun 2013 10:35:16 +0000 (10:35 +0000)
Makefile
configure
dhcpcd-hooks/Makefile

index e11b40713f9088a63e1dcf2e9ae5015797eda808..f8d2438ba1ea3346cce4c1b6bf67ac526f441c0d 100644 (file)
--- 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
index 1fe383c02384315bb9fbf26999833188e9b0fd1b..8bcf1da340889c3d70913b8707674a3a043cfad1 100755 (executable)
--- 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 <sys/cdefs.h>\\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"
index cf215c8a6a3a5d5f8f4b92c355c5ad258d14618f..c3ae1887baa9d47efe1003fd51a2722bee3ebfc6 100644 (file)
@@ -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;