Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • HardenedBSD HardenedBSD
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 29
    • Issues 29
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • HardenedBSD
  • HardenedBSDHardenedBSD
  • Issues
  • #17

Closed
Open
Created Nov 15, 2020 by Shawn Webb@shawn.webbOwner

hbsd-update: Add option for getting machine-readable output

Created by: Follpvosten

While writing shell scripts and other tools using hbsd-update, I noticed that it is sometimes either hard to impossible to actually parse its output, or it works, but looks weird and as if my scripts around it could break with any update.

It would be nice to have a command which produces more machine-readable output; for example, a --json flag (as json is often used in tooling around FreeBSD - well, it was mostly around TrueOS. But it's also a stable and reliable format, tho not too well-suited to be written by humans), but any format would be okay, really, it just has to be well-supported and the API should be stable.

For example, on running hbsd-update -C --json, the output to stdout might look something like:

{
    "local_version": "hbsd-v1200060-a5c1250e0e66e2606b30fe4bc94265fee1038b34",
    "remote_version": "hbsd-v1200060-a5c1250e0e66e2606b30fe4bc94265fee1038b34"
}

Additionally, and I don't know if this would be a good idea, but maybe there could also be a flag like --fail-if-no-updates for -C, which would make hbsd-update return an error status code if there are no updates available (maybe a specific code like the HTTP status code 304 - Not Modified, but that's just an idea). This could be a problem if it errors for a different reason, but either way you likely don't want to update if this command fails.

Assignee
Assign to
Time tracking