Go to file
2023-02-01 06:12:47 -07:00
public remove dark mode 2022-12-23 07:31:26 -07:00
support Add various support bits for running openbsd.app 2023-02-01 06:12:47 -07:00
.envrc initial 2022-09-23 16:45:55 -06:00
.gitignore Add some style tweaks 2022-09-23 20:25:02 -06:00
flake.lock initial 2022-09-23 16:45:55 -06:00
flake.nix Render results as markdown to preserve \n and other formatting. 2022-09-28 15:09:05 -06:00
LICENSE remove stray form 2022-09-23 17:00:32 -06:00
openbsd.app.pl use pico's font 2022-12-01 10:53:50 -07:00
README.md Update readme, add pico 2022-11-30 12:00:21 -07:00
upgrade.sh Add various support bits for running openbsd.app 2023-02-01 06:12:47 -07:00

OpenBSD.app

A site that allows quick full-text searching of OpenBSD packages for -stable and -current.

Hacking

Generating FTS5 databases

$ sqlite3 stable.db
> ATTACH DATABASE '/usr/local/share/sqlports' AS ports;
> CREATE VIRTUAL TABLE
	    ports_fts
	USING fts5(
	    FULLPKGNAME,
	    FULLPKGPATH,
	    COMMENT,
	    DESCRIPTION);
> INSERT INTO
	    ports_fts
	(FULLPKGNAME, FULLPKGPATH, COMMENT, DESCRIPTION)
	SELECT
	    fullpkgname,
	    _paths.fullpkgpath,
	    comment,
	    _descr.value
	FROM
	    ports._ports
	JOIN _paths ON _paths.id=_ports.fullpkgpath
	JOIN _descr ON _descr.fullpkgpath=_ports.fullpkgpath;
> .quit

.. and the same for current.db using sqlports from -current.

Running on OpenBSD

Currently OpenBSD is missing the p5-Mojo-SQLite package, so one will either have to make it themselves (portgen) or wait for it to be added to -current

$ doas pkg_add p5-Mojolicious p5-Text-Markdown sqlports
$ portgen p5 Mojo::SQLite
$ cd /usr/ports/mystuff/cpan/p5-Mojo-SQLite && make install
$ morbo openbsd.app.pl

Running with nix/NixOS

nix shell
morbo openbsd.app.pl

TODOs

  • use OpenBSD::Pledge / use OpenBSD::Unveil.
  • Automate building of the fts DBs.
    • Fetch $release sqlports and $current sqlports and create.
  • OpenSearch support.
  • Parse input to match Full-text Query Syntax: https://www.sqlite.org/fts5.html .
    • Only searching for letters for now.
  • Style.
  • Stable and unstable search.