[Python-modules-commits] r6600 - in packages/soya-doc/trunk/debian (5 files)

bernat at users.alioth.debian.org bernat at users.alioth.debian.org
Sat Sep 27 13:55:52 UTC 2008


    Date: Saturday, September 27, 2008 @ 13:55:50
  Author: bernat
Revision: 6600

Do not compress tutorial (Closes: #500012)

Add or fix shebang for all .py files (Closes: #500019). And make all
of them executable too. We move all those files to examples directory
instead of tutorial. The script also add a "coding: utf-8" header as
second line of all scripts.

Added:
  packages/soya-doc/trunk/debian/fix-shebang.py
Modified:
  packages/soya-doc/trunk/debian/changelog
  packages/soya-doc/trunk/debian/control
  packages/soya-doc/trunk/debian/control.in
  packages/soya-doc/trunk/debian/rules

Modified: packages/soya-doc/trunk/debian/changelog
===================================================================
--- packages/soya-doc/trunk/debian/changelog	2008-09-27 13:25:50 UTC (rev 6599)
+++ packages/soya-doc/trunk/debian/changelog	2008-09-27 13:55:50 UTC (rev 6600)
@@ -1,6 +1,10 @@
 soya-doc (0.14-2) UNRELEASED; urgency=low
 
   * Do not compress tutorial (Closes: #500012)
+  * Add or fix shebang for all .py files (Closes: #500019). And make all
+    of them executable too. We move all those files to examples directory
+    instead of tutorial. The script also add a "coding: utf-8" header as
+    second line of all scripts.
 
  -- Vincent Bernat <bernat at debian.org>  Sat, 27 Sep 2008 15:24:47 +0200
 

Modified: packages/soya-doc/trunk/debian/control
===================================================================
--- packages/soya-doc/trunk/debian/control	2008-09-27 13:25:50 UTC (rev 6599)
+++ packages/soya-doc/trunk/debian/control	2008-09-27 13:55:50 UTC (rev 6600)
@@ -3,6 +3,7 @@
 Priority: optional
 Maintainer: Vincent Bernat <bernat at debian.org>
 Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 5)
+Build-Depends-Indep: python
 Standards-Version: 3.8.0
 Homepage: http://home.gna.org/oomadness/en/soya3d/tutorials/
 Vcs-Svn: svn://svn.debian.org/python-modules/packages/soya-doc/trunk

Modified: packages/soya-doc/trunk/debian/control.in
===================================================================
--- packages/soya-doc/trunk/debian/control.in	2008-09-27 13:25:50 UTC (rev 6599)
+++ packages/soya-doc/trunk/debian/control.in	2008-09-27 13:55:50 UTC (rev 6600)
@@ -3,6 +3,7 @@
 Priority: optional
 Maintainer: Vincent Bernat <bernat at debian.org>
 Build-Depends: @cdbs@
+Build-Depends-Indep: python
 Standards-Version: 3.8.0
 Homepage: http://home.gna.org/oomadness/en/soya3d/tutorials/
 Vcs-Svn: svn://svn.debian.org/python-modules/packages/soya-doc/trunk

Added: packages/soya-doc/trunk/debian/fix-shebang.py
===================================================================
--- packages/soya-doc/trunk/debian/fix-shebang.py	                        (rev 0)
+++ packages/soya-doc/trunk/debian/fix-shebang.py	2008-09-27 13:55:50 UTC (rev 6600)
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+
+import sys
+import os
+import stat
+
+script = sys.argv[1]
+
+fscript = file(script)
+content = [x for x in fscript.readlines() if not x.startswith("#!") and "-*- coding:" not in x]
+content.insert(0, "# -*- coding: utf-8 -*-\n")
+content.insert(0, "#!/usr/bin/env python\n")
+fscript.close()
+
+fscript = file(script, "w")
+fscript.writelines(content)
+fscript.close()
+
+os.chmod(script, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)

Modified: packages/soya-doc/trunk/debian/rules
===================================================================
--- packages/soya-doc/trunk/debian/rules	2008-09-27 13:25:50 UTC (rev 6599)
+++ packages/soya-doc/trunk/debian/rules	2008-09-27 13:55:50 UTC (rev 6600)
@@ -2,11 +2,13 @@
 
 include /usr/share/cdbs/1/rules/debhelper.mk
 
-DEB_COMPRESS_EXCLUDE := tutorial
+DEB_COMPRESS_EXCLUDE := examples
+DEB_FIXPERMS_EXCLUDE := .py .sh
 
 binary-install/python-soya-doc::
-	find debian/python-soya-doc/usr/share/ -type f ! -name "*.py" -exec chmod -R a-x {} \;
-	#chmod a+x debian/python-soya-doc/usr/share/doc/python-soya-doc/tutorial/buggy.py
+	find debian/python-soya-doc/usr/share/ -type f ! -name "*.py" -a ! -name '*.sh' -exec chmod -R a-x {} \;
+	find debian/python-soya-doc/usr/share/ -type f -name "*.py" -exec python debian/fix-shebang.py {} \;
 	find debian/python-soya-doc -depth -name ".arch-ids" -exec rm -rf {} \;
 	find debian/python-soya-doc -name "LICENSE" -exec rm -rf {} \;
-
+	# Move everything from tutorial in examples directory
+	mv debian/python-soya-doc/usr/share/doc/python-soya-doc/tutorial debian/python-soya-doc/usr/share/doc/python-soya-doc/examples




More information about the Python-modules-commits mailing list