Skip to content

TrimUI: guard samefile() against missing target on first port install#329

Open
Pobega wants to merge 1 commit into
PortsMaster:mainfrom
Pobega:trimui-samefile-fix
Open

TrimUI: guard samefile() against missing target on first port install#329
Pobega wants to merge 1 commit into
PortsMaster:mainfrom
Pobega:trimui-samefile-fix

Conversation

@Pobega

@Pobega Pobega commented Jun 15, 2026

Copy link
Copy Markdown

os.path.samefile() stats both paths passed to it; on first-time port installs the target may not yet exist, resulting in a FileNotFoundError which aborts the installation.

Short-circuit this check by checking that the target exists before executing the os.path.samefile() comparison. If the target doesn't exist then we flow directly into the code below (as if the samefile check failed.)

os.path.samefile() stats both paths passed to it; on first-time port
installs the 'target' may not yet exist, resulting in a
FileNotFoundError which aborts the installation.

Short-circuit this check by checking that the target exists before
executing the os.path.samefile() comparison. If the target doesn't exist
then we flow directly into the code below (as if the samefile check
failed.)
@bmdhacks

Copy link
Copy Markdown
Contributor

We abandonded support of Tina-linux based CFW due to a huge pile of other issues, and the fact that knulli and muOS became available on a133p systems.

I don't see a problem with merging this, but you're fighting a losing battle here unless you intend to continue working to fix the huge array of missing libraries and system utilities we depend on.

@Pobega

Pobega commented Jun 17, 2026

Copy link
Copy Markdown
Author

I'm already fighting a losing battle; ben16w/minui-portmaster#137

The question is whether it's accepted upstream or I maintain it as a patch.

I figured in this case it's an actual flaw with the logic, so may as well upstream it.

I also never specified that this was a Tina Linux issue, it seemed to me like a flaw in the logic here -- it makes sense to guard this for anyone using it that may run into this same crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants