On 4-6-2012 23:58, Andy Thomas wrote:

274,279c274,281
<              if os.execute(format(zipper.uncompressed,epubfile,"mimetype")) 
then
<                  os.execute(format(zipper.compressed,epubfile,"META-INF"))
<                  os.execute(format(zipper.compressed,epubfile,"OPS"))
<                  done = zipper.name
<              else
<                  list[#list+1] = zipper.name
---
             if not done then
                 if os.execute(format(zipper.uncompressed,epubfile,"mimetype")) 
then
                     os.execute(format(zipper.compressed,epubfile,"META-INF"))
                     os.execute(format(zipper.compressed,epubfile,"OPS"))
                     done = zipper.name
                 else
                     list[#list+1] = zipper.name
                 end

As we give a list of zippers on failure, the following might be better:

        local done = false

        for i=1,#zippers do
            local zipper = zippers[i]
if os.execute(format(zipper.uncompressed,epubfile,"mimetype")) then
                os.execute(format(zipper.compressed,epubfile,"META-INF"))
                os.execute(format(zipper.compressed,epubfile,"OPS"))
                done = zipper.name
                break
            end
        end

        lfs.chdir("..")

        if done then
application.report("epub archive made using %s: %s",done,file.join(epubpath,epubfile))
        else
            local list = { }
            for i=1,#zippers do
                list[#list+1] = zipper.name
            end
application.report("no epub archive made, install one of: %s",concat(list," "))
        end

(I will look into the os.execute later .. remind me if needed.)

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to