Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.recipe.cmmi
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
Xiaowu Zhang
slapos.recipe.cmmi
Commits
41b4defa
Commit
41b4defa
authored
Aug 26, 2010
by
Kai Lautaportti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed the is_build_dir() heuristic and clarified the --prefix injection.
parent
c4ce889c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
35 deletions
+41
-35
CHANGES.txt
CHANGES.txt
+22
-0
hexagonit/recipe/cmmi/README.txt
hexagonit/recipe/cmmi/README.txt
+6
-1
hexagonit/recipe/cmmi/__init__.py
hexagonit/recipe/cmmi/__init__.py
+13
-16
hexagonit/recipe/cmmi/tests.py
hexagonit/recipe/cmmi/tests.py
+0
-18
No files found.
CHANGES.txt
View file @
41b4defa
Change History
Change History
**************
**************
1.4.0 (xxxx-xx-xx)
==================
- The ``--prefix`` parameter will be automatically given to the configure
command if and only if a) the ``configure-command`` is not used to specify
a custom configure command and b) ``--prefix`` is not given explicitly in
the ``configure-options`` option. [dokai]
- Removed the ``is_build_dir()`` heuristic.
Previously the recipe inspected the contents of the downloaded package to
determine if it contained the necessary files for building the package (it
checked if files named ``configure`` or ``Makefile.PL`` existed) and gave
an error message if they were missing. However, the recipe is useful for
building many different kinds of software packages and checking for
particular files limited its use severely.
Now the recipe omits any checks for particular files in the downloaded
package. It is recommended that you use the ``md5sum`` option in your part
configuration to assert that you are downloading the package you expect
to. [dokai]
1.3.1 (2010-08-23)
1.3.1 (2010-08-23)
==================
==================
...
...
hexagonit/recipe/cmmi/README.txt
View file @
41b4defa
...
@@ -16,7 +16,12 @@ Supported options
...
@@ -16,7 +16,12 @@ Supported options
``prefix``
``prefix``
Custom installation prefix passed to the ``--prefix`` option of the
Custom installation prefix passed to the ``--prefix`` option of the
``configure`` script. Defaults to the location of the part.
``configure`` script. Defaults to the location of the part. Note that this
is a convenience shortcut which assumes that the default ``configure``
command is used to configure the package. If the ``configure-command``
option is used to define a custom configure command no automatic
``--prefix`` injection takes place. You can also set the ``--prefix``
parameter explicitly in ``configure-options``.
``md5sum``
``md5sum``
MD5 checksum for the package file. If available the MD5
MD5 checksum for the package file. If available the MD5
...
...
hexagonit/recipe/cmmi/__init__.py
View file @
41b4defa
...
@@ -14,8 +14,6 @@ class Recipe(object):
...
@@ -14,8 +14,6 @@ class Recipe(object):
self
.
buildout
=
buildout
self
.
buildout
=
buildout
self
.
name
=
name
self
.
name
=
name
log
=
logging
.
getLogger
(
self
.
name
)
options
[
'location'
]
=
os
.
path
.
join
(
options
[
'location'
]
=
os
.
path
.
join
(
buildout
[
'buildout'
][
'parts-directory'
],
buildout
[
'buildout'
][
'parts-directory'
],
self
.
name
)
self
.
name
)
...
@@ -90,12 +88,15 @@ class Recipe(object):
...
@@ -90,12 +88,15 @@ class Recipe(object):
make_cmd
=
self
.
options
.
get
(
'make-binary'
,
'make'
).
strip
()
make_cmd
=
self
.
options
.
get
(
'make-binary'
,
'make'
).
strip
()
make_targets
=
' '
.
join
(
self
.
options
.
get
(
'make-targets'
,
'install'
).
split
())
make_targets
=
' '
.
join
(
self
.
options
.
get
(
'make-targets'
,
'install'
).
split
())
configure_cmd
=
self
.
options
.
get
(
'configure-command'
,
'./configure'
)
configure_options
=
self
.
options
.
get
(
'configure-options'
,
''
).
split
()
configure_options
=
self
.
options
.
get
(
'configure-options'
,
''
).
split
()
configure_cmd
=
self
.
options
.
get
(
'configure-command'
,
''
).
strip
()
# Add the prefix only if we're using a configure script
if
not
configure_cmd
:
if
'configure'
in
configure_cmd
:
# Default to using basic configure script.
configure_options
.
insert
(
0
,
'--prefix=%s'
%
self
.
options
[
'prefix'
])
configure_cmd
=
'./configure'
# Inject the --prefix parameter if not already present
if
'--prefix'
not
in
' '
.
join
(
configure_options
):
configure_options
.
insert
(
0
,
'--prefix=%s'
%
self
.
options
[
'prefix'
])
patch_cmd
=
self
.
options
.
get
(
'patch-binary'
,
'patch'
).
strip
()
patch_cmd
=
self
.
options
.
get
(
'patch-binary'
,
'patch'
).
strip
()
patch_options
=
' '
.
join
(
self
.
options
.
get
(
'patch-options'
,
'-p0'
).
split
())
patch_options
=
' '
.
join
(
self
.
options
.
get
(
'patch-options'
,
'-p0'
).
split
())
...
@@ -139,16 +140,12 @@ class Recipe(object):
...
@@ -139,16 +140,12 @@ class Recipe(object):
try
:
try
:
try
:
try
:
if
not
self
.
is_build_dir
():
# We support packages that either extract contents to the $PWD
contents
=
os
.
listdir
(
compile_dir
)
# or alternatively have a single directory.
if
len
(
contents
)
==
1
:
contents
=
os
.
listdir
(
compile_dir
)
os
.
chdir
(
contents
[
0
])
if
len
(
contents
)
==
1
and
os
.
path
.
isdir
(
contents
[
0
]):
if
not
self
.
is_build_dir
():
# Single container
log
.
error
(
'Unable to find the configure script'
)
os
.
chdir
(
contents
[
0
])
raise
zc
.
buildout
.
UserError
(
'Invalid package contents'
)
else
:
log
.
error
(
'Unable to find the configure script'
)
raise
zc
.
buildout
.
UserError
(
'Invalid package contents'
)
if
patches
:
if
patches
:
log
.
info
(
'Applying patches'
)
log
.
info
(
'Applying patches'
)
...
...
hexagonit/recipe/cmmi/tests.py
View file @
41b4defa
...
@@ -55,24 +55,6 @@ class NonInformativeTests(unittest.TestCase):
...
@@ -55,24 +55,6 @@ class NonInformativeTests(unittest.TestCase):
bo
.
update
(
buildout
)
bo
.
update
(
buildout
)
return
Recipe
(
bo
,
name
,
options
)
return
Recipe
(
bo
,
name
,
options
)
def
test_is_build_dir__with_configure
(
self
):
recipe
=
self
.
make_recipe
({},
'test'
,
{
'url'
:
'http://no.where.com/'
})
os
.
chdir
(
self
.
dir
)
self
.
failIf
(
recipe
.
is_build_dir
())
configure
=
self
.
write_file
(
'configure'
,
'Dummy configure script'
)
self
.
failUnless
(
os
.
path
.
exists
(
configure
))
self
.
failUnless
(
recipe
.
is_build_dir
())
def
test_is_build_dir__with_makefile_pl
(
self
):
recipe
=
self
.
make_recipe
({},
'test'
,
{
'url'
:
'http://no.where.com/'
})
os
.
chdir
(
self
.
dir
)
self
.
failIf
(
recipe
.
is_build_dir
())
makefile
=
self
.
write_file
(
'Makefile.PL'
,
'Dummy Makefile.PL script'
)
self
.
failUnless
(
os
.
path
.
exists
(
makefile
))
self
.
failUnless
(
recipe
.
is_build_dir
())
def
test_working_directory_restored_after_failure
(
self
):
def
test_working_directory_restored_after_failure
(
self
):
compile_directory
=
os
.
path
.
join
(
self
.
dir
,
'compile_directory'
)
compile_directory
=
os
.
path
.
join
(
self
.
dir
,
'compile_directory'
)
os
.
makedirs
(
compile_directory
)
os
.
makedirs
(
compile_directory
)
...
...
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