openbsd.app/README.md

65 lines
1.4 KiB
Markdown
Raw Normal View History

2022-09-23 18:17:45 -06:00
# OpenBSD.app
2022-09-25 11:35:34 -06:00
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
```
2024-04-15 08:47:11 -06:00
$ doas pkg_add p5-Mojolicious p5-Text-Markdown p5-Mojo-SQLite sqlports
2022-09-25 11:35:34 -06:00
$ morbo openbsd.app.pl
```
### Running with nix/NixOS
```
nix shell
morbo openbsd.app.pl
```
2022-09-23 18:17:45 -06:00
## TODOs
2022-09-24 20:01:26 -06:00
- [X] `use OpenBSD::Pledge` / `use OpenBSD::Unveil`.
2022-11-30 12:00:21 -07:00
- [X] Automate building of the fts DBs.
2022-09-24 20:12:03 -06:00
- Fetch $release sqlports and $current sqlports and create.
2022-09-25 10:11:00 -06:00
- [X] OpenSearch support.
2022-11-30 12:00:21 -07:00
- [X] ~~Parse input to match `Full-text Query Syntax`: https://www.sqlite.org/fts5.html .~~
- Only searching for letters for now.
- [X] Style.
- [X] Stable and unstable search.