Problems fixed:
- Broken and leaking test if run as part of `brew tests --coverage` due
to the `cmd` call being nested in the `Pathname#cd` block.
- Output during `git clone` operation because of a missing `shutup do`.
- Still incomplete coverage for `cmd/log.rb` because `brew log` is
invoked on the formula in the origin instead of the shallow clone.
- Minor stylistic fixes:
- Superfluous parentheses around `core_tap.path.dirname`.
- Overly long lines.
Simply drop because the `require`s are not actually used by the tests
and no file from `compat/` should be loaded unconditionally. (This can
otherwise lead to incorrect results for `brew tests --no-compat`.)
Since #292, HOMEBREW_CACHE was moved to a per-user directory. This makes
it unsuitable to store global lock files on multiple users environment.
Therefore, introducing a global lock directory `/Library/Lock.d` to
store lock files from formula lockers as well as `brew update`.
Amends e4d0187120e61bc80d31ebecc3b38f0740b20bb5. The `require` was
accidentally omitted causing the tests to fail very sporadically (or
always, when invoked as `brew tests --only=integration_cmds`).
The check that `t4` is not an external command would always succeed, but
not because the file wasn't executable, but because it wasn't even found
due to the missing `brew-` prefix.
Also change the valid but atypical file mode from 0744 to 0755 and apply
minor code style fixes.
* add Language::Node helper module
This adds a language module for Node module based formulas.
It contains the 2 public methods `std_npm_install_args(libexec)` and
`local_npm_install_args`:
* `std_npm_install_args` is intended to be used in formulas for
standard node modules and returns `npm install` args for a global
style module installation to libexec.
* `local_npm_install_args` is for formulas, in which the `npm install`
step is only one of multiple parts of the installation process and
returns `npm install` args for a default local installation in place.
Both methods have in common, that they are
* making sure that a working copy of npm and node-gyp from node's
libexec is prepended to the PATH (to not rely of a user managed npm)
* seting the npm cache to HOMEBREW_CACHE/npm, which fixes issues caused
by overriding $HOME resulting in long install times + high disk usage
(see https://github.com/Homebrew/brew/pull/37#issuecomment-208840366)
* audit: update npm install check for Language::Node
* cleanup: remove npm_cache too
* doc: add Node-for-Formula-Authors.md
Also enables sandbox for --interactive and --debug use of install
and test, using automatic retention.
Closes#66.
Signed-off-by: Andrew Janke <andrew@apjanke.net>
Makes `tap` re-runnable and unshallows when requested with `--full`.
Tapping with a different URL raises an exception.
The homebrew/core tap cannot be untapped with `untap` so running
`brew tap --full homebrew/core` is now a built-in way to get a full
clone of this tap without resorting to workarounds.
Closes#17.
Signed-off-by: ilovezfs <ilovezfs@icloud.com>
* Count .DS_Store disk usage but not file count.
* Count symlink's own disk usage instead of ignoring it.
* Count hardlinks disk usage only once.
* Add testcase.
ClosesHomebrew/homebrew#50563.
ClosesHomebrew/homebrew#50566.
Signed-off-by: Xu Cheng <xucheng@me.com>
This can become handy when we separate core code and formulae. For
example, we could use `cd $(brew --repo homebrew/core)` to go to core
tap path.
ClosesHomebrew/homebrew#50346.
Signed-off-by: Xu Cheng <xucheng@me.com>
`Library/ENV` like `Library/Homebrew` is part of Homebrew basecode. It
should be able to be accessed during the `brew tests`.
By adding HOMEBREW_ENV_PATH variable, we allow test suit to locate these
codes.
Running brew audit --strict --online on a formula with a GitHub
homepage/url would crash if HOMEBREW_NO_GITHUB_API is set because
GitHub.repository returns `nil` and the audit code assumes it always
returns a hash.
ClosesHomebrew/homebrew#50054.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
These methods will be used in `brew --version`, `brew config`
and `brew doctor` after core/formula separation.
ClosesHomebrew/homebrew#49796.
Signed-off-by: Xu Cheng <xucheng@me.com>