Skip to content

refactor(workshop): edit Barotrauma config_player.xml with sed instead of Python - #5017

Merged
dgibbs64 merged 1 commit into
developfrom
feature/workshop-barotrauma-sed
Oct 11, 2026
Merged

dgibbs64 merged 1 commit into
developfrom
feature/workshop-barotrauma-sed

Conversation

@dgibbs64

@dgibbs64 dgibbs64 commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Description

Replaces the inline Python in fn_workshop_bt_packages (from #5014) with sed, keeping the module pure bash. Behaviour is unchanged.

GNU sed -z reads the file as one record, so the patterns match Barotrauma's <package> elements, which span two lines. The steps are:

  1. Expand <regularpackages />.
  2. Remove LinuxGSM's entries for removed and current Workshop mods.
  3. Add the installed mods, in workshopmods order, before </regularpackages>.
  4. Collapse an empty element back to <regularpackages />.

Entries you added yourself are untouched. Unlike the Python version, the file's UTF-8 BOM is now kept.

Testing

  • Live test server (btserver):
    • Installing 3815618949 added its <package path="LocalMods/3815618949/filelist.xml" /> entry.
    • Removal deleted it and put back <regularpackages />, so the file matches the original.
    • The server stayed healthy throughout and was restored afterwards.
  • Locally, the same scenarios as feat(workshop): add Steam Workshop downloads for Barotrauma and Stationeers #5014 give identical output:
    • The self-closing element is expanded, and the result stays valid XML.
    • Order follows workshopmods.
    • A hand-added entry and its comment are kept.
    • Removed mods' entries are dropped.
    • The game's two-line entries for other mods are untouched.
    • The BOM is kept.
  • shellcheck and prettier pass.

Type of change

  • Bug fix (a change which fixes an issue).
  • New feature (a change which adds functionality).
  • New Server (new server added).
  • Refactor (restructures existing code).
  • Comment update (typo, spelling, explanation, examples, etc).

Checklist

  • This pull request links to an issue.
  • This pull request uses the develop branch as its base.
  • This pull request subject follows the Conventional Commits standard.
  • This code follows the style guidelines of this project.
  • I have performed a self-review of my code.
  • I have checked that this code is commented where required.
  • I have provided a detailed enough description of this PR.
  • I have checked if documentation needs updating.

Relates to #3514.

Copilot AI balanced review requested due to automatic review settings October 11, 2026 12:33
@dgibbs64 dgibbs64 added this to the v26.4.0 milestone Oct 11, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added type: refactor engine: barotrauma Issues related to barotrauma engine game: Barotrauma Issues related to Barotrauma labels Oct 11, 2026
@dgibbs64
dgibbs64 merged commit f3026d3 into develop Oct 11, 2026
15 checks passed
@dgibbs64
dgibbs64 deleted the feature/workshop-barotrauma-sed branch October 11, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine: barotrauma Issues related to barotrauma engine game: Barotrauma Issues related to Barotrauma type: refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants