Commit e079b796 authored by Reinout van Rees's avatar Reinout van Rees

Merge pull request #278 from buildout/reinout-relative-test

Same as #277, but with test and changelog entry
parents 039ac65d 833924d7
......@@ -4,7 +4,9 @@ Change History
2.4.6 (unreleased)
==================
- Nothing changed yet.
- Relative paths are now also correctly generated for the current directory
("develop = .").
[youngking]
2.4.5 (2015-10-14)
......
......@@ -1152,6 +1152,8 @@ def _relative_path(common, path):
def _relativitize(path, script, relative_paths):
if path == script:
raise AssertionError("path == script")
if path == relative_paths:
return "base"
common = os.path.dirname(os.path.commonprefix([path, script]))
if (common == relative_paths or
common.startswith(os.path.join(relative_paths, ''))
......
......@@ -835,7 +835,7 @@ to pass a common base directory of the scripts and eggs:
>>> scripts = zc.buildout.easy_install.scripts(
... ['demo'], ws, sys.executable, join(bo, 'bin'), dict(demo='run'),
... extra_paths=[ba, join(bo, 'bar')],
... extra_paths=[ba, join(bo, 'bar'), bo],
... interpreter='py',
... relative_paths=bo)
......@@ -854,6 +854,7 @@ to pass a common base directory of the scripts and eggs:
join(base, 'eggs/demoneeded-1.1-pyN.N.egg'),
'/ba',
join(base, 'bar'),
base,
]
<BLANKLINE>
import eggrecipedemo
......@@ -887,6 +888,7 @@ We specified an interpreter and its paths are adjusted too:
join(base, 'eggs/demoneeded-1.1-pyN.N.egg'),
'/ba',
join(base, 'bar'),
base,
]
<BLANKLINE>
_interactive = True
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment