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
667ec876
Commit
667ec876
authored
Aug 25, 2011
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use different syntax to specify architectures
parent
94b519d8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
11 deletions
+31
-11
README.txt
README.txt
+16
-6
slapos/recipe/build.py
slapos/recipe/build.py
+15
-5
No files found.
README.txt
View file @
667ec876
...
...
@@ -74,14 +74,24 @@ Example buildout::
slapos_promisee =
...
[architecturedependant]
recipe = slapos.cookbook:download
x86_url = http://host/path/zipball_x86.zip
x86_md5sum = 9631070eac74f92a812d4785a84d1b4e
x86-64_url = http://host/path/zipball_x64.zip
x86-64_md5sum = 9631070eac74f92a812d4785a84d1b4e
[download]
# Downloads, extracts and copy files to part directory
recipe = slapos.recipe.build:download
slapos_promisee =
directory:bin
...
url =
md5sum =
[choosearchitecture]
recipe = slapos.recipe.build:download
slapos_promisee =
directory:bin
...
# List here supported architectures with URL of archive and md5sum
architecture_list =
x86 http://javadl.sun.com/webapps/download/AutoDL?BundleId=483 377456da9fa4d867d4bdf4c655a16dce
x86-64 http://javadl.sun.com/webapps/download/AutoDL?BundleId=48338 bae0cb5d10181abdd9650dcb590eda67
TODO:
...
...
slapos/recipe/build.py
View file @
667ec876
...
...
@@ -282,12 +282,22 @@ call(["make", "install"], cwd=workdir, env=env)
class
Download
(
Script
):
"""Download and install binary package depending on your architecture.
"""
def
setUrl
(
self
):
if
not
self
.
options
.
get
(
'url'
):
try
:
architecture_list
=
self
.
options
.
get
(
'architecture_list'
).
split
(
'
\
n
'
)
except
AttributeError
:
architecture_list
=
[]
architecture_dict
=
dict
()
for
architecture_information
in
architecture_list
:
if
architecture_information
is
not
''
:
architecture
,
url
,
md5sum
=
architecture_information
.
split
(
' '
)
architecture_dict
[
architecture
]
=
(
url
,
md5sum
)
self
.
options
[
'url'
],
self
.
options
[
'md5sum'
]
=
architecture_dict
[
guessPlatform
()]
script
=
"""
if not self.options.get('url'):
architecture = guessPlatform()
self.options['url'] = self.options["%%s_url" %% architecture]
self.options['md5sum'] = self.options["%%s_md5sum" %% architecture]
# Specific url/md5sum can be given. Else, list of architecture-specific urls are given
self.setUrl()
extract_dir = self.extract(self.download(self.options['url'], self.options.get('md5sum')))
print(extract_dir)
workdir = guessworkdir(extract_dir)
...
...
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