diff options
author | Ian Lynagh <igloo@earth.li> | 2010-08-24 13:09:38 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2010-08-24 13:09:38 +0000 |
commit | 4e7bbe99d475acc47fed45124bf748f3e258a702 (patch) | |
tree | 231356727ddd949678ec9cb7be0c6328909e085b /utils/mkUserGuidePart/Main.hs | |
parent | af199e4953c6c75488a7c62b27cddf9fac09af84 (diff) | |
download | haskell-4e7bbe99d475acc47fed45124bf748f3e258a702.tar.gz |
Change how the dblatex/lndir problem is worked around
Hack: dblatex normalises the name of the main input file using
os.path.realpath, which means that if we're in a linked build tree,
it find the real source files rather than the symlinks in our link
tree. This is fine for the static sources, but it means it can't
find the generated sources.
We therefore also generate the main input file, so that it really
is in the link tree, and thus dblatex can find everything.
Diffstat (limited to 'utils/mkUserGuidePart/Main.hs')
-rw-r--r-- | utils/mkUserGuidePart/Main.hs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/utils/mkUserGuidePart/Main.hs b/utils/mkUserGuidePart/Main.hs index 114114ca1c..c415eb4f49 100644 --- a/utils/mkUserGuidePart/Main.hs +++ b/utils/mkUserGuidePart/Main.hs @@ -12,12 +12,35 @@ main = do args <- getArgs [] -> error "Need to give filename to generate as an argument" [f] -> case f of + "docs/users_guide/users_guide.xml" -> + writeFile f userGuideMain "docs/users_guide/what_glasgow_exts_does.gen.xml" -> writeFile f whatGlasgowExtsDoes _ -> error ("Don't know what to do for " ++ show f) _ -> error "Bad args" +-- Hack: dblatex normalises the name of the main input file using +-- os.path.realpath, which means that if we're in a linked build tree, +-- it find the real source files rather than the symlinks in our link +-- tree. This is fine for the static sources, but it means it can't +-- find the generated sources. +-- We therefore also generate the main input file, so that it really +-- is in the link tree, and thus dblatex can find everything. +userGuideMain :: String +userGuideMain = unlines [ + "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>", + "<!DOCTYPE book PUBLIC \"-//OASIS//DTD DocBook XML V4.2//EN\"", + " \"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd\" [", + "<!ENTITY % ug-ent SYSTEM \"ug-ent.xml\">", + "%ug-ent;", + "<!ENTITY ug-book SYSTEM \"ug-book.xml\">", + "]>", + "", + "<book id=\"users-guide\">", + "&ug-book;", + "</book>"] + whatGlasgowExtsDoes :: String whatGlasgowExtsDoes = case maybeInitLast glasgowExtsFlags of Just (xs, x) -> |