Debian / debiman

debiman generates a static manpage HTML repository out of a Debian archive
Apache License 2.0
185 stars 46 forks source link

Package blacklist #139

Open CRKatri opened 2 years ago

CRKatri commented 2 years ago

It would be nice if it was possible to set a blacklist of packages that I would not like downloaded/extracted. This new option would accept a comma separated list of packages like -only_render_pkgs except be for packages to skip downloading for, instead of a whitelist of packages to render.

stapelberg commented 2 years ago

What do you need this for? Either way, should be easy enough to implement. Do you want to send a PR?

CRKatri commented 2 years ago

Well I wanted to exclude certain packages with conflicting manpages, because there isn't a good way to programatically decide which is a better packages (ie flex vs flex-old). I have a bunch of jank patches to extract the manpages in a format to be parsed by mandoc's man.cgi which won't work well with conflicting manpages.

I was able to implement this by changing https://github.com/Debian/debiman/blob/master/cmd/debiman/getpackages.go#L91 to check a map of strings and bool and if it's in there:

entry = pkgEntry{}
continue

It seemed to work correctly based of some small testing

stapelberg commented 2 years ago

It would probably be a little cleaner to do the check next to line https://github.com/Debian/debiman/blob/38831b8b322b5818446765c3b7bd335b4974f425/cmd/debiman/getpackages.go#L131

Do you want to send a PR for this?