file(1) does not allow leading whitespace on shebang lines, and there
appears to be no restrictions on what characters follow '#!', either.
While at it, fix an erroneous shebang test.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
- Reimplement archs_for_command on top of the new Mach-O methods
- Move ArchitectureListExtension to mach.rb
- Add a test for the ArchitectureListExtension
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
The MachO module contains methods for learning about Mach-O binaries,
and can be used where one might normally shell out to file(1).
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
The standard `nostdout` method doesn't work here because Formula#system
does some redirection of its own; both stdout and stderr have to be of
the same type, so just do it manually here.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Tests that expect Formula#path to resolve to a real path should use
TestBallWithRealPath; TestBall gets its original behavior back, fixing a
failing test in test_formula_install.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Tapped formulae that dupe those in core now display the correct URL when
invoked like `brew info homebrew/dupes/openssl`.
This also fixes the broken `brew info` test.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
The test for this previously passed, but only because the constructor
for SoftwareSpecification was raising an exception. method_added needs
to be a class method because methods are being defined on the class, not
the object, and to test it properly we have to eval the class in the
test itself.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
the ghc formula had an explicit version because we had trouble parsing
the version from the 64-bit URL. It is working now, so add a test to
ensure it isn't broken in the future.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
- Formulae can now declare failures on any compiler.
- FailsWithLLVM and associated formula elements have been moved to
compat.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Some times the module to import is different than the module to install
when dealing with external dependencies. This change allows an optional
import name to be specififed when it is different from the module name.
ClosesHomebrew/homebrew#11078.