[Pkg-voip-commits] r3270 - in srtp/trunk/debian: . cdbs/1/rules

Jonas Smedegaard js at alioth.debian.org
Wed Mar 21 11:45:01 CET 2007


Author: js
Date: 2007-03-21 10:45:01 +0000 (Wed, 21 Mar 2007)
New Revision: 3270

Modified:
   srtp/trunk/debian/cdbs/1/rules/copyright-check.mk
   srtp/trunk/debian/changelog
Log:
Updated copyright-check: List matching non-binaries when copyright changes are found.

Modified: srtp/trunk/debian/cdbs/1/rules/copyright-check.mk
===================================================================
--- srtp/trunk/debian/cdbs/1/rules/copyright-check.mk	2007-03-21 10:39:28 UTC (rev 3269)
+++ srtp/trunk/debian/cdbs/1/rules/copyright-check.mk	2007-03-21 10:45:01 UTC (rev 3270)
@@ -1,5 +1,5 @@
 # -*- mode: makefile; coding: utf-8 -*-
-# Copyright © 2005-2006 Jonas Smedegaard <dr at jones.dk>
+# Copyright © 2005-2007 Jonas Smedegaard <dr at jones.dk>
 # Description: Check for changes to copyright notices in source
 #
 # This program is free software; you can redistribute it and/or
@@ -17,8 +17,10 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 # 02111-1307 USA.
 
-# TODO: Make use of /usr/bin/licensecheck in kdesdk-scripts package
+# TODO: Save scan as "file: match" (needs rewrite of main loop in perl)
 
+# TODO: Save scan as "file (license): match" (needs /usr/bin/licensecheck from kdesdk-scripts)
+
 _cdbs_scripts_path ?= /usr/lib/cdbs
 _cdbs_rules_path ?= /usr/share/cdbs/1/rules
 _cdbs_class_path ?= /usr/share/cdbs/1/class
@@ -28,12 +30,14 @@
 
 include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
 
-cdbs_copyright-check_find_opts := -not -regex '\./debian/.*' -not -regex '.*/config\.\(guess\|sub\|rpath\)'
+cdbs_copyright-check_find_opts := -not -regex 'debian/.*' -not -regex '\(.*/\)?config\.\(guess\|sub\|rpath\)\(\..*\)?'
 cdbs_copyright-check_egrep_opts := --text -rih '(copyright|\(c\) ).*[0-9]{4}'
 
-clean::
+pre-build:: debian/stamp-copyright-check
+
+debian/stamp-copyright-check:
 	@echo 'Scanning upstream source for new/changed copyright notices (except debian subdir!)...'
-	find . -type f $(cdbs_copyright-check_find_opts) -exec cat '{}' ';' \
+	find * -type f $(cdbs_copyright-check_find_opts) -exec cat '{}' ';' \
 		| tr '\r' '\n' \
 		| LC_ALL=C sed -e 's/[^[:print:]]//g' \
 		| egrep $(cdbs_copyright-check_egrep_opts) \
@@ -41,17 +45,25 @@
 		| LC_ALL=C sort -u \
 		> debian/copyright_newhints
 	@if [ ! -f debian/copyright_hints ]; then touch debian/copyright_hints; fi
-	@echo "diff --normal debian/copyright_hints debian/copyright_newhints | egrep '^>'"
-	@diff --normal debian/copyright_hints debian/copyright_newhints | egrep '^>'; \
-		if [ "$$?" -eq "0" ]; then \
-			echo "New or changed copyright notices discovered! Do this:"; \
-			echo "  1) Search source for each of the above lines ('grep -r' is your friend)"; \
-			echo "  2) Update debian/copyright as needed"; \
-			echo "  3) Replace debian/copyright_hints with debian/copyright_newhints"; \
+	@newstrings=`diff -u debian/copyright_hints debian/copyright_newhints | sed '1,2d' | egrep '^\+' | sed 's/^\+//'`; \
+		if [ -n "$$newstrings" ]; then \
+			echo "Error: The following new or changed copyright notices discovered:"; \
+			echo "$$newstrings"; \
+			echo "Trying to locate the files containing the new/changed copyright notices..."; \
+			echo "(Strings part of binary data you need to resolve yourself)"; \
+			find * -type f $(cdbs_copyright-check_find_opts) -exec grep -F -l -e "$$newstrings" '{}' ';'; \
+			echo; \
+			echo "To fix the situation please do the following:"; \
+			echo "  1) Investigate the above changes and update debian/copyright as needed"; \
+			echo "  2) Replace debian/copyright_hints with debian/copyright_newhints"; \
 			exit 1; \
 		fi
 	
 	@echo 'No new copyright notices found - assuming no news is good news...'
 	rm -f debian/copyright_newhints
+	touch $@
 
+clean::
+	rm -f debian/stamp-copyright-check
+
 endif

Modified: srtp/trunk/debian/changelog
===================================================================
--- srtp/trunk/debian/changelog	2007-03-21 10:39:28 UTC (rev 3269)
+++ srtp/trunk/debian/changelog	2007-03-21 10:45:01 UTC (rev 3270)
@@ -4,6 +4,7 @@
     /usr/share/doc/srtp-utils, to comply with policy regarding FHS.
   * Update cdbs tweaks:
     + Replace vcs.mk with new and improved upstream-tarball.mk.
+    + List matching non-binaries when copyright changes are found.
     + Update notes in README.cdbs-tweaks.
 
  -- Jonas Smedegaard <dr at jones.dk>  Wed, 21 Mar 2007 10:48:59 +0100




More information about the Pkg-voip-commits mailing list