Package: duck
Severity: wishlist

Please warn about Homepage fields (only) that point to download sites.
Download sites are not "homepages" and should not be used like that.

The best way to detect them is to look for a h1 containing "Index of"
at the start of the page, a multi-line regex like this should work: 

<body>\s*<h1>Index of [^<]*</h1>

This is what the Apache auto-index module does, but other web servers
may have other formats, so I suggest you research what each of the most
popular web servers do. Probably the Netcraft survey is useful but I
would suggest going through all the popular open source web servers.

http://news.netcraft.com/archives/2015/01/15/january-2015-web-server-survey.html

There should also be some detection solely via the URL:

URLs to ftp servers that end in a slash should be detected too:

^ftp://.*/$

Maybe any ftp URL that doesn't end in .html? should be detected?
I'm not sure about how to check that in a regex though.

You could also detect specific servers based on the URLs:

The first one that could be added is the GNU FTP server:

Please match this regular expression:

(https?|ftp)://ftp\.gnu\.org/gnu/.*

and suggest replacing them with this replacement:

https://www.gnu.org/software/$1

Please match this regular expression:

(https?|ftp)://ftp\.gnu\.org/gnu/aspell/dict/[^/]*/

and suggest replacing them with this replacement (and ignore that URL):

https://ftp.gnu.org/gnu/aspell/dict/0index.html

These are the currently known ftp.gnu.org URLs:

$ grep -h Homepage.*ftp.gnu.org /var/lib/apt/lists/*Sources | sort -u
Homepage: ftp://ftp.gnu.org/gnu/aspell/dict/am/
Homepage: ftp://ftp.gnu.org/gnu/aspell/dict/he/
Homepage: ftp://ftp.gnu.org/gnu/aspell/dict/hy/
Homepage: ftp://ftp.gnu.org/non-gnu/chinese-fonts-truetype/
Homepage: http://ftp.gnu.org/gnu/aspell/dict/0index.html
Homepage: http://ftp.gnu.org/gnu/aspell/dict/ar/
Homepage: http://ftp.gnu.org/gnu/aspell/dict/fa/
Homepage: http://ftp.gnu.org/gnu/bc/
Homepage: http://ftp.gnu.org/gnu/pem/

-- 

bye,
pabs

https://wiki.debian.org/PaulWise

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to