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.build
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
Thomas Leymonerie
slapos.recipe.build
Commits
4a132aa4
Commit
4a132aa4
authored
Nov 11, 2011
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add basic functionnality to guess operating system
parent
02057b2e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
slapos/recipe/build.py
slapos/recipe/build.py
+12
-1
No files found.
slapos/recipe/build.py
View file @
4a132aa4
...
...
@@ -31,6 +31,7 @@ import setuptools
import
shlex
import
shutil
import
subprocess
import
sys
import
tempfile
import
zc.buildout
...
...
@@ -41,6 +42,12 @@ ARCH_MAP = {
'x86_64'
:
'x86-64'
}
OS_MAP
=
{
'darwin'
:
'mac'
,
'linux2'
:
'linux'
#To be continued
}
def
readElfAsDict
(
f
):
"""Reads ELF information from file"""
...
...
@@ -102,13 +109,17 @@ def guessworkdir(path):
return
os
.
path
.
join
(
path
,
os
.
listdir
(
path
)[
0
])
return
path
def
guessPlatform
():
arch
=
uname
()[
-
2
]
target
=
ARCH_MAP
.
get
(
arch
)
assert
target
,
'Unknown architecture'
return
target
def
guessOperatingSystem
():
platform
=
sys
.
platform
target
=
OS_MAP
.
get
(
platform
)
assert
target
,
'Unknown architecture'
return
target
TRUE_LIST
=
(
'y'
,
'on'
,
'yes'
,
'true'
,
'1'
)
...
...
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