[Forensics-changes] [SCM] patched version of GNU dd with forensic features branch, debian, updated. upstream/6.12.3-19-g8faa39a
Christophe Monniez
christophe.monniez at fccu.be
Thu Jul 16 09:36:41 UTC 2009
The following commit has been merged in the debian branch:
commit 8faa39a91c2417903e8ec9a15e7330fa07ffc9d8
Author: Christophe Monniez <christophe.monniez at fccu.be>
Date: Thu Jul 16 11:23:16 2009 +0200
Added a script to help maintainer finding copyright informations.
diff --git a/debian/cpfinder.py b/debian/cpfinder.py
new file mode 100755
index 0000000..1507e7e
--- /dev/null
+++ b/debian/cpfinder.py
@@ -0,0 +1,49 @@
+#!/usr/bin/python
+""" Copyright (C) 2009 Christophe Monniez
+ This script is a helper for the Debian maintainer of this package.
+ It search for the copyright informations from FSF inside ../lib/*.
+"""
+
+import os, os.path
+import re
+
+def getYears(ligne):
+ yearsp = re.compile('([12]\d{3})|([12]\d{3}-[12]\d{3}),{0,1}')
+ ylist = yearsp.findall(ligne)
+ years = ''
+ for y in ylist:
+ years += ', '.join(y)
+ if years != '':
+ return years
+ else:
+ return None
+
+def getcopyright(fichier):
+ f = open(fichier,'ro')
+ content = f.read()
+ cpp = re.compile(' Copyright \(C\).*\n{0,1}.*Free.*',re.MULTILINE)
+ s = cpp.search(content)
+ if s:
+ crstring = cpp.search(content).group().replace('\n',' ').replace('\t','')
+ years = getYears(crstring)
+ return 'Copyright (C) ' + years + 'Free Software Foundation, Inc.'
+ else:
+ return "No copyright found"
+
+crdic = {}
+for racine,dirs,fichiers in os.walk('../lib/'):
+ for fic in fichiers:
+ cs = getcopyright(os.path.join(racine,fic))
+ if crdic.has_key(cs):
+ crdic[cs].append(fic)
+ else:
+ crdic[cs]=[]
+ crdic[cs].append(fic)
+
+for c in crdic.keys():
+ fichiers = ', '.join(crdic[c])
+ if len(crdic[c]) > 1:
+ print "Files: %s" % fichiers
+ else:
+ print "File: %s" % fichiers
+ print "Copyright: %s\n" % c
--
patched version of GNU dd with forensic features
More information about the forensics-changes
mailing list