Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(808)

Issue 5498093: Sketch of not remaking html files (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 3 months ago by PhilEHolmes
Modified:
12 years, 2 months ago
Reviewers:
Graham Percival, email, Julien Rioux, mail
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Should probably have associated this with http://code.google.com/p/lilypond/issues/detail?id=2028. It's an attempt to stop make doc recreating the whole of build/out-www/offline-root/ every time it's run, whether any of the files there have been change or not. It changes the make file to stop it blindly deleting that directory, and then www_post.py to allow for the fact that the directory/ies might exist. It then checks whether the target file is newer than the source before recreating the target. On my quick machine, make LANGS='' doc where there is no work to do now only takes 5 seconds, as opposed to nearly 20. On my slow VM, it reduces the time from 2m 30s to 40s. I've tested it with a fresh make doc and confirmed all the required files exist after the make.

Patch Set 1 #

Total comments: 3

Patch Set 2 : Changes following previous review #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -28 lines) Patch
M GNUmakefile.in View 1 1 chunk +0 lines, -1 line 0 comments Download
M python/auxiliar/postprocess_html.py View 1 1 chunk +30 lines, -24 lines 0 comments Download
M scripts/build/www_post.py View 1 1 chunk +10 lines, -3 lines 1 comment Download

Messages

Total messages: 9
PhilEHolmes
Please review
12 years, 3 months ago (2011-12-31 15:53:53 UTC) #1
Graham Percival
a few minor quibbles; I'm on a ferry right now so I can't test a ...
12 years, 2 months ago (2012-01-02 21:41:23 UTC) #2
email_philholmes.net
----- Original Message ----- From: <graham@percival-music.ca> To: <PhilEHolmes@googlemail.com>; <percivall@gmail.com> Cc: <lilypond-devel@gnu.org>; <reply@codereview-hr.appspotmail.com> Sent: Monday, January ...
12 years, 2 months ago (2012-01-03 10:39:42 UTC) #3
mail_philholmes.net
----- Original Message ----- From: <graham@percival-music.ca> To: <PhilEHolmes@googlemail.com>; <percivall@gmail.com> Cc: <reply@codereview-hr.appspotmail.com>; <lilypond-devel@gnu.org> Sent: Monday, January ...
12 years, 2 months ago (2012-01-03 10:40:17 UTC) #4
email_philholmes.net
----- Original Message ----- From: "Phil Holmes" <email@philholmes.net> To: <PhilEHolmes@googlemail.com>; <percivall@gmail.com>; <graham@percival-music.ca>; <lilypond-devel@gnu.org>; <reply@codereview-hr.appspotmail.com> Cc: ...
12 years, 2 months ago (2012-01-08 18:02:32 UTC) #5
Graham Percival
LGTM
12 years, 2 months ago (2012-01-09 05:19:54 UTC) #6
Julien Rioux
Checking the file timestamps will be a good thing. It might be better to just ...
12 years, 2 months ago (2012-01-10 13:34:22 UTC) #7
mail_philholmes.net
----- Original Message ----- From: <julien.rioux@gmail.com> To: <PhilEHolmes@googlemail.com>; <graham@percival-music.ca>; <email@philholmes.net>; <mail@philholmes.net> Cc: <lilypond-devel@gnu.org>; <reply@codereview-hr.appspotmail.com> Sent: ...
12 years, 2 months ago (2012-01-11 17:38:55 UTC) #8
Julien Rioux
12 years, 2 months ago (2012-01-11 21:33:04 UTC) #9
On Wed, Jan 11, 2012 at 12:38 PM, Phil Holmes <mail@philholmes.net> wrote:
> ----- Original Message ----- From: <julien.rioux@gmail.com>
> To: <PhilEHolmes@googlemail.com>; <graham@percival-music.ca>;
> <email@philholmes.net>; <mail@philholmes.net>
> Cc: <lilypond-devel@gnu.org>; <reply@codereview-hr.appspotmail.com>
> Sent: Tuesday, January 10, 2012 1:34 PM
> Subject: Re: Sketch of not remaking html files (issue 5498093)
>
>
>
>> Checking the file timestamps will be a good thing. It might be better to
>> just replace the whole www_post script by make rules, but in the current
>> implementation this is a good improvement.
>>
>> Just a style thing, in general I notice that you use "function(arg)"
>> while the rest of python source code in the lilypond tree uses "function
>> (arg)". I don't like the extra space myself but I prefer keeping to one
>> consistent style.
>
>
> Will try to pick this up.
>
>
>> My other comment is similar to Graham's:
>>
>>
>> http://codereview.appspot.com/5498093/diff/5001/scripts/build/www_post.py
>> File scripts/build/www_post.py (right):
>>
>>
>>
http://codereview.appspot.com/5498093/diff/5001/scripts/build/www_post.py#new...
>> scripts/build/www_post.py:83: sys.exc_clear()
>> Why do you catch this exception? Would it not be sufficient to test for
>> the existence of the destination file?
>>
>> http://codereview.appspot.com/5498093/
>>
>
> TBH, I don't understand the function of os.link - and catching an exception
> when it failed worked perfectly.  If you have a better suggestion, I'd
> happily adopt it.
>
> --
> Phil Holmes
>
>

What I have in mind is something very similar to what you did with
os.mkdir a few lines above. So for example

for f in hardlinked_files:
    dest = strip_file_name[t] (f)
    if not os.path.exists (dest):
        os.link (f, dest)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b