Also allow to build with --HEAD by making brew's
download strategy aware of a brewed but unlined hg.
Adapted the caveats so that the procedure to brew
hg --HEAD is clear.
Mention how to config hgk in the caveats.
New `depends_on :python` Dependency.
New `depends_on :python3` Dependency.
To avoid having multiple formulae with endings -py2 and -py3,
we will handle support for different pythons (2.x vs. 3.x)
in the same formula.
Further brewed vs. external python will be transparently supported.
The formula also gets a new object `python`, which is false if
no Python is available or the user has disabled it. Otherwise
it is defined and provides several support methods:
python.site_packages # the site-packages in the formula's Cellar
python.global_site_packages
python.binary # the full path to the python binary
python.prefix
python.version
python.version.major
python.version.minor
python.xy # => e.g. "python2.7"
python.incdir # includes of python
python.libdir # the python dylib library
python.pkg_config_path # used internally by brew
python.from_osx?
python.framework?
python.universal?
python.pypy?
python.standard_caveats # Text to set PYTHONPATH for python.from_osx?
python.if3then3 # => "" for 2.x and to "3" for 3.x.
Further, to avoid code duplication, `python` takes an optional
block that is run twice if the formula defines depends_on
:python AND :python3.
python do
system python, 'setup.py', "--prefix=#{prefix}"
end
Read more in the Homebrew wiki.
If an incomplete download exists, and the HTTP server doesn't support
byte ranges, delete the incomplete download and retry once.
Tested with freeling, whose server does not support byte ranges.
ClosesHomebrew/homebrew#19757.
After converting to Pathname to create paths, using '+=' will result in
path concatenation by '/', which result in weird path like
'gcc--svn/-HEAD'. This patch should fix this.
ClosesHomebrew/homebrew#19233.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
We should handle this case in some predictable way, but until we do,
let's raise a more appropriate exception. It would also be good to get
rid of the duplication here.
When we are building from a tag, and that tag is already present in the
cached repository, we don't to hit the network; everything we need
already exists.
This can cause subtle issues when an exception is marshaled between the
build process and the main Homebrew process, as the marshaled exception
may contain URI objects even when the main Homebrew process has not
loaded the URI library.
ClosesHomebrew/homebrew#17642.
* `CurlDownloadStrategy#_fetch` (and the same methods in its
subclasses) now fetches the file to a temporary path, and
`CurlDownloadStrategy#fetch` moves it to the correct location.
* `Homebrew#cleanup` cleans the temporary files `CurlDownloadStrategy`
creates if they're left in the cache.
ClosesHomebrew/homebrew#13953.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
While at it, make it use class methods instead; no reason to instantiate
an object for this.
Eventually there should be some functional tests for the individual
strategies as well.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
By default, git checks out the fetched ref after cloning the repo, but
this is unnecessary as we explicitly check out the desired ref during
staging. This also silences some unnecessarily confusing output.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
"git status -s" is used to detect if the repository was corrupted during
an interrupted clone, but it can leak output to the terminal, so use
quiet_system.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Two wrapper scripts that find git and svn using the ENV variables we support and then searching through the PATH and looking inside Xcode.app if necessary.
Now just calling git or svn in Homebrew code will find and exec the right tool and we can stop fussing.
Apologies to @adamv who is probably unimpressed that the cmds directory has non-commands in it now. If it's consolation these are temporary pending some more work on superenv whereby some more directories are created under the superenv root.