[game-data-packager] 06/06: debian/copyright.py: write to file instead of stdout, forcing UTF-8

Simon McVittie smcv at debian.org
Wed Jul 15 08:10:35 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 6c4466f606e3d887916934d6a9bb6cb6706cf988
Author: Simon McVittie <smcv at perpetual.pseudorandom.co.uk>
Date:   Wed Jul 15 09:06:36 2015 +0100

    debian/copyright.py: write to file instead of stdout, forcing UTF-8
    
    sbuild currently runs in the C locale, not C.UTF-8.
---
 debian/copyright.py | 15 ++++++++-------
 debian/rules        |  2 +-
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/debian/copyright.py b/debian/copyright.py
index 7f859f9..696f508 100755
--- a/debian/copyright.py
+++ b/debian/copyright.py
@@ -16,19 +16,20 @@
 # /usr/share/common-licenses/GPL-2.
 
 if __name__ == '__main__':
-    cin = open('debian/copyright.in')
+    cin = open('debian/copyright.in', encoding='utf-8')
+    copy = open('debian/copyright', 'w', encoding='utf-8')
 
-    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')
+    copy.write(cin.__next__())
+    copy.write('# This file was generated by debian/copyright.py from debian/copyright.in\n')
+    copy.write('# Please edit one of those files instead\n')
 
     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='')
+                    copy.write('  ' + line)
                 else:
-                    print(' .')
+                    copy.write(' .\n')
         else:
-            print(line, end='')
+            copy.write(line)
diff --git a/debian/rules b/debian/rules
index 0c4e1dc..5b82560 100755
--- a/debian/rules
+++ b/debian/rules
@@ -23,7 +23,7 @@ override_dh_auto_clean:
 		echo; \
 		exit 1; \
 	fi
-	debian/copyright.py > debian/copyright
+	debian/copyright.py
 
 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