r7358 - trunk/BOOK

Dan Nicholson dbn.lists at gmail.com
Sun Apr 13 22:36:01 PDT 2008


On Sun, Apr 13, 2008 at 9:51 PM, Alexander E. Patrakov
<patrakov at gmail.com> wrote:
> Dan Nicholson wrote:
>  > On Sun, Apr 13, 2008 at 8:21 PM, Alexander E. Patrakov
>  > <patrakov at gmail.com> wrote:
>  >> Dan Nicholson wrote:
>  >>
>  >>  > Sorry, I hadn't thought about that, but I think I have a good way that
>  >>  > works like Alexander suggested. Mesa uses something similar with
>  >>  > makedepend. Attached is the diff. Let me know if this seems sane (it
>  >>  > seems to be working for me in all the cases I can think of) and I'll
>  >>  > commit it. It finds files named '*.xml' or '*.xsl' outside of tmp and
>  >>  > .svn directories and adds them to a variable. The validxml target then
>  >>  > requires all the files named in the variable. I tested things out by
>  >>  > touching various files deep in the repo.
>  >>
>  >>  Try the following scenario:
>  >>
>  >>  1) Editor B checks out the book from SVN and renders it, thus creating the
>  >>  "deps" file.
>  >>  2) Editor A adds the package Foo, a changelog entry, and commits.
>  >>  3) Editor B does "svn up" and renders the book.
>  >>  4) Editor A fixes a small typo on the Foo page without altering the changelog,
>  >>  and commits
>  >>  5) Editor B does "svn up" and renders the book.
>  >>
>  >>  Will editor B pick up the typo fix in his rendered book after step 5?
>  >
>  > Yes. Since the foo page is */*/foo.xml (included by the find command),
>  > make will find that one of the prerequisites for blfs-full.xml is
>  > newer causing a chain of rebuilding.
>
>  That's assuming that the "find" command will run at all. I fail to see how
>  "make" will find out that the "deps" file is out of date (but I am a bit sleepy
>  in the morning and thus may be wrong here).

Because the deps file is included, it will need to exist. The only
time it would become out of date is if you added or removed a .xml or
.xsl file. In that case, you would have to force it to be rebuilt by
`rm deps' or `make clean'. However, if you added or removed a .xml
file, you would have to update index.xml or one of the chapter .xml
files to be useful. In which case, those changes would force
blfs-full.xml to be rebuilt. So, in practice, I don't believe this
would be an issue. In the case of removing a .xml file and an existing
deps file, you would get a make error due to a missing prerequisite.
You would need to force the deps file to be rebuilt in that case.

Personally, I think this is a worthwhile optimization even if there
are corner cases where you have to run `make clean' first. The process
of serializing and validating all the XML is very time consuming, and
I really don't want it to run unless necessary. I don't see it as
being any different than any other make driven software projects: if
you're hacking on the source, there will be times when you need to run
`make clean' to force the actions you want.

If this is really not something people want, I can easily change it so
that validxml is always run. I certainly didn't introduce these
changes to make people's lives more difficult.

--
Dan



More information about the blfs-dev mailing list