Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
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
Lisa Casino
slapos.package
Commits
f52dbd09
Commit
f52dbd09
authored
Jul 04, 2013
by
Jondy Zhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refine build-slapos script
parent
a102426b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
37 deletions
+42
-37
windows/scripts/build-slapos.sh
windows/scripts/build-slapos.sh
+42
-37
No files found.
windows/scripts/build-slapos.sh
View file @
f52dbd09
#! /bin/bash
export
PATH
=
/usr/local/bin:/usr/bin:
$PATH
export
PATH
=
/usr/local/bin:/usr/bin:
/usr/sbin:/sbin:/bin:
$PATH
slapos_home
=
/opt/slapos
slapos_home
=
${
1
-/opt/slapos
}
slapos_cache
=
/opt/download-cache
slapos_url
=
http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/cygwin-0:/component/slapos/buildout.cfg
slapos_cfg
=
$slapos_home
/buildout.cfg
slapos_bootstrap
=
$slapos_home
/bootstrap.py
patch_files
=
/etc/slapos/patches/slapos-core-format.patch
if
[[
!
-d
$slapos_home
]]
;
then
echo
"Make directory of slapos home:
$slapos_home
"
mkdir
-p
$slapos_home
fi
if
[[
!
-d
$slapos_cache
]]
;
then
echo
"Make directory of slapos cache:
$slapos_cache
"
mkdir
-p
$slapos_cache
fi
mkdir
-p
$slapos_home
/log
mkdir
-p
$slapos_cache
cd
$slapos_home
if
[[
!
-f
buildout.cfg
]]
;
then
echo
"Create
$slapos_home
/buildout.cfg"
echo
"[buildout]
extends = http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/cygwin-0:/component/slapos/buildout.cfg
download-cache = /opt/download-cache
prefix =
${
buildout
:directory
}
"
>
buildout.cfg
if
[[
-r
$slapos_cfg
]]
;
then
echo
"Change
$slapos_home
/buildout.cfg with "
echo
" extends =
${
slapos_url
}
"
sed
-i
-e
"s%^extends = .*
$%
extends =
${
slapos_url
}
%g"
$slapos_cfg
else
echo
"Edit
$slapos_home
/buildout.cfg"
sed
-i
-e
"s%^extends = .*
$%
extends = http://git.erp5.org/gitweb/slapos.git/blob_plain/refs/heads/cygwin-0:/component/slapos/buildout.cfg%g"
buildout.cfg
cat
<<
EOF
>
$slapos_cfg
[buildout]
extends =
${
slapos_url
}
download-cache =
${
slapos_cache
}
prefix =
$$
{buildout:directory}
EOF
echo
"
$slapos_home
/buildout.cfg created."
fi
if
[[
!
-f
bootstrap.py
]]
;
then
echo
"Download
$slapos_home
/bootstrap.py"
python
-S
-c
'import urllib2;print urllib2.urlopen("http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/bootstrap.py").read()'
>
bootstrap.py
python
-S
bootstrap.py
((
$?
))
&&
echo
"SlapOS bootstrap failed."
&&
exit
1
if
[[
!
-f
$slapos_bootstrap
]]
;
then
python
-S
-c
'import urllib2;print urllib2.urlopen("http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/bootstrap.py").read()'
>
$slapos_bootstrap
echo
"
$slapos_bootstrap
downloaded."
if
(!
cd
$slapos_home
;
python
-S
bootstrap.py
)
;
then
echo
"SlapOS bootstrap failed."
exit
1
fi
fi
bin/buildout
-v
-N
((
$?
))
&&
echo
"Buildout SlapOS failed."
&&
exit
1
# cd $slapos_home
if
(!
cd
$slapos_home
;
$slapos_home
/bin/buildout
-v
-N
)
;
then
echo
"SlapOS buildout failed."
exit
1
fi
# apply patches
patch_file
=
/etc/slapos/patches/slapos-core-format.patch
if
[[
-f
$patch_fil
e
]]
;
then
echo
"Apply patch:
$patch_fil
e
"
for
x
in
$(
find
$slapos_home
/eggs
-name
slapos.core-
*
.egg
;
do
echo
Patching
$x
...
cd
$x
patch
-f
--dry-run
-p1
<
$patch_file
>
/dev/null
&&
patch
-p1
<
$patch_file
&&
echo
Patch
$x
OK.
for
filename
in
$patch_files
;
do
if
[[
-r
$filenam
e
]]
;
then
echo
"Apply patch:
$filenam
e
"
for
x
in
$(
find
$slapos_home
/eggs
-name
slapos.core-
*
.egg
)
;
do
echo
" at
$x
..."
(
cd
$x
;
patch
-f
--dry-run
-p1
<
$filename
>
/dev/null
&&
\
patch
-p1
<
$filename
&&
echo
" OK."
)
done
fi
fi
done
echo
Build SlapOS successfully.
read
-n
1
-p
"Press any key to exit..."
read
-n
1
-
t
60
-
p
"Press any key to exit..."
exit
0
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