tag 502044 patch
tag 501959 patch
thanks

Hi,

Attached is the diff for my proposed NMU. The new package version has NOT been 
uploaded to give you the opportunity to make a better upload to address those 
issues.

Note that a separate upload is required for lenny.

Kind regards,
-- 
Raphael Geissert - Debian Maintainer
www.debian.org - get.debian.net
diff -u chm2pdf-0.9.1/debian/rules chm2pdf-0.9.1/debian/rules
--- chm2pdf-0.9.1/debian/rules
+++ chm2pdf-0.9.1/debian/rules
@@ -3,6 +3,7 @@
 DEB_PYTHON_SYSTEM=pysupport
 
 include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/patchsys-quilt.mk
 # include /usr/share/cdbs/1/rules/simple-patchsys.mk
 include /usr/share/cdbs/1/class/python-distutils.mk
 
diff -u chm2pdf-0.9.1/debian/changelog chm2pdf-0.9.1/debian/changelog
--- chm2pdf-0.9.1/debian/changelog
+++ chm2pdf-0.9.1/debian/changelog
@@ -1,3 +1,14 @@
+chm2pdf (0.9.1-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/control, debian/rules: use quilt to manage patches
+  * insecure_temp_dirs.diff (Closes: #501959):
+    - Don't use static names to create temp dirs.
+    - Commented out --dontextract from usage info, as it is not very useful now
+  * bashisms.diff: fix bashism in chm2pdf (Closes: #502044).
+
+ -- Raphael Geissert <[EMAIL PROTECTED]>  Sun, 12 Oct 2008 17:54:24 -0500
+
 chm2pdf (0.9.1-1) unstable; urgency=low
 
   * New upstream release
diff -u chm2pdf-0.9.1/debian/control chm2pdf-0.9.1/debian/control
--- chm2pdf-0.9.1/debian/control
+++ chm2pdf-0.9.1/debian/control
@@ -5,7 +5,8 @@
 Build-Depends: cdbs (>= 0.4.49), 
  debhelper (>= 5), 
  python, 
- python-support (>= 0.6.4)
+ python-support (>= 0.6.4),
+ quilt
 Standards-Version: 3.8.0
 
 Package: chm2pdf
only in patch2:
unchanged:
--- chm2pdf-0.9.1.orig/debian/patches/bashisms.diff
+++ chm2pdf-0.9.1/debian/patches/bashisms.diff
@@ -0,0 +1,13 @@
+Index: chm2pdf-0.9.1/chm2pdf
+===================================================================
+--- chm2pdf-0.9.1.orig/chm2pdf
++++ chm2pdf-0.9.1/chm2pdf
+@@ -1087,7 +1087,7 @@ def main(argv):
+         if options['verbose'] == '--verbose' and options['verbositylevel'] == 'high':
+             os.system('extract_chmLib ' + filename + ' ' + CHM2PDF_ORIG_DIR)
+         else:
+-            os.system('extract_chmLib ' + filename + ' ' + CHM2PDF_ORIG_DIR + '&> /dev/null')
++            os.system('extract_chmLib ' + filename + ' ' + CHM2PDF_ORIG_DIR + '> /dev/null 2>&1')
+     
+     convert_to_pdf(cfile, filename, outputfilename, options)
+     shutil.rmtree(CHM2PDF_TEMP_WORK_DIR)
only in patch2:
unchanged:
--- chm2pdf-0.9.1.orig/debian/patches/insecure_temp_dirs.diff
+++ chm2pdf-0.9.1/debian/patches/insecure_temp_dirs.diff
@@ -0,0 +1,73 @@
+Index: chm2pdf-0.9.1/chm2pdf
+===================================================================
+--- chm2pdf-0.9.1.orig/chm2pdf
++++ chm2pdf-0.9.1/chm2pdf
+@@ -27,6 +27,8 @@ import sgmllib
+ import os, os.path
+ import re, glob
+ import getopt
++import tempfile
++import shutil
+ # from BeautifulSoup import BeautifulSoup
+ 
+ global version
+@@ -39,8 +41,8 @@ global CHM2PDF_ORIG_DIR
+ global filename #the input filename
+ 
+ version = '0.9.1'
+-CHM2PDF_TEMP_WORK_DIR='/tmp/chm2pdf/work' 
+-CHM2PDF_TEMP_ORIG_DIR='/tmp/chm2pdf/orig'
++CHM2PDF_TEMP_WORK_DIR=tempfile.mkdtemp()
++CHM2PDF_TEMP_ORIG_DIR=tempfile.mkdtemp()
+ 
+ 
+ 
+@@ -299,16 +301,6 @@ def convert_to_pdf(cfile, filename, outp
+     # ########################### File extraction and correction: START ############################
+     #
+     if options['dontextract'] == '':
+-    
+-        try:
+-            os.mkdir(CHM2PDF_TEMP_WORK_DIR)
+-        except OSError: # The directory already exists.
+-            pass
+-        
+-        try:
+-            os.mkdir(CHM2PDF_TEMP_ORIG_DIR)
+-        except OSError: # The directory already exists.
+-            pass
+         
+         try:
+             os.mkdir(CHM2PDF_ORIG_DIR)
+@@ -620,7 +612,7 @@ def usage (name):
+     print '\t--continuous\n\t\tSpecifies  that  the  HTML  sources are unstructured (plain web pages).\n\t\tNo page breaks are inserted between each file or URL in the output.'
+     print '\t--cookies \'name="value with space"; name=value\'\n\t\t'
+     print '\t--datadir directory\n\t\tSpecifies the  location  of  the  HTMLDOC  data  files,  usually  /usr/share/htmldoc  or  C:\Program Files\HTMLDOC '
+-    print "\t--dontextract \n\t\tIf given, %s will not extract the HTML files from the given CHM file, but will use previously extracted copies from the temporary directory " %name + '(i.e. ' + CHM2PDF_TEMP_ORIG_DIR + ' and ' + CHM2PDF_TEMP_WORK_DIR + '). Usually you will use this option after you have used the \'--extract-only\' option to extract the files in order to correct them manually (in ' + CHM2PDF_TEMP_WORK_DIR + '). After the correction, a call with \'--dontextract\' will not overwrite your changes, but will use the corrected files instead.'
++#    print "\t--dontextract \n\t\tIf given, %s will not extract the HTML files from the given CHM file, but will use previously extracted copies from the temporary directory " %name + '(i.e. ' + CHM2PDF_TEMP_ORIG_DIR + ' and ' + CHM2PDF_TEMP_WORK_DIR + '). Usually you will use this option after you have used the \'--extract-only\' option to extract the files in order to correct them manually (in ' + CHM2PDF_TEMP_WORK_DIR + '). After the correction, a call with \'--dontextract\' will not overwrite your changes, but will use the corrected files instead.'
+     print '\t--duplex\n\t\tSpecifies that the output should be formatted for double-sided printing.'
+     print '\t--effectduration {0.1..10.0}\n\t\tSpecifies the duration in seconds of PDF page transition effects.'
+     print '\t--embedfonts\n\t\tSpecifies that fonts should be embedded in PDF output.'
+@@ -1084,13 +1076,6 @@ def main(argv):
+         print 'CHM file "' + filename + '" not found!'
+         return
+     
+-    #remove temporary files
+-    if options['dontextract'] == '':
+-        if options['verbose']=='--verbose' and options['verbositylevel']=='high':
+-            print 'Removing any previous temporary files...'
+-        os.system('rm -r '+CHM2PDF_ORIG_DIR+'/*')
+-        os.system('rm -r '+CHM2PDF_WORK_DIR+'/*')
+-    
+     cfile = chm.CHMFile()
+     cfile.LoadCHM(filename)
+ 
+@@ -1105,6 +1090,8 @@ def main(argv):
+             os.system('extract_chmLib ' + filename + ' ' + CHM2PDF_ORIG_DIR + '&> /dev/null')
+     
+     convert_to_pdf(cfile, filename, outputfilename, options)
++    shutil.rmtree(CHM2PDF_TEMP_WORK_DIR)
++    shutil.rmtree(CHM2PDF_TEMP_ORIG_DIR)
+ 
+ 
+ if __name__ == '__main__':
only in patch2:
unchanged:
--- chm2pdf-0.9.1.orig/debian/patches/series
+++ chm2pdf-0.9.1/debian/patches/series
@@ -0,0 +1,2 @@
+insecure_temp_dirs.diff
+bashisms.diff

Reply via email to