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
Ayush Tiwari
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
Hide 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
...
@@ -31,6 +31,7 @@ import setuptools
import
shlex
import
shlex
import
shutil
import
shutil
import
subprocess
import
subprocess
import
sys
import
tempfile
import
tempfile
import
zc.buildout
import
zc.buildout
...
@@ -41,6 +42,12 @@ ARCH_MAP = {
...
@@ -41,6 +42,12 @@ ARCH_MAP = {
'x86_64'
:
'x86-64'
'x86_64'
:
'x86-64'
}
}
OS_MAP
=
{
'darwin'
:
'mac'
,
'linux2'
:
'linux'
#To be continued
}
def
readElfAsDict
(
f
):
def
readElfAsDict
(
f
):
"""Reads ELF information from file"""
"""Reads ELF information from file"""
...
@@ -102,13 +109,17 @@ def guessworkdir(path):
...
@@ -102,13 +109,17 @@ def guessworkdir(path):
return
os
.
path
.
join
(
path
,
os
.
listdir
(
path
)[
0
])
return
os
.
path
.
join
(
path
,
os
.
listdir
(
path
)[
0
])
return
path
return
path
def
guessPlatform
():
def
guessPlatform
():
arch
=
uname
()[
-
2
]
arch
=
uname
()[
-
2
]
target
=
ARCH_MAP
.
get
(
arch
)
target
=
ARCH_MAP
.
get
(
arch
)
assert
target
,
'Unknown architecture'
assert
target
,
'Unknown architecture'
return
target
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'
)
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