diff --git a/sql/update-2016-10-16.sql b/sql/update-2016-10-16.sql new file mode 100644 index 0000000..2a630a6 --- /dev/null +++ b/sql/update-2016-10-16.sql @@ -0,0 +1,19 @@ +-- Various non-manpages +DELETE FROM man + WHERE filename ~ '/Makefile\.(in|am)$' + OR filename ~ '/\.cvsignore(\.gz)?$' + OR filename !~ '/[^/]*\.[^/]*$' + OR filename ~ '/man\.tmp$'; + +-- Wrong locales, found with: +-- SELECT DISTINCT Locale FROM man ORDER BY locale; +UPDATE man SET locale = NULL + WHERE locale = '5man' + OR locale = 'c' + OR locale ~ '^man.?$' + OR locale ~ '^Man-Part[12]$'; + +-- Man page containing only a '$1'. Likely a build failure in earlier FreeBSD releases. +DELETE FROM man WHERE hash = '\x5ea7b8101325c704551852f70b652e0a2b0d7c12'; + +DELETE FROM contents c WHERE NOT EXISTS(SELECT 1 FROM man m WHERE m.hash = c.hash); diff --git a/util/add_dir.pl b/util/add_dir.pl index 7ab29b0..4bfc8f4 100755 --- a/util/add_dir.pl +++ b/util/add_dir.pl @@ -154,9 +154,23 @@ find sub { return warn "abs_path($File::Find::name): $!\n" if !$path; return warn "$vpath ($path) points outside of the tar directory!\n" if $path !~ s/^\Q$dir\E//; # Note: fltk also creates pre-formatted pages in /cat$sectre/, but those are ignored. - # TODO: Also ignore html and INDEX sections + return warn "Ignoring $vpath\n" if $vpath !~ m{man(?:/([^/]+))?/man[0-9n]/([^/]+)$}; - addman $pkgid, $vpath, $2, $1; + my($locale, $fn) = ($1, $2); + return warn "Ignoring $vpath\n" if + $fn =~ /^Makefile\.(in|am)$/ + || $fn =~ /^\.cvsignore(\.gz)?$/ + || $fn !~ /\./ # Also excludes INDEX files + || $fn eq 'man.tmp'; + + $locale = undef if $locale && ( + $locale eq '5man' + || $locale eq 'c' + || $locale =~ /^man.?$/ + || $locale =~ /^Man-Part[12]/ + ); + + addman $pkgid, $vpath, $fn, $locale; $found++; }, $dir;