Skip to content

tlog_lib v2.0.2

Choose a tag to compare

@rfxn rfxn released this 04 Mar 04:41
· 15 commits to master since this release

tlog_lib v2.0.2

New Features

  • CLI version cross-check — warns when tlog and tlog_lib.sh versions diverge after sourcing
  • Baserun advisory warnings — library warns when baserun directory is world-writable; CLI warns when running as root with default /tmp cursor storage; non-fatal, directs to -b/--baserun
  • Journal flock support — tlog_journal_read() supports optional cursor locking via TLOG_FLOCK=1; returns exit 4 on contention
  • 67 new BATS tests (129 → 196 total)

Bug Fixes

  • Rotation pipe fallback — when mktemp fails or decompression write fails, fall back to pipe-based decompression instead of silently dropping rotated content
  • Baserun directory validation — validated before processing in tlog_read(), tlog_journal_read(), and tlog_advance_cursors()
  • Arithmetic input validation — SCAN_MAX_LINES, SCAN_TIMEOUT, and max_lines arguments validated; non-numeric values default to 0 with stderr warning
  • --status subcommand — correctly display corrupt cursor state with raw content for diagnosis; add exit code note to help text
  • --reset subcommand — clean up orphaned journal timestamp temp files alongside cursor temp files
  • README — document return codes for journal read functions

Changes

  • Extract rotation into _tlog_handle_rotation() helper; decompress once to temp file
  • Internal code cleanup: consolidate duplicated helpers, remove CLI/library function collision, add stderr warnings on cursor write failures
  • CLI --first-run flag validates value (must be skip or full)
  • CI and test infrastructure: lint gating, bash -n in CI, dynamic version assertions, test dedup

Full Changelog

See CHANGELOG