Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Guillaume Hervier
slapos
Commits
334e0615
Commit
334e0615
authored
Oct 08, 2012
by
Viktor Horvath
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Instead of patching Mioga, rather modify the configuration
dynamically through a pre-configure-hook.
parent
814e91da
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
104 additions
and
13 deletions
+104
-13
software/mioga/mioga-hooks.py
software/mioga/mioga-hooks.py
+58
-0
software/mioga/mioga-patch
software/mioga/mioga-patch
+14
-2
software/mioga/mioga-postmakehook.py
software/mioga/mioga-postmakehook.py
+0
-11
software/mioga/software.cfg
software/mioga/software.cfg
+32
-0
No files found.
software/mioga/mioga-hooks.py
0 → 100644
View file @
334e0615
# import fnmatch
import
grp
import
os
import
pprint
import
pwd
import
re
import
shutil
import
sys
class
FileModifier
:
def
__init__
(
self
,
filename
):
self
.
filename
=
filename
f
=
open
(
filename
,
'rb'
)
self
.
content
=
f
.
read
()
f
.
close
()
def
modify
(
self
,
key
,
value
):
(
self
.
content
,
count
)
=
re
.
subn
(
r'(<parameter[^>]*\
s
name\
s*=
\s*"'
+
re
.
escape
(
key
)
+
r'"[^>]*\
sde
fault\
s*=
\s*")[^"]*'
,
r"\
g<
1>"
+
value
,
self
.
content
)
return
count
def
save
(
self
):
f
=
open
(
self
.
filename
,
'w'
)
f
.
write
(
self
.
content
)
f
.
close
()
def
pre_configure_hook
(
options
,
bo
,
env
):
location
=
options
[
'location'
]
# TODO: double-check which one of these values must be set
# at instantiation time!
fm
=
FileModifier
(
'conf/Config.xml'
)
fm
.
modify
(
'apache_user'
,
pwd
.
getpwuid
(
os
.
getuid
())[
0
])
fm
.
modify
(
'apache_group'
,
grp
.
getgrgid
(
os
.
getgid
())[
0
])
mioga_base
=
os
.
path
.
join
(
location
,
'var'
,
'lib'
,
'Mioga2'
)
fm
.
modify
(
'install_dir'
,
mioga_base
)
fm
.
modify
(
'tmp_dir'
,
os
.
path
.
join
(
mioga_base
,
'tmp'
))
fm
.
modify
(
'search_tmp_dir'
,
os
.
path
.
join
(
mioga_base
,
'mioga_search'
))
fm
.
modify
(
'maildir'
,
os
.
path
.
join
(
location
,
'var'
,
'spool'
,
'mioga'
,
'maildir'
))
fm
.
modify
(
'maildirerror'
,
os
.
path
.
join
(
location
,
'var'
,
'spool'
,
'mioga'
,
'error'
))
fm
.
modify
(
'mailfifo'
,
os
.
path
.
join
(
location
,
'var'
,
'spool'
,
'mioga'
,
'fifo'
))
fm
.
save
()
# TODO: mail settings are certainly wrong, what is the domain name?
def
post_make_hook
(
options
,
buildout
):
# location = options['location']
# print "Mioga - postmakehook"
# print "We are currently in", os.getcwd()
# shutil.move("var", location)
return
None
software/mioga/mioga-patch
View file @
334e0615
diff -r c0f4c1b8b448 -r 9ee4fec6ee34 lib/MiogaConf.pm
diff -r c0f4c1b8b448 Makefile.PL
--- a/Makefile.PL Sat Oct 06 16:15:43 2012 +0200
+++ b/Makefile.PL Mon Oct 08 14:47:20 2012 +0200
@@ -115,7 +115,7 @@
# ----------------------------------------------------------------------------
sub MY::processPL {
return '
-# Not realy in the good section, but at a good place:
+# Not really in the good section, but at a good place:
# between "all" and next "tardist"
include config.mk
diff -r c0f4c1b8b448 lib/MiogaConf.pm
--- a/lib/MiogaConf.pm Sat Oct 06 16:15:43 2012 +0200
+++ b/lib/MiogaConf.pm
Sat Oct 06 16:17:31
2012 +0200
+++ b/lib/MiogaConf.pm
Mon Oct 08 14:47:20
2012 +0200
@@ -811,6 +811,10 @@
my @missing;
my @missing_clib;
...
...
software/mioga/mioga-postmakehook.py
deleted
100644 → 0
View file @
814e91da
# import fnmatch
import
os
import
shutil
# import pprint
def
post_make_hook
(
options
,
buildout
):
location
=
options
[
'location'
]
print
"Mioga - postmakehook"
print
"We are currently in"
,
os
.
getcwd
()
shutil
.
move
(
"var"
,
location
)
software/mioga/software.cfg
View file @
334e0615
...
...
@@ -14,6 +14,8 @@ extends =
../../component/perl-Image-Magick/buildout.cfg
../../component/postgresql/buildout.cfg
../../component/perl-DBD-Pg/buildout.cfg
../../component/perl-Search-Xapian/buildout.cfg
../../component/libxslt/buildout.cfg
../../component/lxml-python/buildout.cfg
../../stack/slapos.cfg
...
...
@@ -31,7 +33,9 @@ parts =
perl-Text-Iconv
perl-Image-Magick
perl-String-Checker-mioga
perl-Search-Xapian
cpan-simple-modules
mioga
[eggs]
recipe = zc.recipe.egg
...
...
@@ -93,6 +97,34 @@ md5sum = c750a33505609544f95eace7a2896c84
configure-command =
${perl:location}/bin/perl Makefile.PL
[mioga]
recipe = hexagonit.recipe.cmmi
url = http://www.alixen.org/attachments/download/87/Mioga2-2.4.14.tar.gz
md5sum = 8282ae4b93fcea3f346168e6a855f65c
environment =
PATH=${libxslt:location}/bin:${libxml2:location}/bin:%(PATH)s
patch-options = -p1
patches =
${mioga-patch:location}/${mioga-patch:filename}
# post-make-hook = ${mioga-postmakehook:location}/${mioga-postmakehook:filename}:post_make_hook
pre-configure-hook = ${mioga-hooks:location}/${mioga-hooks:filename}:pre_configure_hook
configure-command =
${perl:location}/bin/perl Makefile.PL
[mioga-patch]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
# md5sum = b836ad89902d1ea68b091a5b9800edd8
download-only = true
filename = ${:_buildout_section_name_}
[mioga-hooks]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/${:filename}
# md5sum = c7ceec7788749238cb5fbe09beb647b1
download-only = true
filename = mioga-hooks.py
[networkcache]
# Cedric de Saint Martin signature certificate
signature-certificate-list =
...
...
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