[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: the one-space Homepage:

On Sun, 14 Jan 2007 08:18:48 +0200
Leonard Norrgård <vinsci@refactor.fi> wrote:

> One of the reasons people use one space in front of Homepage: is
> probably because the developer reference asks the maintainer to make
> sure it matches the regexp /^ Homepage: [^ ]*$/, "which allows
> packages.debian.org to parse it correctly.":
> http://www.debian.org/doc/developers-reference/ch-best-pkging-practices.en.html#s-bpp-upstream-info
> -- Leonard

Actually, that page is self-contradictory. The section above indicates
a need for two spaces because the 'H' is indented one space past the
'.' which itself is indented one space. (From the New Maintainer's
Guide: "Line 12 is where the long description goes. This should be a
paragraph which gives more details about the package. Column 1 of each
line should be empty. There must be no blank lines, but you can put a
single . (dot) in a column to simulate that." [1]) Which infers that as
column one must always be empty, the period goes in column two, leading
to the conclusion that the example in the Developer's Reference puts the
'H' of Homepage in column three - the two space prefix. Syntax
highlighting of debian/control in vi indicates the same. Most (all?)
debian/control files that I've seen put the '.' in column two.

Indeed, the following paragraph indicates that the statement actually
does intend to indicate two spaces:

"Note the spaces prepending the line, which serves to break the lines
correctly. To see an example of how this displays, see

(space*s* prepending, not space prepending)

(Although the grammar is still incorrect; it should be "serve" instead
of "serves" as spaces is now plural.)

That URL shows the effect of having the extra space: the homepage is in
a monospace font when the rest of the description is proportionally
spaced. This only happens if the 'H' is in column three, not two.

The Developer's Reference (the only source of this two space prefix) is
recommending two spaces but specifying a reg exp that only matches a
one space prefix. The reg exp *should be* /^&nbsp;&nbsp;Homepage: [^ ]*
$/ or /^\s\sHomepage:\s[^\s]*$/ or some other method to clearly require
the use of the second space and prevent browsers collapsing two spaces
into one. As it is, either one or two spaces is perfectly acceptable to
packages.d.o as these pages demonstrate:

Both URL's are correctly parsed as HTML links and both links work. The
question of one space or two is not resolved by the quoted reg exp, it
is just made even more unclear.

The reg exp example should probably be:
/^  ?Homepage: [^ ]*$/

This shows that the second space is optional (because that is how
packages.d.o *actually handles the space* and the reg exp is given as a
rule *for packages.d.o parsing*, nothing else).

The reg exp is probably intended to indicate that the 'Homepage:' tag
is required and should not be changed to 'homepage:' or 'www:' and that
the URL itself must not contain spaces or end in a space, just like any
other URL.

If anyone fancies filing a bug, just bear in mind that the real issue
is whether dpkg et al are going to support a dedicated homepage field
any time soon.



Neil Williams

Attachment: pgpHL8J9RCL5C.pgp
Description: PGP signature

Reply to: