88 Commits
Author SHA1 Message Date
Xuehai Pan 1007141e8f cask/caskroom: harden Linux Caskroom group lookup
- Memoize `expected_caskroom_group` to avoid repeated `Etc.getgrgid` calls.
- Rescue `ArgumentError` to cover misconfigured NSS setups, matching the
  pattern in `Utils::UID.uid_home`.
- Stub `Etc.getgrgid` in the Linux spec for determinism and reset the
  memoization between examples.
2026-05-09 22:17:45 +08:00
Xuehai Pan 35b6d8712d cask/caskroom: use the user's primary group on Linux
- Use the current user's primary group as the `Caskroom` group on Linux,
  matching the group `mkdir` already assigns on a single-user prefix.
- Drop the `chgrp_path` override that forced `sudo: true` regardless of
  whether the parent prefix was user-writable, so the inherited base method
  honors its computed `sudo` flag.
- Cover the `chgrp_path` branch matrix and add a Linux integration spec
  asserting `ensure_caskroom_exists` performs no `sudo` invocation when the
  prefix is user-writable.
2026-05-09 21:51:16 +08:00
Xuehai Pan b2d621ce6f os/linux/ld: do not crash the program if the ld.so.conf entry is not readable 2025-08-11 19:40:41 +08:00
Xuehai Pan e12a56fbac docs: update manpage 2023-10-07 00:18:21 +08:00
Xuehai Pan 6f0d87aace docs: prefer placing shellenv command in rcfile rather than shell profile on Linux 2023-10-07 00:14:26 +08:00
Xuehai Pan 176637acd8 formulary: respect HOMEBREW_BOTTLE_DOMAIN when installing from API 2023-02-07 13:03:25 +00:00
Xuehai Pan 4322e57dd0 utils/curl: make --show-error optional 2023-02-04 13:05:41 +00:00
Xuehai Pan 17b08f2f01 Update manpage 2023-02-04 13:05:20 +00:00
Xuehai Pan ba3bccf9ed api: download from HOMEBREW_API_DOMAIN 2023-02-04 13:05:20 +00:00
Xuehai Pan 46736c5e81 cask/audit: fix audit error when homepage is missing 2022-09-17 16:42:53 +08:00
Xuehai Pan d3093cd260 resource: automatic determine mirrors for PyPI resources 2022-09-16 01:57:19 +08:00
Xuehai Pan 46b3d24dd3 resource: automatic determine mirrors for glibc-bootstrap 2022-09-16 01:50:44 +08:00
Xuehai Pan 8f9f18fe59 utils/shfmt.sh: allow long shfmt arguments 2022-06-18 17:27:56 +08:00
Xuehai Pan 2466353415 style: use short flags for patch command for compatibility 2022-01-03 22:13:32 +08:00
Xuehai PanandMike McQuaid 62a63063bb Apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
Signed-off-by: XuehaiPan <XuehaiPan@pku.edu.cn>
2021-11-24 01:06:27 +08:00
XuehaiPan d1aac8857a tests/utils/git_spec: update tests for ensure_formula_installed! 2021-11-24 00:30:26 +08:00
XuehaiPan 9ef52080e3 utils: extract common word "for" in reason 2021-11-23 23:59:09 +08:00
XuehaiPan 466f29a16a cmd/update-report: redirect stdout to stderr when it is not a TTY 2021-11-23 23:55:06 +08:00
XuehaiPan c0826f1890 utils: add method ensure_executable! 2021-11-23 23:32:32 +08:00
XuehaiPan d749173adc utils: mark reason as keyword argument in ensure_formula_installed! 2021-11-23 23:31:22 +08:00
XuehaiPan 7baaebe544 utils: send output to stderr by default for ensure_formula_installed! 2021-11-23 23:09:42 +08:00
XuehaiPan 3376479e95 utils: add method ensure_formula_installed! 2021-11-23 22:48:39 +08:00
XuehaiPan c6719e5854 dev-cmd/cat: require "formula" only when necessary 2021-11-23 21:35:44 +08:00
XuehaiPan 687dbe5268 dev-cmd/cat: auto-install bat when running brew cat ... with HOMEBREW_BAT set 2021-11-23 15:20:57 +08:00
XuehaiPan 50cde98fd3 utils/shfmt.sh: allow single line if blocks 2021-11-12 19:57:32 +08:00
XuehaiPan 391e7e22f8 utils/shfmt.sh: add != and =~ to within test regex 2021-11-12 19:57:28 +08:00
XuehaiPan 2345a34095 utils/shfmt.sh: rename regex variables 2021-11-12 19:29:09 +08:00
XuehaiPan d78c11361a .shellcheckrc: disable unneeded check SC2310-SC2312 globally 2021-11-08 23:50:54 +08:00
c1d2f8a2c6 style: catch failures while applying patches
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-11-08 22:50:20 +08:00
XuehaiPan b86fdfeb09 style: use long options for patch command 2021-11-08 22:34:49 +08:00
XuehaiPan 800bd93c5a .vscode: add extension editorconfig 2021-11-08 20:57:52 +08:00
XuehaiPan fcbf626e4c .vscode: enable shellcheck auto-fix on save 2021-11-08 20:57:52 +08:00
XuehaiPan 0331cbeda3 utils/shfmt.sh: use utils/shfmt.sh as shell script formmatter 2021-11-08 20:57:52 +08:00
XuehaiPan 67c619d4f2 style: use popen_write to apply patches 2021-11-08 20:10:30 +08:00
Xuehai PanandGitHub a56ab26e88 Merge branch 'master' into shellcheck-autofix 2021-11-08 12:02:54 +08:00
XuehaiPanandBo Anderson cf7def0c68 style: apply shellcheck autofix 2021-11-08 03:07:25 +00:00
XuehaiPan 00ebd8581f style: apply shellcheck autofix 2021-11-07 21:21:42 +08:00
XuehaiPan fa85d00b95 style: implement shellcheck autofix in brew style --fix 2021-11-07 21:12:03 +08:00
XuehaiPan 33f9cab3c6 tap: handle brew tap homebrew/core without a URL while HOMEBREW_CORE_GIT_REMOTE set 2021-10-13 19:52:44 +08:00
XuehaiPan cfc1821e2c tap: fix unexpected wrong variable name 2021-10-12 21:58:40 +08:00
XuehaiPan 2be19d8f06 tap: remove "rubocop:disable" comment 2021-10-12 20:43:36 +08:00
Xuehai PanandMike McQuaid 889b30b32e tap: apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-10-12 20:43:20 +08:00
Xuehai PanandMike McQuaid 3dcfc7e26e tap: apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-10-12 20:43:20 +08:00
XuehaiPan 828d3505cd cli/args.rbi: add custom_remote? 2021-10-12 20:43:20 +08:00
XuehaiPan 79ec661cca man: update manpage and completions 2021-10-12 20:43:18 +08:00
XuehaiPan 63f2f6cca7 tap: allow to change tap remote with brew tap --custom-remote 2021-10-12 01:11:34 +08:00
2d89e7d24e utils/shfmt.sh: apply suggestions from code review
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-10-07 22:16:57 +08:00
XuehaiPan 3113bf7158 utils/shfmt.sh: redirect differences to stderr 2021-10-07 19:48:53 +08:00
XuehaiPan 735eb78601 utils/shfmt.sh: success with auto-fixable changes on brew style --fix 2021-10-07 19:43:03 +08:00
XuehaiPan 8398be5cde docs/Installation: update commands for untar-anywhere method 2021-09-29 19:59:49 +08:00
XuehaiPan 440fb7ee90 brew.sh: remove annoying prompts when homebrew/core not tapped 2021-09-28 19:33:31 +08:00
XuehaiPan 8edc69e205 utils/shfmt.sh: enable coloring only when brewed diffutils is installed 2021-09-28 00:21:21 +08:00
XuehaiPan 966189d07d style: add shfmt exit status to brew style 2021-09-17 00:05:37 +08:00
XuehaiPan 065c5b79fe utils/shfmt.sh: refactor function align_multiline_if_condition 2021-09-16 23:32:53 +08:00
XuehaiPan d559d3ff46 utils/shfmt.sh: reuse similar code fragments 2021-09-16 23:16:07 +08:00
XuehaiPan 1be5e97e82 brew: fail fast when not using bash 2021-09-16 21:20:57 +08:00
XuehaiPan 03017a84b4 style: move inplace flag to the front of argument list 2021-09-16 21:20:56 +08:00
d5a15cf289 brew.sh: remove deprecated command
Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2021-09-16 20:40:20 +08:00
XuehaiPan 2688e7e56b style: apply suggestions from code review 2021-09-16 19:54:07 +08:00
XuehaiPan 43377a3e5e style: fix inconsistent code style for shell scripts by runing brew style --fix 2021-09-16 01:08:02 +08:00
XuehaiPan bd8db0737d style: fix inconsistent code style for shell scripts 2021-09-16 01:06:19 +08:00
XuehaiPan c2d5d84b21 Merge remote-tracking branch 'upstream/master' into fix-inconsistent-shell-style 2021-09-16 01:01:49 +08:00
XuehaiPan 09a16bcea1 utils/shfmt.sh: implement checkers for forbidden styles 2021-09-16 00:53:53 +08:00
XuehaiPan 03c7a142be style: add keyward argument inplace to run_shfmt 2021-09-16 00:08:29 +08:00
XuehaiPan 1bb68bda3f utils/shfmt.sh: add function wrap_then_do 2021-09-16 00:07:57 +08:00
XuehaiPan a839d7e5ff utils/shfmt.sh: add function prototypes 2021-09-15 22:12:03 +08:00
XuehaiPan 9efde249c1 style: add shfmt implementation 2021-09-15 22:12:01 +08:00
XuehaiPan 954c3596b2 brew: fail fast when not using bash 2021-09-15 17:10:05 +08:00
XuehaiPan baac35785c style: do not allow multi-line for statements 2021-09-15 15:00:23 +08:00
XuehaiPan 2855ae18df style: brew style always use latest brewed shellcheck 2021-09-15 15:00:23 +08:00
XuehaiPan bc0663baba style: brew style check Dockerfile as shell script 2021-09-15 15:00:23 +08:00
XuehaiPan 8a363b2fb5 style: trim trailing whitespaces 2021-09-15 15:00:23 +08:00
XuehaiPan 570fac7f47 .vscode: add extension shellcheck and shell-format 2021-09-15 15:00:20 +08:00
XuehaiPan 3f96d963f7 style: fix inconsistent code style for shell scripts 2021-09-15 14:59:01 +08:00
XuehaiPan fc056cec59 docs: update documentation for shell requirement 2021-09-15 02:18:31 +08:00
XuehaiPan d77d510ce9 brew.sh: alias which as type -P 2021-09-15 02:18:27 +08:00
XuehaiPan b5bc6368b7 cmd/vendor-install.sh: update artifact URL 2021-09-12 23:38:33 +08:00
XuehaiPan 7da8a9ebc1 cmd/vendor-install.sh: allow download vendors from HOMEBREW_ARTIFACT_DOMAIN and HOMEBREW_BOTTLE_DOMAIN 2021-09-12 21:54:37 +08:00
XuehaiPan 5c6d2b154f utils/ruby.sh: remove dependency for which command 2021-09-11 15:02:04 +08:00
XuehaiPan 05c1c5895e Apply suggestions from code review 2021-08-30 22:37:07 +08:00
27fb6506a0 Apply suggestions from code review
Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com>
2021-08-27 18:22:01 +08:00
XuehaiPan 728efbdf2f Show warnings on brew shellenv if users modified env vars explicitly 2021-08-27 15:55:31 +08:00
XuehaiPan 1e737dbe2c cmd/shellenv.sh: apply suggestions from code review 2021-08-03 18:40:59 +08:00
XuehaiPan 6cd2192c6f cmd/shellenv.sh: make sure the current Homebrew is initialized correctly 2021-08-03 16:19:45 +08:00
XuehaiPan 7cc37fb7f8 cmd/shellenv.sh: support multi-instance installation 2021-08-02 16:57:59 +08:00
XuehaiPan 9e11fcf31e cmd/shellenv.sh: make brew shellenv idempotent 2021-07-30 21:00:38 +08:00
XuehaiPan 3f64bcb2fb docs/Installation: add section for Git remote mirroring 2021-03-05 22:04:48 +08:00
XuehaiPanandMike McQuaid d2533ff2a6 software_spec: Add HOMEBREW_BOTTLE_DEFAULT_DOMAIN as a fallback option
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-02-26 11:23:33 +00:00