From 5577b5c6f0fd44017f549689d5b56759fddb69e6 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sun, 6 Feb 2011 14:50:06 +0000 Subject: [PATCH] Add lyxpak.py to the distribution, and configure it appropriately for export. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37506 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/Makefile.am | 1 + lib/configure.py | 25 ++++++++++++++++++++ {development/tools => lib/scripts}/lyxpak.py | 0 3 files changed, 26 insertions(+) rename {development/tools => lib/scripts}/lyxpak.py (100%) diff --git a/lib/Makefile.am b/lib/Makefile.am index 918452d357..434bb13837 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1236,6 +1236,7 @@ dist_scripts_PYTHON = \ scripts/layout2layout.py \ scripts/legacy_lyxpreview2ppm.py \ scripts/listerrors \ + scripts/lyxpak.py \ scripts/lyxpreview2bitmap.py \ scripts/lyxpreview-lytex2bitmap.py \ scripts/lyxpreview-platex2bitmap.py \ diff --git a/lib/configure.py b/lib/configure.py index 847937e7ea..adbc516a22 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -868,6 +868,31 @@ def checkConverterEntries(): checkProg('a Noteedit -> LilyPond converter', ['noteedit --export-lilypond $$i'], rc_entry = [ r'\converter noteedit lilypond "%%" ""', '']) # + # currently (as of 2/5/11), lyxpak outputs a tar archive if tar is found, + # and a zip archive if tar is not found but zip is. if tar is found, then + # it looks for gzip and bzip2, in that order, and compresses the archive + # using the one it finds. + # so, we mimic this search, and configure the appropriate version. + path, prog = checkProg('the LyX packing script', ['tar', 'zip']) + if prog: + cmd = r'\converter lyx %s "python -tt $$s/scripts/lyxpak.py $$i" ""' + if prog == "zip": + addToRC(r'\Format lyxzip zip "LyX Archive (zip)" "" "" "" "document"') + addToRC(cmd % "lyxzip") + elif prog == "tar": + path, prog = checkProg('gzip or bzip2', ['gzip', 'bzip2']) + if prog == "gzip": + addToRC(r'\Format lyxgz gz "LyX Archive (tar.gz)" "" "" "" "document"') + outfmt = "lyxgz" + elif prog == "bzip2": + addToRC(r'\Format lyxbz2 bz2 "LyX Archive (tar.bz2)" "" "" "" "document"') + outfmt = "lyxbz2" + else: + addToRC(r'\Format lyxtar tar "LyX Archive (tar)" "" "" "" "document"') + outfmt = "lyxtar" + addToRC(cmd % outfmt) + + # # FIXME: no rc_entry? comment it out # checkProg('Image converter', ['convert $$i $$o']) # diff --git a/development/tools/lyxpak.py b/lib/scripts/lyxpak.py similarity index 100% rename from development/tools/lyxpak.py rename to lib/scripts/lyxpak.py -- 2.39.5