Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Praetorius, Simon
dune-easybuild
Commits
6dc52d79
Commit
6dc52d79
authored
Aug 15, 2018
by
Praetorius, Simon
Browse files
update duneeasyconfig.sh with parsing of dune-module files
parent
a8806696
Changes
2
Hide whitespace changes
Inline
Side-by-side
tools/duneeasyconfig.sh
View file @
6dc52d79
...
...
@@ -26,14 +26,7 @@ cd ${GIT_DIR}
# parse dune-module file
VERSION
=
`
date
+%Y.%m.%d
`
DEP_NAMES
=(
"dune-common"
)
DEP_VERS
=(
"2.6.0"
)
DEPENDENCIES
=
""
for
index
in
${
!DEP_NAMES[*]
}
do
DEPENDENCIES+
=
" ('
${
DEP_NAMES
[
$index
]
}
', '
${
DEP_VERS
[
$index
]
}
'),"
done
DEPENDENCIES
=
$(
python
${
DIR
}
/tools/parse_dune.module.py
${
GIT_DIR
}
/dune.module
)
git archive
--format
=
tar.gz
--prefix
=
${
MODULE
}
-v
${
VERSION
}
/ HEAD
>
${
DIR
}
/d/
${
MODULE
}
/
${
MODULE
}
-v
${
VERSION
}
.tar.gz
...
...
@@ -59,7 +52,7 @@ configopts = ' -DCMAKE_BUILD_TYPE=Release \${CMAKE_FLAGS}'
srcdir = './%(namelower)s-v%(version)s/'
sanity_check_paths = {
'files': ['lib/dunecontrol/
${
MODULE
}
/dune.module'],
'files': ['lib/dunecontrol/
%(namelower)s
/dune.module'],
'dirs': ['include/dune/']
}
...
...
@@ -71,6 +64,6 @@ module unload git
module load EasyBuild
cd
${
DIR
}
eb
${
EASYCONFIG
}
--moduleclasses
=
dune
--robot
=
external/:modules/
--inject-checksums
eb
${
EASYCONFIG
}
--moduleclasses
=
dune
--inject-checksums
rm
${
EASYCONFIG
}
.bak_
*
tools/parse_dune.module.py
0 → 100644
View file @
6dc52d79
import
re
import
sys
version_pattern
=
re
.
compile
(
'([0-9]+)\.([0-9]+)(?:\.([0-9]+))?'
)
depends_pattern
=
re
.
compile
(
'([a-zA-Z_-]+)(?:[ ]*\(([<>=]+)[ ]*([0-9.]+)\))?'
)
def
make_version
(
version
,
mod_version
,
fixed_version
):
if
fixed_version
:
return
fixed_version
elif
version
:
m
=
version_pattern
.
match
(
version
)
return
m
.
group
(
1
)
+
'.'
+
m
.
group
(
2
)
+
'.'
+
(
m
.
group
(
3
)
if
m
.
group
(
3
)
is
not
None
else
'0'
)
else
:
return
mod_version
if
len
(
sys
.
argv
)
<
2
:
print
(
'usage: '
+
sys
.
argv
[
0
]
+
' dune.module [fixed_version]'
)
exit
(
1
)
Module
=
None
Version
=
None
Depends
=
None
Suggests
=
None
with
open
(
sys
.
argv
[
1
])
as
modulefile
:
for
line
in
modulefile
:
dep
=
'Depends'
sug
=
'Suggests'
ver
=
'Version'
mod
=
'Module'
if
line
[
0
:
len
(
dep
)]
==
dep
:
Depends
=
line
[
len
(
dep
)
+
1
:
-
1
].
strip
()
elif
line
[
0
:
len
(
sug
)]
==
sug
:
Suggests
=
line
[
len
(
sug
)
+
1
:
-
1
].
strip
()
elif
line
[
0
:
len
(
ver
)]
==
ver
:
Version
=
line
[
len
(
ver
)
+
1
:
-
1
].
strip
()
elif
line
[
0
:
len
(
mod
)]
==
mod
:
Module
=
line
[
len
(
mod
)
+
1
:
-
1
].
strip
()
fixed_version
=
None
if
len
(
sys
.
argv
)
>
2
:
fixed_version
=
sys
.
argv
[
2
]
Dependencies
=
[]
if
Depends
:
m
=
depends_pattern
.
findall
(
Depends
)
if
m
:
for
g
in
m
:
Dependencies
.
append
((
g
[
0
],
make_version
(
g
[
2
],
Version
,
fixed_version
)))
if
Suggests
:
m
=
depends_pattern
.
findall
(
Suggests
)
if
m
:
for
g
in
m
:
Dependencies
.
append
((
g
[
0
],
make_version
(
g
[
2
],
Version
,
fixed_version
)))
for
d
in
Dependencies
:
print
(
" ('"
+
d
[
0
]
+
"', '"
+
d
[
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