Skip to content

Conversation

@SorYoshino
Copy link
Contributor

Summary

Restructures busybox to use dynamic shim generation and refines the environment configuration for a smaller manifest and better maintainability.

Related issues or pull requests

Changes

  • Simplify the description for clarity and consistency.
  • Refactor the ~/.profile creation logic into pre_install with better error handling and cleaner PowerShell syntax.
  • Replace the massive static bin array (which occupied nearly 900 lines) with a dynamic post_install script that shims tools based on busybox.exe --list.
  • Implement a dynamic uninstaller to ensure all generated shims are purged during removal.
  • Update checkver regex to target w64 assets for accuracy.

Notes

  • Synchronization & Cleanliness: This approach solves the "ghost shim" problem. If a future version of uutils adds or removes a utility, the dynamic script will only create shims for what actually exists in the binary.
  • Architecture Aware: Different architectures (x64 vs. ARM64) might support different subsets of tools. By querying the binary at install time, we ensure the shims are accurate for the specific environment.
  • Maintainability: Reduces the manifest size by ~90%, making it significantly easier to audit and maintain.
  • Due to issues in certain logic within Scoop Core, errors may occur when updating or removing [.shim file.

Testing

The test results are as follows:
┏[ D:\Software\Scoop\Local\apps\scoop\current\bin][ develop ≡]
└─> .\checkver.ps1 -App busybox -Dir 'D:\Temporary\Software\Microsoft\Windows Sandbox\Repositories\Scoop\Buckets\Main\bucket' -f
busybox: 5857-g3681e397f (scoop version is 5857-g3681e397f)
Forcing autoupdate!
Autoupdating busybox
DEBUG[1770227843] $substitutions (hashtable) -> D:\Software\Scoop\Local\apps\scoop\current\lib\autoupdate.ps1:230:5
DEBUG[1770227843] $substitutions.$dotVersion                    5857.g3681e397f
DEBUG[1770227843] $substitutions.$minorVersion
DEBUG[1770227843] $substitutions.$underscoreVersion             5857_g3681e397f
DEBUG[1770227843] $substitutions.$version                       5857-g3681e397f
DEBUG[1770227843] $substitutions.$basenameNoExt                 busybox-w64a-FRP-5857-g3681e397f
DEBUG[1770227843] $substitutions.$majorVersion                  5857
DEBUG[1770227843] $substitutions.$dashVersion                   5857-g3681e397f
DEBUG[1770227843] $substitutions.$patchVersion
DEBUG[1770227843] $substitutions.$buildVersion
DEBUG[1770227843] $substitutions.$cleanVersion                  5857g3681e397f
DEBUG[1770227843] $substitutions.$url                           https://frippery.org/files/busybox/busybox-w64a-FRP-5857-g3681e397f.exe
DEBUG[1770227843] $substitutions.$urlNoExt                      https://frippery.org/files/busybox/busybox-w64a-FRP-5857-g3681e397f
DEBUG[1770227843] $substitutions.$baseurl                       https://frippery.org/files/busybox
DEBUG[1770227843] $substitutions.$match1                        5857-g3681e397f
DEBUG[1770227843] $substitutions.$preReleaseVersion             g3681e397f
DEBUG[1770227843] $substitutions.$basename                      busybox-w64a-FRP-5857-g3681e397f.exe
DEBUG[1770227843] $hashfile_url = https://frippery.org/files/busybox/SHA256SUM -> D:\Software\Scoop\Local\apps\scoop\current\lib\autoupdate.ps1:233:5
Searching hash for busybox-w64a-FRP-5857-g3681e397f.exe in https://frippery.org/files/busybox/SHA256SUM
DEBUG[1770227844] $filenameRegex = ([a-fA-F0-9]{32,128})[\x20\t]+.*busybox-w64a-FRP-5857-g3681e397f\.exe(?:\s|$)|busybox-w64a-FRP-5857-g3681e397f\.exe[\x20\t]+.*?([a-fA-F0-9]{32,128}) -> D:\Software\Scoop\Local\apps\scoop\current\lib\autoupdate.ps1:101:13
Found: 4e39dc577782fd0af75222738e609ba43d8d2a98131e88928f1b0dad45048b99 using Extract Mode
Writing updated busybox manifest

┏[ D:\Software\Scoop\Local\apps\scoop\current\bin][ develop ≡]
└─> scoop install 'D:\Temporary\Software\Microsoft\Windows Sandbox\Repositories\Scoop\Buckets\Main\bucket\busybox.json' -g
Installing 'busybox' (5857-g3681e397f) [64bit] from 'D:\Temporary\Software\Microsoft\Windows Sandbox\Repositories\Scoop\Buckets\Main\bucket\busybox.json'
Loading busybox-w64-FRP-5857-g3681e397f.exe from cache.
Checking hash of busybox-w64-FRP-5857-g3681e397f.exe... OK.
Running pre_install script... Done.
Linking D:\Software\Scoop\Global\apps\busybox\current => D:\Software\Scoop\Global\apps\busybox\5857-g3681e397f
Running post_install script...
Creating shim for 'busybox'.
Creating shim for '['.
Creating shim for '[['.
Creating shim for 'ar'.
Creating shim for 'arch'.
... ...
Creating shim for 'which'.
Creating shim for 'whoami'.
Creating shim for 'whois'.
WARN  Overwriting shim ('whois.exe' -> 'busybox.exe') installed from sysinternals-suite
Creating shim for 'xargs'.
Creating shim for 'xxd'.
WARN  Overwriting shim ('xxd.exe' -> 'busybox.exe') installed from vim
Creating shim for 'xz'.
Creating shim for 'xzcat'.
Creating shim for 'yes'.
Creating shim for 'zcat'.
Done.
'busybox' (5857-g3681e397f) was installed successfully!

┏[ D:\Software\Scoop\Local\apps\scoop\current\bin][ develop ≡]
└─> which --help
BusyBox v1.38.0-FRP-5857-g3681e397f (2025-10-10 08:26:06 UTC)

Usage: which [-a] COMMAND...

Locate COMMAND

        -a      Show all matches

┏[ D:\Software\Scoop\Local\apps\scoop\current\bin][ develop ≡]
└─>  which [ [[
D:/Software/Scoop/Global/shims/[.exe
D:/Software/Scoop/Global/shims/[[.exe
  • Use conventional PR title: <manifest-name[@version]|chore>: <general summary of the pull request>
  • I have read the Contributing Guide

@SorYoshino SorYoshino marked this pull request as ready for review February 4, 2026 18:05
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

All changes look good.

Wait for review from human collaborators.

busybox

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate
  • Autoupdate Hash Extraction

Check the full log for details.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Busybox: add more bins

1 participant