[zaptel-commits] branch kpfleming/version-tag - commit revision 862

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Fri Dec 16 19:45:56 CST 2005


Author: kpfleming
Date: Fri Dec 16 19:45:54 2005
New Revision: 862

URL: http://svn.digium.com/view/zaptel?rev=862&view=rev
Log:
initial attempt at version reporting

Added:
    team/kpfleming/version-tag/build_tools/
    team/kpfleming/version-tag/build_tools/make_svn_branch_name   (with props)
    team/kpfleming/version-tag/build_tools/make_version_h   (with props)
Modified:
    team/kpfleming/version-tag/Makefile
    team/kpfleming/version-tag/zaptel.c
    team/kpfleming/version-tag/zaptel.h

Modified: team/kpfleming/version-tag/Makefile
URL: http://svn.digium.com/view/zaptel/team/kpfleming/version-tag/Makefile?rev=862&r1=861&r2=862&view=diff
==============================================================================
--- team/kpfleming/version-tag/Makefile (original)
+++ team/kpfleming/version-tag/Makefile Fri Dec 16 19:45:54 2005
@@ -95,6 +95,21 @@
 CHKCONFIG:=:
 endif
 
+ifneq ($(wildcard .version),)
+  ZAPTELVERSION:=$(shell cat .version)
+endif
+
+# CVS mirrors of SVN have .svnrevision files showing
+# which SVN revision they are based on, and .svnbranch
+# showing the branch they are made from
+ifneq ($(wildcard .svnrevision),)
+  ZAPTELVERSION:=SVN-$(shell cat .svnbranch)-r$(shell cat .svnrevision)
+else
+  ifneq ($(wildcard .svn),)
+    ZAPTELVERSION=SVN-$(shell build_tools/make_svn_branch_name)
+  endif
+endif
+
 TZOBJS:=zonedata.lo tonezone.lo
 LIBTONEZONE_SO:=libtonezone.so
 LIBTONEZONE_SO_MAJOR_VER:=1
@@ -137,13 +152,20 @@
 
 MOD_DESTDIR:=zaptel
 
+version.h: FORCE
+	ZAPTELVERSION="${ZAPTELVERSION}" build_tools/make_version_h > $@.tmp
+	if cmp -s $@.tmp $@ ; then echo; else \
+		mv $@.tmp $@ ; \
+	fi
+	rm -f $@.tmp
+
 devel: tor2ee 
 
 tests: patgen pattest patlooptest hdlcstress hdlctest hdlcgen hdlcverify timertest
 
 tor2.o: tor2-hw.h tor2fw.h zaptel.h
 
-zaptel.o: zaptel.h digits.h arith.h sec.h mec.h sec-2.h mec2.h mec3.h zconfig.h
+zaptel.o: zaptel.h digits.h arith.h sec.h mec.h sec-2.h mec2.h mec3.h zconfig.h version.h
 
 torisa.o: zaptel.h torisa.h
 
@@ -400,12 +422,24 @@
 update:
 	@if [ -d .svn ]; then \
 		echo "Updating from Subversion..." ; \
-		svn update -q; \
+		svn update | tee update.out; \
+		rm -f .version; \
+		if [ `grep -c ^C update.out` -gt 0 ]; then \
+			echo ; echo "The following files have conflicts:" ; \
+			grep ^C update.out | cut -b4- ; \
+		fi ; \
+		rm -f update.out; \
 	elif [ -d CVS ]; then \
 		echo "Updating from CVS..." ; \
-		cvs -q -z3 update -Pd; \
+		cvs -q -z3 update -Pd | tee update.out; \
+		rm -f .version; \
+		if [ `grep -c ^C update.out` -gt 0 ]; then \
+			echo ; echo "The following files have conflicts:" ; \
+			grep ^C update.out | cut -d' ' -f2- ; \
+		fi ; \
+		rm -f update.out; \
 	else \
-		echo "Not under version control"; \
+		echo "Not under version control";  \
 	fi
 
 clean:
@@ -421,3 +455,5 @@
 	rm -f fxotune
 	rm -f core
 	rm -f ztcfg-shared fxstest
+
+FORCE:

Added: team/kpfleming/version-tag/build_tools/make_svn_branch_name
URL: http://svn.digium.com/view/zaptel/team/kpfleming/version-tag/build_tools/make_svn_branch_name?rev=862&view=auto
==============================================================================
--- team/kpfleming/version-tag/build_tools/make_svn_branch_name (added)
+++ team/kpfleming/version-tag/build_tools/make_svn_branch_name Fri Dec 16 19:45:54 2005
@@ -1,0 +1,50 @@
+#!/bin/sh
+
+PARTS=`LANG=C svn info | grep URL | awk '{print $2;}' | sed -e s:^.*/svn/zaptel/:: | sed -e 's:/: :'`
+BRANCH=0
+TEAM=0
+
+REV=`svnversion -c . | cut -d: -f2`
+
+if [ "${PARTS}" = "trunk" ]
+then
+    echo 'trunk'-r${REV}
+    exit 0
+fi
+
+for PART in $PARTS
+do
+  if [ ${BRANCH} != 0 ]
+  then
+      RESULT="${RESULT}-${PART}"
+      break
+  fi
+
+  if [ ${TEAM} != 0 ]
+  then
+      RESULT="${RESULT}-${PART}"
+      continue
+  fi
+
+  if [ "${PART}" = "branches" ]
+  then
+      BRANCH=1
+      RESULT="branch"
+      continue
+  fi
+
+  if [ "${PART}" = "tags" ]
+  then
+      BRANCH=1
+      RESULT="tag"
+      continue
+  fi
+
+  if [ "${PART}" = "team" ]
+  then
+      TEAM=1
+      continue
+  fi
+done
+
+echo ${RESULT}-r${REV}

