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

Issue 567340043: Calculate download sizes rather than hardcoding them

Can't Edit
Can't Publish+Mail
Start Review
Created:
4 months, 1 week ago by dak
Modified:
4 months ago
Reviewers:
lemzwerg, hahnjo
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Calculate download sizes rather than hardcoding them This has several problems yet. The most relevant problem may be that I have no clue how our actual webpages are being compiled, so this likely would render the web pages silent about download sizes. It works on the offline-root web pages intended as HTML documentation. However, at the completion of make doc, numerous files are flagged as not being available for size calculations. This is not really a problem with this patch: it turns out that the respective links would actually all be dead. So this is something that should be fixed independently. In contrast, the live webpage may have some links where the script complains that aren't dead as much as dependent on the browser's language settings (which is a bad idea since it does not allow browsing documentation that does not correspond to your selected browser language). Contains two commits: Replace hardwired download sizes with HTML comment Download sizes given in web page and HTML pages tended to have diverged a lot from reality. This patch removes all of the download sizes but adds special HTML comments into the HTML files that previously contained size estimates. These comments can then be replaced by the actual sizes with a postprocessing script. As a consequence, PDF and Info versions now no longer contain download size estimates. Replace HTML size comments with human-readable size This calculates download sizes as the last step of HTML generation and puts them into the HTML files for reference. The work is done by scripts/build/fix-docsize.sh . It does that by replacing the size-requesting HTML comments in the files given on the command line by the respective human-readable size. scripts/build/fix-docsize.sh is run in the respective directories as the final step of generating the HTML versions. This script uses ls -sh in order to get a human-readable size spec.

Patch Set 1 #

Total comments: 2

Patch Set 2 : newlines in sed scripts. "fix-docsize:" diagnostics at end of make doc are EXPECTED and indicate p… #

Patch Set 3 : Rebase to current master and add Portuguese support #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+425 lines, -321 lines) Patch
M Documentation/ca/web.texi View 1 2 3 chunks +5 lines, -5 lines 0 comments Download
M Documentation/ca/web/community.itexi View 1 chunk +2 lines, -2 lines 0 comments Download
M Documentation/ca/web/manuals.itexi View 10 chunks +20 lines, -20 lines 0 comments Download
M Documentation/common-macros.itexi View 1 chunk +22 lines, -0 lines 0 comments Download
M Documentation/cs/web.texi View 3 chunks +5 lines, -5 lines 0 comments Download
M Documentation/cs/web/community.itexi View 1 chunk +2 lines, -2 lines 0 comments Download
M Documentation/cs/web/manuals.itexi View 10 chunks +20 lines, -20 lines 0 comments Download
M Documentation/de/web.texi View 3 chunks +5 lines, -5 lines 0 comments Download
M Documentation/de/web/community.itexi View 1 chunk +2 lines, -2 lines 0 comments Download
M Documentation/de/web/manuals.itexi View 10 chunks +20 lines, -20 lines 0 comments Download
M Documentation/es/web.texi View 1 2 3 chunks +5 lines, -5 lines 0 comments Download
M Documentation/es/web/community.itexi View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M Documentation/es/web/manuals.itexi View 1 2 10 chunks +20 lines, -20 lines 0 comments Download
M Documentation/fr/web.texi View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M Documentation/fr/web/community.itexi View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M Documentation/fr/web/manuals.itexi View 1 2 10 chunks +20 lines, -20 lines 0 comments Download
M Documentation/hu/web.texi View 3 chunks +17 lines, -5 lines 0 comments Download
M Documentation/hu/web/community.itexi View 1 chunk +2 lines, -2 lines 0 comments Download
M Documentation/hu/web/manuals.itexi View 10 chunks +20 lines, -20 lines 0 comments Download
M Documentation/it/web.texi View 1 2 3 chunks +5 lines, -5 lines 0 comments Download
M Documentation/it/web/community.itexi View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M Documentation/it/web/manuals.itexi View 1 2 10 chunks +20 lines, -20 lines 0 comments Download
M Documentation/ja/web.texi View 1 2 3 chunks +5 lines, -5 lines 0 comments Download
M Documentation/ja/web/community.itexi View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M Documentation/ja/web/manuals.itexi View 1 2 10 chunks +20 lines, -20 lines 0 comments Download
M Documentation/nl/web.texi View 3 chunks +5 lines, -5 lines 0 comments Download
M Documentation/nl/web/manuals.itexi View 10 chunks +20 lines, -20 lines 0 comments Download
M Documentation/pt/web.texi View 1 2 3 chunks +5 lines, -5 lines 0 comments Download
M Documentation/pt/web/community.itexi View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M Documentation/pt/web/manuals.itexi View 1 2 10 chunks +20 lines, -20 lines 0 comments Download
M Documentation/web.texi View 3 chunks +5 lines, -5 lines 0 comments Download
M Documentation/web/community.itexi View 1 chunk +2 lines, -2 lines 0 comments Download
M Documentation/web/manuals.itexi View 10 chunks +20 lines, -20 lines 0 comments Download
M Documentation/zh/web.texi View 3 chunks +5 lines, -5 lines 0 comments Download
M Documentation/zh/web/community.itexi View 1 chunk +2 lines, -2 lines 0 comments Download
M Documentation/zh/web/manuals.itexi View 10 chunks +20 lines, -20 lines 0 comments Download
M GNUmakefile.in View 1 chunk +2 lines, -0 lines 0 comments Download
A scripts/build/fix-docsize.sh View 1 1 chunk +68 lines, -0 lines 1 comment Download

