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
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.recipe.cmmi
Commits
9bf0241a
Commit
9bf0241a
authored
Sep 21, 2021
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup imports
parent
9bb2c613
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
slapos/recipe/cmmi/__init__.py
slapos/recipe/cmmi/__init__.py
+13
-13
No files found.
slapos/recipe/cmmi/__init__.py
View file @
9bf0241a
import
errno
from
hashlib
import
md5
import
slapos.recipe.downloadunpacked
import
imp
import
logging
import
os
import
pkg_resources
from
platform
import
machine
as
platform_machine
import
re
import
shutil
import
stat
import
subprocess
import
sys
from
hashlib
import
md5
from
platform
import
machine
as
platform_machine
import
pkg_resources
import
zc.buildout
from
zc.buildout
import
UserError
from
zc.buildout.buildout
import
bool_option
from
slapos.recipe
import
downloadunpacked
startup_environ
=
os
.
environ
.
copy
()
...
...
@@ -62,7 +63,7 @@ class Recipe(object):
shared
=
((
options
.
get
(
'shared'
,
''
).
lower
()
==
'true'
)
and
buildout
[
'buildout'
].
get
(
'shared-part-list'
,
None
))
if
shared
:
self
.
_signature
=
slapos
.
recipe
.
downloadunpacked
.
Signature
(
self
.
_signature
=
downloadunpacked
.
Signature
(
'.slapos.recipe.cmmi.signature'
)
buildout_directory
=
buildout
[
'buildout'
][
'directory'
]
profile_base_location
=
options
.
get
(
'_profile_base_location_'
,
''
)
...
...
@@ -105,9 +106,9 @@ class Recipe(object):
options
[
'strip-top-level-dir'
]
=
options
.
get
(
'strip-top-level-dir'
,
'false'
).
strip
()
if
options
[
'url'
]
and
options
[
'path'
]:
raise
zc
.
buildout
.
UserError
(
'You must use either "url" or "path", not both!'
)
raise
UserError
(
'You must use either "url" or "path", not both!'
)
if
not
(
options
[
'url'
]
or
options
[
'path'
]):
raise
zc
.
buildout
.
UserError
(
'You must provide either "url" or "path".'
)
raise
UserError
(
'You must provide either "url" or "path".'
)
if
options
[
'url'
]:
options
[
'compile-directory'
]
=
location
+
'__compile__'
...
...
@@ -125,7 +126,7 @@ class Recipe(object):
key
,
value
=
variable
.
split
(
'='
,
1
)
self
.
environ
[
key
.
strip
()]
=
value
except
ValueError
:
raise
zc
.
buildout
.
UserError
(
'Invalid environment variable definition: %s'
%
variable
)
raise
UserError
(
'Invalid environment variable definition: %s'
%
variable
)
# Add prefix to PATH, CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS
if
self
.
buildout_prefix
!=
''
:
self
.
environ
[
'PATH'
]
=
'%s/bin:%s'
%
(
self
.
buildout_prefix
,
self
.
environ
.
get
(
'PATH'
,
'/usr/bin'
))
...
...
@@ -210,7 +211,7 @@ class Recipe(object):
universal_newlines
=
True
,
close_fds
=
True
)
except
Exception
as
e
:
self
.
logger
.
error
(
e
)
raise
zc
.
buildout
.
UserError
(
'System error'
)
raise
UserError
(
'System error'
)
return
files
.
splitlines
()
def
check_promises
(
self
):
...
...
@@ -250,7 +251,7 @@ class Recipe(object):
env
=
self
.
augmented_environment
(),
close_fds
=
True
)
except
Exception
as
e
:
self
.
logger
.
error
(
e
)
raise
zc
.
buildout
.
UserError
(
'System error'
)
raise
UserError
(
'System error'
)
def
install
(
self
):
log
=
self
.
logger
...
...
@@ -310,8 +311,7 @@ class Recipe(object):
opt
[
'destination'
]
=
compile_dir
# no need to shared build for compile dir
opt
[
'shared'
]
=
'false'
slapos
.
recipe
.
downloadunpacked
.
Recipe
(
self
.
buildout
,
self
.
name
,
opt
).
install
()
downloadunpacked
.
Recipe
(
self
.
buildout
,
self
.
name
,
opt
).
install
()
except
:
shutil
.
rmtree
(
compile_dir
)
raise
...
...
@@ -441,7 +441,7 @@ echo %s
self
.
fix_shebang
(
location
)
if
self
.
options
[
'shared'
]:
slapos
.
recipe
.
downloadunpacked
.
make_read_only_recursively
(
location
)
downloadunpacked
.
make_read_only_recursively
(
location
)
return
parts
def
fix_shebang
(
self
,
location
):
...
...
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