[game-data-packager] 01/17: Generate debian/copyright from debian/copyright.{in, py}

Simon McVittie smcv at debian.org
Sun Jul 12 16:34:36 UTC 2015


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch master
in repository game-data-packager.

commit 6a59da1192b668b6359cbd72ef1b678626ba175c
Author: Simon McVittie <smcv at debian.org>
Date:   Sun Jul 12 16:22:10 2015 +0100

    Generate debian/copyright from debian/copyright.{in,py}
---
 debian/changelog                   |  3 +++
 debian/copyright                   |  2 ++
 debian/{copyright => copyright.in} |  0
 debian/copyright.py                | 34 ++++++++++++++++++++++++++++++++++
 debian/rules                       |  1 +
 5 files changed, 40 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index bfbabc6..80e74d3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -42,6 +42,9 @@ game-data-packager (42) UNRELEASED; urgency=medium
     Maniac Mansion, Curse of Monkey Island, Grim Fandango
   * remove extraneous files in Doom 3 BFG (Closes: #787510)
 
+  [ Simon McVittie ]
+  * Generate debian/copyright from debian/copyright.{in,py}
+
  -- Simon McVittie <smcv at debian.org>  Sun, 03 May 2015 14:34:00 +0200
 
 game-data-packager (41) unstable; urgency=medium
diff --git a/debian/copyright b/debian/copyright
index 23f33e1..133544e 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,4 +1,6 @@
 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+# This file was generated by debian/copyright.py from debian/copyright.in
+# Please edit one of those files instead
 Source: http://git.debian.org/?p=pkg-games/game-data-packager.git
 
 Files: *
diff --git a/debian/copyright b/debian/copyright.in
similarity index 100%
copy from debian/copyright
copy to debian/copyright.in
diff --git a/debian/copyright.py b/debian/copyright.py
new file mode 100755
index 0000000..7f859f9
--- /dev/null
+++ b/debian/copyright.py
@@ -0,0 +1,34 @@
+#!/usr/bin/python3
+# encoding=utf-8
+#
+# Copyright © 2015 Simon McVittie <smcv at debian.org>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# You can find the GPL license text on a Debian system under
+# /usr/share/common-licenses/GPL-2.
+
+if __name__ == '__main__':
+    cin = open('debian/copyright.in')
+
+    print(cin.__next__(), end='')
+    print('# This file was generated by debian/copyright.py from debian/copyright.in')
+    print('# Please edit one of those files instead')
+
+    for line in cin:
+        if line.lower().startswith('include-license:'):
+            license = line.split(':', 1)[1].strip()
+            for line in open(license):
+                if line.strip():
+                    print('  ' + line, end='')
+                else:
+                    print(' .')
+        else:
+            print(line, end='')
diff --git a/debian/rules b/debian/rules
index 7829031..0c4e1dc 100755
--- a/debian/rules
+++ b/debian/rules
@@ -23,6 +23,7 @@ override_dh_auto_clean:
 		echo; \
 		exit 1; \
 	fi
+	debian/copyright.py > debian/copyright
 
 override_dh_install:
 	dh_install

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/game-data-packager.git



More information about the Pkg-games-commits mailing list