misc/chm2pdf: Patched to fix problem with file name with spaces.

Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
This commit is contained in:
Ozan Türkyılmaz 2011-05-18 08:22:48 -03:00 committed by Robby Workman
parent 834e79ae02
commit 490559255d
5 changed files with 52 additions and 11 deletions

View File

@ -1,4 +1,3 @@
chm2pdf is a simple Python script that converts CHM files into
PDF files.
chm2pdf is a simple Python script that converts CHM files into PDF files.
It requires chmlib-examples, pychm and htmldoc, all available at SlackBuilds.org.
This requires chmlib-examples, pychm and htmldoc.

View File

@ -27,15 +27,13 @@
PRGNAM=chm2pdf
VERSION=${VERSION:-0.9.1}
BUILD=${BUILD:-2}
BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$( uname -m ) ;;
esac
fi
@ -65,6 +63,9 @@ find . \
# Patch from Gentoo: http://bugs.gentoo.org/205208
cat $CWD/patches/tempdir.patch | patch -p1
# patch to fix problem with file name with spaces
cat $CWD/patches/filename.patch | patch -p1
python setup.py build
python setup.py install --root $PKG

View File

@ -7,4 +7,4 @@ DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
MAINTAINER="Ozan Türkyılmaz"
EMAIL="ozan.turkyilmaz@gmail.com"
APPROVED="dsomero"
APPROVED="dsomero,Niels Horn"

View File

@ -0,0 +1,41 @@
--- a/chm2pdf 2011-01-16 10:52:29.000000000 +0100
+++ b/chm2pdf 2011-01-16 12:41:26.541000035 +0100
@@ -112,7 +112,7 @@
takes the list of files inside the chm archive, with the correct urls of each one.
'''
- os.system('enum_chmLib '+filename+' > '+CHM2PDF_WORK_DIR+'/urlslist.txt')
+ os.system('enum_chmLib "'+filename+'" > "'+CHM2PDF_WORK_DIR+'/urlslist.txt"')
flist=open(CHM2PDF_WORK_DIR+'/urlslist.txt','rU')
urls_list=[]
for line in flist.readlines()[3:]:
@@ -378,7 +378,7 @@
if os.path.exists(page_filename) and (options['titlefile'] == '' or not options['titlefile'] in url):
htmlout_filename=CHM2PDF_WORK_DIR+'/temp'+'%(#)04d' %{"#":c}+'.html'
- htmlout_filename_list+=' '+ htmlout_filename
+ htmlout_filename_list+=' "'+ htmlout_filename + '"'
htmlout_filenames.append(htmlout_filename)
if options['dontextract'] == '':
@@ -583,7 +583,7 @@
if options['verbose']=='--verbose' and options['verbositylevel']=='high':
print 'htmldoc' + htmldoc_opts + ' ' + htmlout_filename_list + " -f "+ outputfilename + " > /dev/null"
- exit_value=os.system ('htmldoc' + htmldoc_opts + ' ' + htmlout_filename_list + " -f "+ outputfilename + " > /dev/null")
+ exit_value=os.system ('htmldoc' + htmldoc_opts + ' ' + htmlout_filename_list + ' -f "'+ outputfilename + '" > /dev/null')
if exit_value != 0:
print 'Something wrong happened when launching htmldoc.'
@@ -1085,9 +1085,9 @@
print 'Will use the files in ' + CHM2PDF_ORIG_DIR + ' and ' + CHM2PDF_WORK_DIR + '.'
else:
if options['verbose'] == '--verbose' and options['verbositylevel'] == 'high':
- os.system('extract_chmLib ' + filename + ' ' + CHM2PDF_ORIG_DIR)
+ 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')
convert_to_pdf(cfile, filename, outputfilename, options)
shutil.rmtree(CHM2PDF_TEMP_WORK_DIR)

View File

@ -5,11 +5,11 @@
# exactly 11 lines for the formatting to be correct. It's also customary to
# leave one space after the ':'.
|-----handy-ruler-----------------------------------------------------|
chm2pdf: chm2pdf (CHM to PDF converter)
chm2pdf:
|-----handy-ruler------------------------------------------------------|
chm2pdf: chm2pdf (CHM to PDF converter)
chm2pdf:
chm2pdf: chm2pdf is a simple Python script that converts CHM files into PDF
chm2pdf: files.
chm2pdf: files.
chm2pdf:
chm2pdf: Homepage: http://code.google.com/p/chm2pdf
chm2pdf: