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
Xavier Thompson
slapos.recipe.cmmi
Commits
24977bca
Commit
24977bca
authored
Nov 09, 2016
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "strip installed binaries."
Use slapos.extension.strip instead. This reverts commit
f26567c4
.
parent
98d93463
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
74 deletions
+0
-74
slapos/recipe/cmmi/__init__.py
slapos/recipe/cmmi/__init__.py
+0
-74
No files found.
slapos/recipe/cmmi/__init__.py
View file @
24977bca
...
...
@@ -7,7 +7,6 @@ import os
import
pkg_resources
from
platform
import
machine
as
platform_machine
import
re
import
stat
import
shutil
import
subprocess
import
sys
...
...
@@ -59,8 +58,6 @@ class Recipe(object):
options
[
'url'
]
=
options
.
get
(
'url'
,
''
).
strip
()
options
[
'path'
]
=
options
.
get
(
'path'
,
''
).
strip
()
options
[
'promises'
]
=
options
.
get
(
'promises'
,
''
)
default_strip
=
bool_option
(
buildout
[
'buildout'
],
'strip'
,
'true'
)
options
[
'strip'
]
=
bool_option
(
options
,
'strip'
,
default_strip
and
'true'
or
'false'
)
# Check dependencies, all the dependent parts will be installed first. It
# seems once part is referenced, for example, self.buildout[part], it will
...
...
@@ -397,75 +394,4 @@ class Recipe(object):
if
self
.
options
[
'share'
]
==
''
:
parts
.
append
(
self
.
options
[
'default-location'
])
if
self
.
options
[
'strip'
]:
self
.
strip
(
parts
)
return
parts
def
strip
(
self
,
path_list
):
# Same logic as Debian's dh_strip script.
log
=
logging
.
getLogger
(
self
.
name
)
args
=
[
'find'
,]
+
list
(
path_list
)
+
[
'-type'
,
'f'
]
try
:
p
=
subprocess
.
Popen
(
args
,
stdout
=
subprocess
.
PIPE
)
file_list
,
_
=
p
.
communicate
()
retcode
=
p
.
returncode
if
retcode
<
0
:
log
.
error
(
'Command received signal %s: %s'
%
(
-
retcode
,
args
))
raise
zc
.
buildout
.
UserError
(
'System error'
)
elif
retcode
>
0
:
log
.
error
(
'Command failed with exit code %s: %s'
%
(
retcode
,
args
))
raise
zc
.
buildout
.
UserError
(
'System error'
)
shared_lib_list
=
[]
executable_list
=
[]
static_lib_list
=
[]
for
path
in
file_list
.
splitlines
():
file_name
=
os
.
path
.
basename
(
path
)
if
re
.
match
(
'.*
\
.(so(
\
..*)?|cmxs)?$'
,
file_name
):
shared_lib_list
.
append
(
path
)
elif
os
.
stat
(
path
).
st_mode
&
stat
.
S_IEXEC
:
try
:
args
=
[
'file'
,
path
]
p
=
subprocess
.
Popen
(
args
,
stdout
=
subprocess
.
PIPE
)
result
,
_
=
p
.
communicate
()
if
re
.
match
(
'.*ELF.*(executable|shared).*'
,
result
):
executable_list
.
append
(
path
)
except
OSError
,
e
:
log
.
warning
(
'Command failed: %s: %s'
%
(
e
,
args
))
elif
re
.
match
(
'lib.*
\
.
a
$'
,
file_name
)
and
not
re
.
match
(
'.*_g
\
.
a
$'
,
file_name
):
static_lib_list
.
append
(
path
)
for
path
in
shared_lib_list
:
strip_args
=
[
'--remove-section=.comment'
,
'--remove-section=.note'
,
'--strip-unneeded'
,
]
self
.
run_strip
(
path
,
strip_args
)
for
path
in
executable_list
:
strip_args
=
[
'--remove-section=.comment'
,
'--remove-section=.note'
,
]
self
.
run_strip
(
path
,
strip_args
)
for
path
in
shared_lib_list
:
strip_args
=
[
'--strip-debug'
,
]
self
.
run_strip
(
path
,
strip_args
)
except
OSError
,
e
:
log
.
warning
(
'Command failed: %s: %s'
%
(
e
,
args
))
def
run_strip
(
self
,
path
,
strip_args
):
log
=
logging
.
getLogger
(
self
.
name
)
mode
=
os
.
stat
(
path
).
st_mode
writable_mode
=
mode
|
stat
.
S_IWUSR
if
mode
!=
writable_mode
:
os
.
chmod
(
path
,
writable_mode
)
try
:
args
=
[
'strip'
,]
+
strip_args
+
[
path
,]
p
=
subprocess
.
Popen
(
args
,
stdout
=
subprocess
.
PIPE
)
result
,
_
=
p
.
communicate
()
except
OSError
,
e
:
log
.
warning
(
'Command failed: %s: %s'
%
(
e
,
args
))
if
mode
!=
writable_mode
:
os
.
chmod
(
path
,
mode
)
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