Page MenuHomeFreeBSD

Create describe-csv and db targets
Needs ReviewPublic

Authored by fernape on Nov 8 2023, 10:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jul 20, 11:52 AM
Unknown Object (File)
Fri, Jul 19, 10:25 PM
Unknown Object (File)
Thu, Jul 4, 9:06 PM
Unknown Object (File)
Thu, Jul 4, 8:21 AM
Unknown Object (File)
Thu, Jul 4, 3:22 AM
Unknown Object (File)
Sun, Jun 30, 5:03 PM
Unknown Object (File)
Sun, Jun 30, 3:05 PM
Unknown Object (File)
Thu, Jun 27, 3:01 AM
Subscribers
None

Details

Reviewers
None
Group Reviewers
portmgr
Summary

Continuation of the review that introduced describe-json
This commit introduces two new targets: describe-csv and db.
The former hast he bulk of the work, the later is a convenience.

describe-csv:

It works from the root of the ports directory and from any category.
It creates a csv-compliant output.

For convenience, we might want the first line to be the names of the fields.
This is useful if we want to to load the data into an SQLite database.
We can achieve this with the WITH_CSV_HEADER option:

make -DWITH_CSV_HEADER describe-csv | sqlite3 mydb.db ".mode csv" ".import /dev/stdin ports"

db:

This target acts as a shortcut for the previous command. It can only be invoked
from the ports tree root directory. It will create an SQLite database from the
csv output and write the result to the file indicated by the PORTSDB variable
or to the database ports.db by default, e.g.:

PORTSDB=mydb.db make db

It uses the new Tools/make-ports-db.sh script.

It takes 23 minutes in a fresh booted system with the ports tree in the following disk model:

ada0 at ahcich0 bus 0 scbus0 target 0 lun 0
ada0: <TOSHIBA HDWD120 MX4OACF0> ATA8-ACS SATA 3.x device
ada0: Serial Number X8V1JUJCS
ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes)
ada0: Command Queueing enabled
ada0: 1907729MB (3907029168 512 byte sectors)

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 54332
Build 51222: arc lint + arc unit

Event Timeline

fernape created this revision.
fernape retitled this revision from Create describe-csv and make db targets to Create describe-csv and db targets.Nov 8 2023, 11:05 AM
fernape edited the summary of this revision. (Show Details)
fernape added a reviewer: portmgr.

Any Christmas elves available for a review? :-)

This would make a nice gift for this season of the year!