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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Boxiang Sun
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
**************
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)
==================
...
...
hexagonit/recipe/cmmi/README.txt
View file @
41b4defa
...
...
@@ -16,7 +16,12 @@ Supported options
``prefix``
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``
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):
self
.
buildout
=
buildout
self
.
name
=
name
log
=
logging
.
getLogger
(
self
.
name
)
options
[
'location'
]
=
os
.
path
.
join
(
buildout
[
'buildout'
][
'parts-directory'
],
self
.
name
)
...
...
@@ -90,12 +88,15 @@ class Recipe(object):
make_cmd
=
self
.
options
.
get
(
'make-binary'
,
'make'
).
strip
()
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_cmd
=
self
.
options
.
get
(
'configure-command'
,
''
).
strip
()
# Add the prefix only if we're using a configure script
if
'configure'
in
configure_cmd
:
configure_options
.
insert
(
0
,
'--prefix=%s'
%
self
.
options
[
'prefix'
])
if
not
configure_cmd
:
# Default to using basic configure script.
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_options
=
' '
.
join
(
self
.
options
.
get
(
'patch-options'
,
'-p0'
).
split
())
...
...
@@ -139,16 +140,12 @@ class Recipe(object):
try
:
try
:
if
not
self
.
is_build_dir
():
contents
=
os
.
listdir
(
compile_dir
)
if
len
(
contents
)
==
1
:
os
.
chdir
(
contents
[
0
])
if
not
self
.
is_build_dir
():
log
.
error
(
'Unable to find the configure script'
)
raise
zc
.
buildout
.
UserError
(
'Invalid package contents'
)
else
:
log
.
error
(
'Unable to find the configure script'
)
raise
zc
.
buildout
.
UserError
(
'Invalid package contents'
)
# We support packages that either extract contents to the $PWD
# or alternatively have a single directory.
contents
=
os
.
listdir
(
compile_dir
)
if
len
(
contents
)
==
1
and
os
.
path
.
isdir
(
contents
[
0
]):
# Single container
os
.
chdir
(
contents
[
0
])
if
patches
:
log
.
info
(
'Applying patches'
)
...
...
hexagonit/recipe/cmmi/tests.py
View file @
41b4defa
...
...
@@ -55,24 +55,6 @@ class NonInformativeTests(unittest.TestCase):
bo
.
update
(
buildout
)
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
):
compile_directory
=
os
.
path
.
join
(
self
.
dir
,
'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