File calibre-no-update-manpage.diff of Package calibre
diff -x '*~' -Naur calibre.bak//src/calibre/linux.py calibre/src/calibre/linux.py
--- calibre.bak//src/calibre/linux.py 2010-06-05 02:38:19.000000000 +0200
+++ calibre/src/calibre/linux.py 2010-06-05 21:12:56.837641453 +0200
@@ -291,10 +291,11 @@
if isfreebsd:
manpath = os.path.join(self.opts.staging_root, 'man/man1')
else:
- manpath = os.path.join(self.opts.staging_sharedir, 'man/man1')
+ self.info('Directory for MAN pages: %s' % self.opts.staging_mandir)
+ manpath = os.path.join(self.opts.staging_mandir, 'man1')
if not os.path.exists(manpath):
os.makedirs(manpath)
- self.info('Installing MAN pages...')
+ self.info('Installing MAN pages to %s...' % manpath)
for src in entry_points['console_scripts']:
prog, right = src.split('=')
prog = prog.strip()
@@ -307,7 +308,7 @@
if isfreebsd:
manfile = os.path.join(manpath, prog+'.1')
else:
- manfile = os.path.join(manpath, prog+'.1'+__appname__+'.bz2')
+ manfile = os.path.join(manpath, prog+'.1'+'.gz')
self.info('\tInstalling MAN page for', prog)
open(manfile, 'wb').write(raw)
self.manifest.append(manfile)
diff -x '*~' -Naur calibre.bak//src/calibre/utils/help2man.py calibre/src/calibre/utils/help2man.py
--- calibre.bak//src/calibre/utils/help2man.py 2010-06-05 02:38:20.000000000 +0200
+++ calibre/src/calibre/utils/help2man.py 2010-06-05 21:14:49.376641317 +0200
@@ -3,7 +3,7 @@
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
-import time, bz2
+import time, gzip, StringIO
from calibre.constants import isfreebsd
from calibre.constants import __version__, __appname__, __author__
@@ -59,7 +59,15 @@
x in lines]
if not isfreebsd:
- return bz2.compress((u'\n'.join(lines)).encode('utf-8'))
+# return bz2.compress((u'\n'.join(lines)).encode('utf-8'))
+ buf = StringIO.StringIO()
+ f = gzip.GzipFile(mode="wb", fileobj=buf)
+ try:
+ f.write( (u'\n'.join(lines)).encode('utf-8') )
+ finally:
+ f.close()
+ return buf.getvalue()
+
else:
return (u'\n'.join(lines)).encode('utf-8')