Not every Linux system has a pre-installed `uuidgen` command (Debian
has a package `uuid-runtime` but doesn't install it by default). In
contrast, `/proc/sys/kernel/random/uuid` is always available on a modern
Linux system and produces type/version 4 UUIDs, just like `uuidgen`.
Closes#416.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
If `bin/brew` happens to be symlinked to `/brew`, `/bin/brew`, or some
similar location or (worse yet) Homebrew is installed to `/`, then
computation of the prefix and/or repository path could break down and
result in an invalid or empty path.
ClosesHomebrew/homebrew-core#2430.
Move dylib_path and bundle_path from test_mach to testing_env to
accommodate the new tests.
Closes#400.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
This is inspired by `safe_system` with basically the same implication
(fail on error), making the name a lot less confusing and avoiding a
clash with the `chdir` function previously defined in `bin/brew`.
Closes#414.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
This is inspired by `quiet_system` with basically the same implication
(suppress output), making the name a lot less confusing and avoiding a
clash with the `chdir` function defined in `Library/brew.sh`.
The `ensure` block can be reached before the tab is modified (and thus
before `original_tab` gets populated). Avoid raising an exception when
attempting to restore a tab that hasn't been modified yet, e.g. because
relocating some of the Mach-O binaries failed.
* audit.rb: require https for ftpmirror.gnu.org
The situation is similar to other mirror redirectors: the server
may subsequently redirect to an insecure url. But it's a step.
* manpage: update HOMEBREW_NO_INSECURE_REDIRECT section
Don't force installation of the `hub` formula if it can be found in the
search path. (Avoids unnecessary installation when switching between
multiple Homebrew installations for different tasks.)
Closes#384.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
Allow boneyarding a formula locally, i.e. make all the necessary changes
in the local repositories but don't push them to a remote and don't open
a pull request automatically.
Move check for emptiness into the display method, avoiding repetitive
checks on the call site.
Closes#381.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
Prevent raising an error when `HOMEBREW_RUBY_MACHO=1` is set. Skipping
symlinks and directories while iterating over a directory structure to
find Mach-O binaries makes sense and similar logic is applied elsewhere.