Propchange: team/kpfleming/version-tag/build_tools/make_svn_branch_name
------------------------------------------------------------------------------
    svn:executable = *

Added: team/kpfleming/version-tag/build_tools/make_version_h
URL: http://svn.digium.com/view/zaptel/team/kpfleming/version-tag/build_tools/make_version_h?rev=862&view=auto
==============================================================================
--- team/kpfleming/version-tag/build_tools/make_version_h (added)
+++ team/kpfleming/version-tag/build_tools/make_version_h Fri Dec 16 19:45:54 2005
@@ -1,0 +1,9 @@
+#!/bin/sh
+cat << END
+/*
+ * version.h 
+ * Automatically generated
+ */
+#define ZAPTEL_VERSION "${ZAPTELVERSION}"
+
+END

Propchange: team/kpfleming/version-tag/build_tools/make_version_h
------------------------------------------------------------------------------
    svn:executable = *

Modified: team/kpfleming/version-tag/zaptel.c
URL: http://svn.digium.com/view/zaptel/team/kpfleming/version-tag/zaptel.c?rev=862&r1=861&r2=862&view=diff
==============================================================================
--- team/kpfleming/version-tag/zaptel.c (original)
+++ team/kpfleming/version-tag/zaptel.c Fri Dec 16 19:45:54 2005
@@ -38,6 +38,7 @@
 
 
 #include "zconfig.h"
+#include "version.h"
 
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -6422,6 +6423,9 @@
 #ifdef MODULE_LICENSE
 MODULE_LICENSE("GPL");
 #endif
+#ifdef MODULE_VERSION
+MODULE_VERSION(ZAPTEL_VERSION);
+#endif
 
 #ifdef LINUX26
 module_param(debug, int, 0600);
@@ -6540,6 +6544,8 @@
 #endif /* CONFIG_DEVFS_FS */
 
 	printk(KERN_INFO "Zapata Telephony Interface Registered on major %d\n", ZT_MAJOR);
+	printk(KERN_INFO "Zaptel Version: %s Echo Canceller: %s\n", ZAPTEL_VERSION,
+	       ZAPTEL_ECHO_CANCELLER ZAPTEL_ECHO_AGGRESSIVE);
 	zt_conv_init();
 	tone_zone_init();
 	fasthdlc_precalc();

Modified: team/kpfleming/version-tag/zaptel.h
URL: http://svn.digium.com/view/zaptel/team/kpfleming/version-tag/zaptel.h?rev=862&r1=861&r2=862&view=diff
==============================================================================
--- team/kpfleming/version-tag/zaptel.h (original)
+++ team/kpfleming/version-tag/zaptel.h Fri Dec 16 19:45:54 2005
@@ -151,21 +151,34 @@
 
 #define	RING_DEBOUNCE_TIME	2000	/* 2000 ms ring debounce time */
 
+#ifdef AGGRESSIVE_SUPPRESSOR
+#define ZAPTEL_ECHO_AGGRESSIVE " (aggressive)"
+#else
+#define ZAPTEL_ECHO_AGGRESSIVE
+#endif
+
 #ifdef __KERNEL__
 /* Echo cancellation */
 #if defined(ECHO_CAN_STEVE)
+#define ZAPTEL_ECHO_CANCELLER "STEVE"
 #include "sec.h"
 #elif defined(ECHO_CAN_STEVE2)
+#define ZAPTEL_ECHO_CANCELLER "STEVE2"
 #include "sec-2.h"
 #elif defined(ECHO_CAN_MARK)
+#define ZAPTEL_ECHO_CANCELLER "MARK"
 #include "mec.h"
 #elif defined(ECHO_CAN_MARK2)
+#define ZAPTEL_ECHO_CANCELLER "MARK2"
 #include "mec2.h"
 #elif defined(ECHO_CAN_KB1)
+#define ZAPTEL_ECHO_CANCELLER "KB1"
 #include "kb1ec.h"
 #elif defined(ECHO_CAN_MG2)
+#define ZAPTEL_ECHO_CANCELLER "MG2"
 #include "mg2ec.h"
 #else
+#define ZAPTEL_ECHO_CANCELLER "MARK3"
 #include "mec3.h"
 #endif
 #endif



More information about the zaptel-commits mailing list