Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
archlinux
archversion
Commits
2ec638ec
Commit
2ec638ec
authored
Sep 19, 2021
by
Seblu
Browse files
Allow use of re module in eval_ functions
parent
da7b4b5d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/archversion/version.py
View file @
2ec638ec
...
...
@@ -105,7 +105,7 @@ class VersionController(object):
# apply eval to upstream
e_upstream
=
value
.
get
(
"eval_upstream"
,
None
)
if
e_upstream
is
not
None
:
v_upstream
=
eval
(
e_upstream
,
{},
{
"version"
:
v_upstream
})
v_upstream
=
eval
(
e_upstream
,
{
"re"
:
re
},
{
"version"
:
v_upstream
})
logging
.
debug
(
"eval_upstream produce version: %s"
%
v_upstream
)
# save upstream version
if
self
.
_cache
[
"upstream"
].
get
(
name
,
{}).
get
(
"version"
,
None
)
!=
v_upstream
:
...
...
@@ -123,7 +123,7 @@ class VersionController(object):
# apply eval to downstream
e_downstream
=
value
.
get
(
"eval_downstream"
,
None
)
if
e_downstream
is
not
None
:
v_downstream
=
eval
(
e_downstream
,
{},
{
"version"
:
v_downstream
})
v_downstream
=
eval
(
e_downstream
,
{
"re"
:
re
},
{
"version"
:
v_downstream
})
logging
.
debug
(
"eval_downstream produce version: %s"
%
v_downstream
)
# save downstream version
if
self
.
_cache
[
"downstream"
].
get
(
name
,
{}).
get
(
"version"
,
None
)
!=
v_downstream
:
...
...
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