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
Ophélie Gagnard
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
Hide 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
#! /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_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
mkdir
-p
$slapos_home
/log
echo
"Make directory of slapos home:
$slapos_home
"
mkdir
-p
$slapos_cache
mkdir
-p
$slapos_home
fi
if
[[
!
-d
$slapos_cache
]]
;
then
echo
"Make directory of slapos cache:
$slapos_cache
"
mkdir
-p
$slapos_cache
fi
cd
$slapos_home
if
[[
-r
$slapos_cfg
]]
;
then
if
[[
!
-f
buildout.cfg
]]
;
then
echo
"Change
$slapos_home
/buildout.cfg with "
echo
"Create
$slapos_home
/buildout.cfg"
echo
" extends =
${
slapos_url
}
"
echo
"[buildout]
sed
-i
-e
"s%^extends = .*
$%
extends =
${
slapos_url
}
%g"
$slapos_cfg
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
else
else
echo
"Edit
$slapos_home
/buildout.cfg"
cat
<<
EOF
>
$slapos_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
[buildout]
extends =
${
slapos_url
}
download-cache =
${
slapos_cache
}
prefix =
$$
{buildout:directory}
EOF
echo
"
$slapos_home
/buildout.cfg created."
fi
fi
if
[[
!
-f
bootstrap.py
]]
;
then
if
[[
!
-f
$slapos_bootstrap
]]
;
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()'
>
$slapos_bootstrap
python
-S
-c
'import urllib2;print urllib2.urlopen("http://git.erp5.org/gitweb/slapos.core.git/blob_plain/HEAD:/bootstrap.py").read()'
>
bootstrap.py
echo
"
$slapos_bootstrap
downloaded."
python
-S
bootstrap.py
if
(!
cd
$slapos_home
;
python
-S
bootstrap.py
)
;
then
((
$?
))
&&
echo
"SlapOS bootstrap failed."
&&
exit
1
echo
"SlapOS bootstrap failed."
exit
1
fi
fi
fi
bin/buildout
-v
-N
# cd $slapos_home
((
$?
))
&&
echo
"Buildout SlapOS failed."
&&
exit
1
if
(!
cd
$slapos_home
;
$slapos_home
/bin/buildout
-v
-N
)
;
then
echo
"SlapOS buildout failed."
exit
1
fi
# apply patches
# apply patches
patch_file
=
/etc/slapos/patches/slapos-core-format.patch
for
filename
in
$patch_files
;
do
if
[[
-f
$patch_file
]]
;
then
if
[[
-r
$filename
]]
;
then
echo
"Apply patch:
$patch_file
"
echo
"Apply patch:
$filename
"
for
x
in
$(
find
$slapos_home
/eggs
-name
slapos.core-
*
.egg
;
do
for
x
in
$(
find
$slapos_home
/eggs
-name
slapos.core-
*
.egg
)
;
do
echo
Patching
$x
...
echo
" at
$x
..."
cd
$x
(
cd
$x
;
patch
-f
--dry-run
-p1
<
$filename
>
/dev/null
&&
\
patch
-f
--dry-run
-p1
<
$patch_file
>
/dev/null
&&
patch
-p1
<
$patch_file
&&
echo
Patch
$x
OK.
patch
-p1
<
$filename
&&
echo
" OK."
)
done
done
fi
fi
done
echo
Build SlapOS successfully.
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
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