Messages

Total messages: 10
lemzwerg
Very nice, thanks! From visual inspection, LGTM, with only minor nits. https://codereview.appspot.com/567340043/diff/565730043/scripts/build/fix-docsize.sh File scripts/build/fix-docsize.sh (right): ...
4 months, 1 week ago (2020-03-06 06:57:15 UTC) #1
dak
newlines in sed scripts. "fix-docsize:" diagnostics at end of make doc are EXPECTED and indicate ...
4 months, 1 week ago (2020-03-06 13:38:23 UTC) #2
dak
Rebase to current master and add Portuguese support
4 months ago (2020-03-07 02:38:18 UTC) #3
hahnjo
A general question that I'm probably just unable to find in the script: As far ...
4 months ago (2020-03-08 20:25:50 UTC) #4
dak
On 2020/03/08 20:25:50, hahnjo wrote: > A general question that I'm probably just unable to ...
4 months ago (2020-03-08 20:45:46 UTC) #5
hahnjo
On 2020/03/08 20:45:46, dak wrote: > On 2020/03/08 20:25:50, hahnjo wrote: > > A general ...
4 months ago (2020-03-08 20:49:46 UTC) #6
dak
On 2020/03/08 20:49:46, hahnjo wrote: > On 2020/03/08 20:45:46, dak wrote: > > On 2020/03/08 ...
4 months ago (2020-03-08 21:07:17 UTC) #7
hahnjo
On 2020/03/08 21:07:17, dak wrote: > On 2020/03/08 20:49:46, hahnjo wrote: > > Hm okay, ...
4 months ago (2020-03-08 21:12:44 UTC) #8
dak
jonas.hahnfeld@gmail.com writes: > On 2020/03/08 21:07:17, dak wrote: >> On 2020/03/08 20:49:46, hahnjo wrote: >> ...
4 months ago (2020-03-08 21:26:36 UTC) #9
dak
4 months ago (2020-03-08 21:42:49 UTC) #10
David Kastrup <dak@gnu.org> writes:

> There is in stepmake/stepmake/texinfo-vars.make
>
> # Recursively scan the file $(1) for @include and @verbatiminclude, search
for
> # included files within the texinfo include dirs, and return all
dependencies.
> scan-texi = \
> $(foreach f, $(shell test -f $(1) && sed -ne
> "/^@\(verbatim\)\?include[[:space:]]/s/@\(verbatim\)\?include//p"
> $(1)), \
>         $(call find-texi,$(f)) \
>         $(call scan-texi,$(call find-texi,$(f))) \
> )
>
> which contains several GNUisms in the sed script.  And of course,
> nothing but GNU Make will work for the Makefiles.
>
> In short: I have no idea whether GNU sed might be prescribed already or
> not.

But then if it _is_ prescribed, I have no business complicating things
like

+            sed 's/^[  ]*\([^  ]*\)[   ]*\([^  ]*\)[   ]*$/'\

instead of using \+.  Wait, I didn't complicate the expression as
required.  This works by accident (or rather the longest match rule)
rather than anything else.  I think I did this properly in some
iteration, but not this one.  It needs to be rather something more
tedious like

+            sed 's/^[  ]*\([^ 	][^  ]*\)[ 	][   ]*\([^ 	][^  ]*\)[   ]*$/'\

So I have the choice to use \+ here (and frankly, then \s and \S for
space and non-space character classes also make sense, leading to

+            sed 's/^\s*\(\S\+\)\s\+\(\S\+\)\s*$/'\

) or forego -i .

But the current "some GNU sed" state does not make a whole lot of sense.

-- 
David Kastrup
Sign in to reply to this message.

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