Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
slapos.buildout
Commits
c0842786
Commit
c0842786
authored
Mar 18, 2009
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored generation of relative egg paths to generate simpler code.
parent
8ffcf2a1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
47 deletions
+34
-47
CHANGES.txt
CHANGES.txt
+5
-0
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+4
-10
src/zc/buildout/easy_install.txt
src/zc/buildout/easy_install.txt
+10
-19
zc.recipe.egg_/CHANGES.txt
zc.recipe.egg_/CHANGES.txt
+5
-0
zc.recipe.egg_/src/zc/recipe/egg/README.txt
zc.recipe.egg_/src/zc/recipe/egg/README.txt
+10
-18
No files found.
CHANGES.txt
View file @
c0842786
...
@@ -4,6 +4,11 @@ Status
...
@@ -4,6 +4,11 @@ Status
Change History
Change History
**************
**************
1.2.1 (2009-03-18)
==================
- Refactored generation of relative egg paths to generate simpler code.
1.2.0 (2009-03-17)
1.2.0 (2009-03-17)
==================
==================
...
...
src/zc/buildout/easy_install.py
View file @
c0842786
...
@@ -973,6 +973,8 @@ def _relative_path_and_setup(sname, path, relative_paths):
...
@@ -973,6 +973,8 @@ def _relative_path_and_setup(sname, path, relative_paths):
for
path_item
in
path
]
for
path_item
in
path
]
)
)
rpsetup
=
relative_paths_setup
rpsetup
=
relative_paths_setup
for
i
in
range
(
_relative_depth
(
relative_paths
,
sname
)):
rpsetup
+=
"base = os.path.dirname(base)
\
n
"
else
:
else
:
spath
=
repr
(
path
)[
1
:
-
1
].
replace
(
', '
,
',
\
n
'
)
spath
=
repr
(
path
)[
1
:
-
1
].
replace
(
', '
,
',
\
n
'
)
rpsetup
=
''
rpsetup
=
''
...
@@ -1011,9 +1013,7 @@ def _relativitize(path, script, relative_paths):
...
@@ -1011,9 +1013,7 @@ def _relativitize(path, script, relative_paths):
if
(
common
==
relative_paths
or
if
(
common
==
relative_paths
or
common
.
startswith
(
os
.
path
.
join
(
relative_paths
,
''
))
common
.
startswith
(
os
.
path
.
join
(
relative_paths
,
''
))
):
):
return
"join(dirname(%s, __file__), %r)"
%
(
return
"join(base, %r)"
%
_relative_path
(
common
,
path
)
_relative_depth
(
common
,
script
),
_relative_path
(
common
,
path
)
)
else
:
else
:
return
repr
(
path
)
return
repr
(
path
)
...
@@ -1021,13 +1021,8 @@ def _relativitize(path, script, relative_paths):
...
@@ -1021,13 +1021,8 @@ def _relativitize(path, script, relative_paths):
relative_paths_setup
=
"""
relative_paths_setup
=
"""
import os
import os
def dirname(n, path):
while n >= 0:
n -= 1
path = os.path.dirname(path)
return path
join = os.path.join
join = os.path.join
base = os.path.dirname(__file__)
"""
"""
def
_script
(
module_name
,
attrs
,
path
,
dest
,
executable
,
arguments
,
def
_script
(
module_name
,
attrs
,
path
,
dest
,
executable
,
arguments
,
...
@@ -1124,7 +1119,6 @@ def _pyscript(path, dest, executable, rsetup):
...
@@ -1124,7 +1119,6 @@ def _pyscript(path, dest, executable, rsetup):
py_script_template
=
script_header
+
'''
\
py_script_template
=
script_header
+
'''
\
%(relative_paths_setup)s
%(relative_paths_setup)s
import sys
import sys
...
...
src/zc/buildout/easy_install.txt
View file @
c0842786
...
@@ -814,20 +814,16 @@ to pass a common base directory of the scripts and eggs:
...
@@ -814,20 +814,16 @@ to pass a common base directory of the scripts and eggs:
<BLANKLINE>
<BLANKLINE>
import os
import os
<BLANKLINE>
<BLANKLINE>
def dirname(n, path):
while n >= 0:
n -= 1
path = os.path.dirname(path)
return path
<BLANKLINE>
join = os.path.join
join = os.path.join
base = os.path.dirname(__file__)
base = os.path.dirname(base)
<BLANKLINE>
<BLANKLINE>
import sys
import sys
sys.path[0:0] = [
sys.path[0:0] = [
join(
dirname(1, __file__), 'eggs/demo-0.3-py2.4
.egg'),
join(
base, 'eggs/demo-0.3-pyN.N
.egg'),
join(
dirname(1, __file__), 'eggs/demoneeded-1.1-py2.4
.egg'),
join(
base, 'eggs/demoneeded-1.1-pyN.N
.egg'),
'/foo',
'/foo',
join(
dirname(1, __file__)
, 'bar'),
join(
base
, 'bar'),
]
]
<BLANKLINE>
<BLANKLINE>
import eggrecipedemo
import eggrecipedemo
...
@@ -848,24 +844,19 @@ We specified an interpreter and its paths are adjusted too:
...
@@ -848,24 +844,19 @@ We specified an interpreter and its paths are adjusted too:
>>> cat(bo, 'bin', 'py')
>>> cat(bo, 'bin', 'py')
#!/usr/local/bin/python2.4
#!/usr/local/bin/python2.4
<BLANKLINE>
<BLANKLINE>
<BLANKLINE>
import os
import os
<BLANKLINE>
<BLANKLINE>
def dirname(n, path):
while n >= 0:
n -= 1
path = os.path.dirname(path)
return path
<BLANKLINE>
join = os.path.join
join = os.path.join
base = os.path.dirname(__file__)
base = os.path.dirname(base)
<BLANKLINE>
<BLANKLINE>
import sys
import sys
<BLANKLINE>
<BLANKLINE>
sys.path[0:0] = [
sys.path[0:0] = [
join(
dirname(1, __file__), 'eggs/demo-0.3-py2.4
.egg'),
join(
base, 'eggs/demo-0.3-pyN.N
.egg'),
join(
dirname(1, __file__), 'eggs/demoneeded-1.1-py2.4
.egg'),
join(
base, 'eggs/demoneeded-1.1-pyN.N
.egg'),
'/foo',
'/foo',
join(
dirname(1, __file__)
, 'bar'),
join(
base
, 'bar'),
]
]
<BLANKLINE>
<BLANKLINE>
_interactive = True
_interactive = True
...
...
zc.recipe.egg_/CHANGES.txt
View file @
c0842786
Change History
Change History
**************
**************
1.2.1 (2009-03-18)
==================
- Refactored generation of relative egg paths to generate simpler code.
1.2.0 (2009-03-17)
1.2.0 (2009-03-17)
==================
==================
...
...
zc.recipe.egg_/src/zc/recipe/egg/README.txt
View file @
c0842786
...
@@ -424,20 +424,16 @@ Let's look at the script that was generated:
...
@@ -424,20 +424,16 @@ Let's look at the script that was generated:
<BLANKLINE>
<BLANKLINE>
import os
import os
<BLANKLINE>
<BLANKLINE>
def dirname(n, path):
while n >= 0:
n -= 1
path = os.path.dirname(path)
return path
<BLANKLINE>
join = os.path.join
join = os.path.join
base = os.path.dirname(__file__)
base = os.path.dirname(base)
<BLANKLINE>
<BLANKLINE>
import sys
import sys
sys.path[0:0] = [
sys.path[0:0] = [
join(
dirname(1, __file__), 'eggs/demo-0.4c1-py2.4
.egg'),
join(
base, 'eggs/demo-0.4c1-pyN.N
.egg'),
join(
dirname(1, __file__), 'eggs/demoneeded-1.2c1-py2.4
.egg'),
join(
base, 'eggs/demoneeded-1.2c1-pyN.N
.egg'),
'/foo/bar',
'/foo/bar',
join(
dirname(1, __file__)
, 'spam'),
join(
base
, 'spam'),
]
]
<BLANKLINE>
<BLANKLINE>
import eggrecipedemo
import eggrecipedemo
...
@@ -475,20 +471,16 @@ each individual script section:
...
@@ -475,20 +471,16 @@ each individual script section:
<BLANKLINE>
<BLANKLINE>
import os
import os
<BLANKLINE>
<BLANKLINE>
def dirname(n, path):
while n >= 0:
n -= 1
path = os.path.dirname(path)
return path
<BLANKLINE>
join = os.path.join
join = os.path.join
base = os.path.dirname(__file__)
base = os.path.dirname(base)
<BLANKLINE>
<BLANKLINE>
import sys
import sys
sys.path[0:0] = [
sys.path[0:0] = [
join(
dirname(1, __file__), 'eggs/demo-0.4c1-py2.4
.egg'),
join(
base, 'eggs/demo-0.4c1-pyN.N
.egg'),
join(
dirname(1, __file__), 'eggs/demoneeded-1.2c1-py2.4
.egg'),
join(
base, 'eggs/demoneeded-1.2c1-pyN.N
.egg'),
'/foo/bar',
'/foo/bar',
join(
dirname(1, __file__)
, 'spam'),
join(
base
, 'spam'),
]
]
<BLANKLINE>
<BLANKLINE>
import eggrecipedemo
import eggrecipedemo
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment