Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
9e7bb852
Commit
9e7bb852
authored
Nov 07, 2020
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-restore: improve regexps
parent
e3f809e8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
6 deletions
+42
-6
epm-restore
bin/epm-restore
+9
-6
test_fills.sh
tests/test_fills.sh
+33
-0
No files found.
bin/epm-restore
View file @
9e7bb852
...
...
@@ -47,7 +47,7 @@ __epm_filter_pip_to_rpm()
fill_sign
()
{
local
sign
=
"
$1
"
echo
"
$2
"
|
grep
-E
--
"
$sign
[[:space:]]*[0-9.]+?"
|
sed
-E
-
-
"s|.*
$sign
[[:space:]]*([0-9.]+?).*|
\1
|"
echo
"
$2
"
|
grep
-E
--
"
$sign
[[:space:]]*[0-9.]+?"
|
sed
-E
-
e
"s|.*
$sign
[[:space:]]*([0-9.]+?).*|
\1
|"
}
...
...
@@ -94,10 +94,16 @@ __epm_restore_convert_to_rpm_notation()
local
equal
=
"
$1
"
local
l
while
read
l
;
do
local
t
=
"
$(
echo
"
$l
"
|
sed
-e
"s| *[<>!]*=.*||"
-e
"s| *#.*||"
| __epm_filter_pip_to_rpm
)
"
if
echo
"
$l
"
|
grep
-q
"; *python_version *< *'3.0'"
;
then
[
-n
"
$verbose
"
]
&&
warning
"
$t
is python2 only requirement, skipped"
continue
fi
# drop various "python_version > '3.5'"
l
=
"
$(
echo
"
$l
"
|
sed
-e
"s| *;.*||"
)
"
if
echo
"
$l
"
|
grep
-qE
"^ *#"
||
[
-z
"
$l
"
]
;
then
continue
fi
local
t
=
"
$(
echo
"
$l
"
|
sed
-E
-e
"s|[[:space:]]*[<>!=]+.*||"
-e
"s| *#.*||"
| __epm_filter_pip_to_rpm
)
"
[
-n
"
$t
"
]
||
continue
# until new section
if
echo
"
$l
"
|
grep
-qE
"^
\[
"
;
then
...
...
@@ -112,10 +118,7 @@ __epm_restore_convert_to_rpm_notation()
continue
fi
fi
if
echo
"
$l
"
|
grep
-q
"; *python_version *< *'3.0'"
;
then
[
-n
"
$verbose
"
]
&&
warning
"
$t
is python2 only requirement, skipped"
continue
fi
__epm_pi_sign_to_rpm
"
$t
"
"
$l
"
"
$equal
"
done
}
...
...
tests/test_fills.sh
0 → 100755
View file @
9e7bb852
#!/bin/sh
fill_sign
()
{
local
sign
=
"
$1
"
echo
"
$2
"
|
grep
-E
--
"
$sign
[[:space:]]*[0-9.]+?"
|
sed
-E
"s|.*
$sign
[[:space:]]*([0-9.]+?).*|
\1
|"
}
l
=
"soupsieve >1.2; python_version>='3.0'"
fill_sign
">"
"soupsieve >1.2; python_version>='3.0'"
fill_sign
">"
"soupsieve >1.2"
fill_sign
">"
"soupsieve >1.2 "
fill_sign
">"
"soupsieve >1.2 t"
fill_sign
">"
"soupsieve >1.2t"
fill_sign
">="
"soupsieve >=1.2"
fill_sign
">"
"soupsieve > 1.2"
fill_sign
">"
"soupsieve >1.2; p>"
echo
"---"
l
=
"
$(
echo
"
$l
"
|
sed
-e
"s| *;.*||"
)
"
fill_sign
">"
"
$l
"
echo
test
()
{
l
=
"
$1
"
local
t
=
"
$(
echo
"
$l
"
|
sed
-E
-e
"s|[[:space:]]*[<>=!]+.*||"
-e
"s|[[:space:]]*#.*||"
)
"
#local t="$(echo "$l" | sed -E -e "s|[[:space:]]*==.*||" -e "s|[[:space:]]*#.*||")"
echo
"
$t
"
}
test
"
$l
"
test
"testfixtures==6.14.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