Parse @(owner,group,mode) plist fields positionally again - #198
Merged
Merged
Conversation
parse_file_owner_mode() skipped empty tokens, so "@(,,755) bin/npm"
stored "755" as the owner and left the mode unset. mport then never
applied the requested mode, and files kept whatever mode they had in the
fake root. npm-node24 shipped npm-cli.js as 0444, and every port with an
npm build dependency failed with "env: npm: Permission denied". That
includes claude-code-legacy, gemini-cli, clawhub and grok-cli.
Skip the leading '(' and split on ",)" so an empty field keeps its slot.
Add tests covering @(,,mode), @(owner,group,mode), @dir(,group,) and
@sample(,,mode).
AI-Assisted-By: Claude Opus 5.5
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Lucas Holt <luke@foolishgames.com>
Contributor
Reviewer's GuideThe parser now treats owner, group, and mode as positional fields, so empty values no longer shift later values into the wrong slot; focused tests cover file, directory, and sample plist forms. Flow diagram for positional plist owner, group, and mode parsingflowchart LR
Input["@(owner,group,mode) plist entry"] --> Strip["Skip leading ("]
Strip --> Split["Split on , and )"]
Split --> Assign["Assign tokens to owner, group, mode by position"]
Assign --> Install["mport install uses empty owner or group as default"]
Assign --> Apply["mport applies requested mode"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Claude encountered an error after 2s —— View job I'll analyze this and get back to you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since 0c5f815 (2026-06-06),
parse_file_owner_mode()has skipped empty tokens. As a result,@(,,755) bin/npmstores755as the owner and leaves the mode unset. mport then never applies the requested mode, and the file keeps whatever mode it had in the fake root.36 mports plists use this form. The visible breakage is
www/npm-node24:npm-cli.jsinstalls as 0444 (fromCOPYTREE_SHARE), so every port with an npm dependency fails withenv: npm: Permission deniedordepends on executable: npm - not found. On magus run 648 this hits claude-code-legacy, gemini-cli, clawhub and grok-cli.Fix
Skip the leading
(and split on,)so an empty field keeps its position.@(,,755)again means owner="", group="", mode="755". An empty owner or group already means "use the default" at install time.Tests
plist_owner_mode_mode_onlyandplist_owner_mode_all_fieldscases inmport_util_test, covering@(,,mode),@(owner,group,mode),@dir(,group,)and@sample(,,mode)."" != e->owner ( != 755)).kyua test mport_util_test mport_install_test: 38/38 passed.Follow-up
contrib/mportand rebuild mport on the build boxes.www/npm-node22/npm-node24packages (or bump PORTREVISION) so the installed files get the correct modes.🤖 Generated with Claude Code
Summary by Sourcery
Preserve empty plist owner and group fields so positional file ownership and mode specifications are parsed and applied correctly.
Bug Fixes:
Tests: