[Python-modules-commits] r10789 - in packages/python-docutils (3 files)

jwilk-guest at users.alioth.debian.org jwilk-guest at users.alioth.debian.org
Tue Dec 15 12:20:29 UTC 2009


    Date: Tuesday, December 15, 2009 @ 12:20:28
  Author: jwilk-guest
Revision: 10789

Update patch fixing insecure use of temporary files to be compatible with XEmacs 21.

Modified:
  packages/python-docutils/branches/0.5-2/debian/patches/18_emacs_temporary_files.dpatch
  packages/python-docutils/trunk/debian/changelog
  packages/python-docutils/trunk/debian/patches/emacs-temporary-files.diff

Modified: packages/python-docutils/branches/0.5-2/debian/patches/18_emacs_temporary_files.dpatch
===================================================================
--- packages/python-docutils/branches/0.5-2/debian/patches/18_emacs_temporary_files.dpatch	2009-12-15 05:38:26 UTC (rev 10788)
+++ packages/python-docutils/branches/0.5-2/debian/patches/18_emacs_temporary_files.dpatch	2009-12-15 12:20:28 UTC (rev 10789)
@@ -11,29 +11,78 @@
 Author: Jakub Wilk <ubanus at users.sf.net>
 Bug: http://sourceforge.net/tracker/?func=detail&aid=2912890&group_id=38414&atid=422030
 Bug-Debian: http://bugs.debian.org/560755
-Last-Update: 2009-12-13
+Last-Update: 2009-12-15
 
 diff --git a/tools/editors/emacs/rst.el b/tools/editors/emacs/rst.el
 --- a/tools/editors/emacs/rst.el
 +++ b/tools/editors/emacs/rst.el
-@@ -3273,13 +3273,32 @@
+@@ -3273,13 +3273,81 @@
       "rst2pseudoxml"
       standard-output)))
  
 +(defvar rst-temp-dir nil)
 +(make-variable-buffer-local 'rst-temp-dir)
 +
++;; make-temp-file is not available in XEmacs 21
++(if (fboundp 'make-temp-file)
++  (defun rst-make-temp-dir (prefix) (make-temp-file prefix t))
++  (defun rst-make-temp-dir (prefix)
++    (let ((umask (default-file-modes)) file)
++      (unwind-protect
++        (progn
++          (set-default-file-modes 448) ; o700
++          (while
++            (condition-case ()
++              (progn
++                (setq file
++                  (make-temp-name
++                    (if (zerop (length prefix))
++                      (file-name-as-directory (temp-directory))
++                      (expand-file-name prefix (temp-directory))
++                    )
++                  )
++                )
++                (make-directory file)
++                nil
++              )
++              (file-already-exists t)
++            )
++            nil
++          )
++          file
++        )
++        (set-default-file-modes umask)
++      )
++    )
++  )
++)
++
 +(defun rst-get-temp-dir ()
 +  (or rst-temp-dir
-+    (setq rst-temp-dir 
-+      (file-name-as-directory (make-temp-file "rst-" t))
++    (setq rst-temp-dir
++      (file-name-as-directory (rst-make-temp-dir "rst-"))
 +    )
 +  )
 +)
 +
++;; dired-delete-file is not available in XEmacs 21
++(defun rst-delete-file (file)
++  (if (not (eq t (car (file-attributes file))))
++    (delete-file file)
++    (when
++      (setq files (directory-files file t "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))
++      (while files
++        (rst-delete-file (car files))
++        (setq files (cdr files))
++      )
++    )
++    (delete-directory file)
++  )
++)
++
 +(defun rst-remove-temp-dir ()
 +  (require 'dired)
-+  (if rst-temp-dir (dired-delete-file rst-temp-dir 'always))
++  (if rst-temp-dir (rst-delete-file rst-temp-dir))
 +)
 +
 +(add-hook 'kill-buffer-hook 'rst-remove-temp-dir)
@@ -50,7 +99,7 @@
  	 (command (format "rst2pdf.py %s %s && %s %s"
  			  buffer-file-name tmp-filename
  			  rst-pdf-program tmp-filename)))
-@@ -3294,7 +3313,7 @@
+@@ -3294,7 +3362,7 @@
  (defun rst-compile-slides-preview ()
    "Convert the document to an S5 slide presentation and launch a preview program."
    (interactive)

Modified: packages/python-docutils/trunk/debian/changelog
===================================================================
--- packages/python-docutils/trunk/debian/changelog	2009-12-15 05:38:26 UTC (rev 10788)
+++ packages/python-docutils/trunk/debian/changelog	2009-12-15 12:20:28 UTC (rev 10789)
@@ -1,3 +1,10 @@
+python-docutils (0.6-3) UNRELEASED; urgency=low
+
+  * Update patch fixing insecure use of temporary files to be compatible with
+    XEmacs 21.
+
+ -- Jakub Wilk <ubanus at users.sf.net>  Tue, 15 Dec 2009 13:11:14 +0100
+
 python-docutils (0.6-2) unstable; urgency=high
 
   * Unconditionally recommend python-lxml, as it is used by

Modified: packages/python-docutils/trunk/debian/patches/emacs-temporary-files.diff
===================================================================
--- packages/python-docutils/trunk/debian/patches/emacs-temporary-files.diff	2009-12-15 05:38:26 UTC (rev 10788)
+++ packages/python-docutils/trunk/debian/patches/emacs-temporary-files.diff	2009-12-15 12:20:28 UTC (rev 10789)
@@ -3,30 +3,79 @@
 Author: Jakub Wilk <ubanus at users.sf.net>
 Bug: http://sourceforge.net/tracker/?func=detail&aid=2912890&group_id=38414&atid=422030
 Bug-Debian: http://bugs.debian.org/560755
-Last-Update: 2009-12-13
+Last-Update: 2009-12-15
 
 Index: python-docutils-0.6/tools/editors/emacs/rst.el
 ===================================================================
 --- python-docutils-0.6.orig/tools/editors/emacs/rst.el	2009-05-21 11:02:22.000000000 +0200
-+++ python-docutils-0.6/tools/editors/emacs/rst.el	2009-12-13 18:22:16.000000000 +0100
-@@ -3301,13 +3301,32 @@
++++ python-docutils-0.6/tools/editors/emacs/rst.el	2009-12-15 13:10:49.000000000 +0100
+@@ -3301,13 +3301,81 @@
       (cadr (assq 'pseudoxml rst-compile-toolsets))
       standard-output)))
  
 +(defvar rst-temp-dir nil)
 +(make-variable-buffer-local 'rst-temp-dir)
 +
++;; make-temp-file is not available in XEmacs 21
++(if (fboundp 'make-temp-file)
++  (defun rst-make-temp-dir (prefix) (make-temp-file prefix t))
++  (defun rst-make-temp-dir (prefix)
++    (let ((umask (default-file-modes)) file)
++      (unwind-protect
++        (progn
++          (set-default-file-modes 448) ; o700
++          (while
++            (condition-case ()
++              (progn
++                (setq file
++                  (make-temp-name
++                    (if (zerop (length prefix))
++                      (file-name-as-directory (temp-directory))
++                      (expand-file-name prefix (temp-directory))
++                    )
++                  )
++                )
++                (make-directory file)
++                nil
++              )
++              (file-already-exists t)
++            )
++            nil
++          )
++          file
++        )
++        (set-default-file-modes umask)
++      )
++    )
++  )
++)
++
 +(defun rst-get-temp-dir ()
 +  (or rst-temp-dir
-+    (setq rst-temp-dir 
-+      (file-name-as-directory (make-temp-file "rst-" t))
++    (setq rst-temp-dir
++      (file-name-as-directory (rst-make-temp-dir "rst-"))
 +    )
 +  )
 +)
 +
++;; dired-delete-file is not available in XEmacs 21
++(defun rst-delete-file (file)
++  (if (not (eq t (car (file-attributes file))))
++    (delete-file file)
++    (when
++      (setq files (directory-files file t "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*"))
++      (while files
++        (rst-delete-file (car files))
++        (setq files (cdr files))
++      )
++    )
++    (delete-directory file)
++  )
++)
++
 +(defun rst-remove-temp-dir ()
 +  (require 'dired)
-+  (if rst-temp-dir (dired-delete-file rst-temp-dir 'always))
++  (if rst-temp-dir (rst-delete-file rst-temp-dir))
 +)
 +
 +(add-hook 'kill-buffer-hook 'rst-remove-temp-dir)
@@ -43,7 +92,7 @@
  	 (command (format "%s %s %s && %s %s"
  			  (cadr (assq 'pdf rst-compile-toolsets))
  			  buffer-file-name tmp-filename
-@@ -3323,7 +3342,7 @@
+@@ -3323,7 +3391,7 @@
  (defun rst-compile-slides-preview ()
    "Convert the document to an S5 slide presentation and launch a preview program."
    (interactive)




More information about the Python-modules-commits mailing list