Skip to content

Remove awk dependency from POSIX installer - #362

Merged
ccmywish merged 1 commit into
RubyMetric:devfrom
boilcy:fix/remove-awk-installer-dependency
Jun 16, 2026
Merged

ccmywish merged 1 commit into
RubyMetric:devfrom
boilcy:fix/remove-awk-installer-dependency

Conversation

@boilcy

@boilcy boilcy commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

问题

在缺少 awk 的环境中,POSIX 安装脚本会在识别平台时失败,导致 platform 为空。

即使当前机器本身有可用的预编译二进制文件,安装脚本也会误判为“不支持的平台”,并提示用户使用 chsrc-bootstrap 或自行编译。

$ curl https://chsrc.run/posix | sudo bash
bash: line 149: awk: command not found
[ERROR] 抱歉,暂无预编译二进制文件供你所在的平台:  使用。请使用 chsrc-bootstrap 或 自行编译

修改

将平台和系统名称的小写转换从 awk 改为 tr:

uname -s | tr '[:upper:]' '[:lower:]'
uname -o | tr '[:upper:]' '[:lower:]'

tr 已经在同一脚本的 get_arch() 中使用,因此这个修改不会引入新的依赖。

@github-actions

github-actions Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

Hi @boilcy,

❤️ 感谢你的贡献!你的 PR 当前基于 main 分支,请修改使用 dev 分支

@boilcy
boilcy marked this pull request as draft June 15, 2026 16:11
@boilcy
boilcy marked this pull request as ready for review June 15, 2026 16:11
@boilcy
boilcy marked this pull request as draft June 15, 2026 16:11
@boilcy
boilcy changed the base branch from main to dev June 15, 2026 16:12
@boilcy
boilcy marked this pull request as ready for review June 15, 2026 16:12
@ccmywish
ccmywish merged commit 644edb0 into RubyMetric:dev Jun 16, 2026
4 of 6 checks passed
@ccmywish

Copy link
Copy Markdown
Contributor

@boilcy

Thank you!

合并快了,你可以再重新开个PR给这个文件 https://github.com/RubyMetric/chsrc/blob/main/tool/installer.sh#L10-L14 上写你的贡献者信息(Contributors :)以及修改最后更新时间(Last Modified :)

@ccmywish

Copy link
Copy Markdown
Contributor

我已在新的提交你添加你的贡献信息

social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
chsrc 0.2.6

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>该附件二进制文件为预编译供用户提前使用

版本:`v0.2.5`
日期:2026-07-25
更新:RubyMetric/chsrc@v0.2.5...v0.2.6
内容:

1. 支持 Windows Arm64 的预编译文件
2. 支持检测更特殊的 Windows 环境
3. Windows 上柔性检测 Python 微软商店占位符
4. 移除 POSIX installer 中的 `awk` 依赖
5. 强制实施 `user_define` 能力

换源方法(recipe):
1. 增加 APT 换源前的 `http(s)` 检测

源:
1. 修复 `Alpine` 的测速链接
2. `Kali` 源: 新增华为源、移除阿里源

<br>

## 新贡献者
* @boilcy made their first contribution in RubyMetric/chsrc#362
* @wcbing made their first contribution in RubyMetric/chsrc#364
* @NewbieXvwu made their first contribution in RubyMetric/chsrc#366
</pre>
  <p>View the full release notes at <a href="https://github.com/RubyMetric/chsrc/releases/tag/v0.2.6">https://github.com/RubyMetric/chsrc/releases/tag/v0.2.6</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!15101
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