Remove HTML-formatted man pages
This commit is contained in:
parent
aa94548c71
commit
7e17853326
3 changed files with 6 additions and 1 deletions
4
sql/update-2016-10-03.sql
Normal file
4
sql/update-2016-10-03.sql
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
-- This check is not consistent with the HTML-check in util/add_dir.pl, but it
|
||||
-- happens to match exactly the same man pages currently.
|
||||
DELETE FROM man WHERE section = 'html';
|
||||
DELETE FROM contents c WHERE NOT EXISTS(SELECT 1 FROM man m WHERE m.hash = c.hash);
|
||||
|
|
@ -125,6 +125,7 @@ sub addman {
|
|||
|
||||
my($enc, $dec) = decodeman($dat, $locale);
|
||||
print "Invalid encoding or empty file: $path\n" and return if !$enc;
|
||||
print "Ignoring HTML-formatted page: $path\n" and return if $dec =~ /^\s*<(?:html|head|\!DOCTYPE)/;
|
||||
|
||||
$db->do(q{INSERT INTO contents (hash, content) VALUES(decode(?, 'hex'),?)}, {}, $hash, $dec)
|
||||
if !$db->selectrow_arrayref(q{SELECT 1 FROM contents WHERE hash = decode(?, 'hex')}, {}, $hash);
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ dsInit(byId('q'), '/xml/search.xml?q=', function(item, tr) {
|
|||
},
|
||||
function(item) {
|
||||
searchRedir = true;
|
||||
location.href = '/'+item.getAttribute('name')+'.'+item.getAttribute('section').substr(0,1);
|
||||
location.href = '/'+item.getAttribute('name')+'.'+item.getAttribute('section');
|
||||
return item.getAttribute('name')+'('+item.getAttribute('section')+')';
|
||||
},
|
||||
function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue