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
c8545164
Commit
c8545164
authored
Aug 22, 2021
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm restore: add perl requirements generation by META.yml
parent
b7c6e6e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
2 deletions
+70
-2
epm-restore
bin/epm-restore
+70
-2
No files found.
bin/epm-restore
View file @
c8545164
...
...
@@ -269,6 +269,38 @@ __epm_print_npm_list()
[
-n
"
$dryrun
"
]
||
echo
"
$ilist
"
}
__epm_print_perl_list
()
{
local
reqmacro
=
"
$1
"
local
req_file
=
"
$2
"
local
l
while
read
l
;
do
# Convert::ASN1: 0.10
echo
"
$l
"
|
grep
-q
'^ *\(.*\): \(.*\)'
||
continue
local
name
=
"
$(
echo
"
$l
"
|
sed
-e
's| *\(.*\): \(.*\)|\1|'
-e
's|::|-|g'
)
"
[
"
$name
"
=
"perl"
]
&&
continue
[
-z
"
$name
"
]
&&
continue
local
ver
=
"
$(
echo
"
$l
"
|
sed
-e
's| *\(.*\): \(.*\)|\2|'
)
"
[
-z
"
$name
"
]
&&
continue
if
[
-n
"
$dryrun
"
]
;
then
local
pi
=
''
local
sign
=
''
[
"
$ver
"
=
"0"
]
||
sign
=
" >=
$ver
"
pi
=
"
$pi$reqmacro
perl-
$name$sign
"
echo
"
$pi
"
continue
else
local
pi
=
"perl-
$name
"
#echo " $l -> $name -> $pi"
fi
[
-n
"
$name
"
]
||
continue
ilist
=
"
$ilist
$pi
"
done
<
$req_file
[
-n
"
$dryrun
"
]
||
echo
"
$ilist
"
}
__epm_print_nupkg_list
()
{
...
...
@@ -300,7 +332,7 @@ __epm_restore_npm()
{
local
req_file
=
"
$1
"
epm assure jq
epm assure jq
||
fatal
if
[
-n
"
$dryrun
"
]
;
then
local
lt
=
$(
mktemp
)
...
...
@@ -327,6 +359,39 @@ __epm_restore_npm()
docmd epm
install
$ilist
}
__epm_restore_perl
()
{
local
req_file
=
"
$1
"
epm assure shyaml
||
fatal
if
[
-n
"
$dryrun
"
]
;
then
local
lt
=
$(
mktemp
)
a
=
shyaml get-value requires <
$req_file
>
$lt
# all requirements will autodetected during packing, put it to the buildreq
echo
__epm_restore_print_comment
"
$req_file
"
__epm_print_perl_list
"BuildRequires:"
$lt
echo
__epm_restore_print_comment
"
$req_file
"
" build_requires"
a
=
shyaml get-value build_requires <
$req_file
>
$lt
__epm_print_perl_list
"BuildRequires:"
$lt
rm
-f
$lt
return
fi
info
"Install requirements from
$req_file
..."
local
lt
=
$(
mktemp
)
a
=
shyaml get-value requires <
$req_file
>
$lt
ilist
=
"
$(
__epm_print_perl_list
""
$lt
)
"
a
=
shyaml get-value build_requires <
$req_file
>
$lt
ilist
=
"
$ilist
$(
__epm_print_perl_list
""
$lt
)
"
rm
-f
$lt
docmd epm
install
$ilist
}
__epm_restore_by
()
{
local
req_file
=
"
$1
"
...
...
@@ -361,6 +426,9 @@ __epm_restore_by()
package.json
)
[
-s
"
$req_file
"
]
&&
__epm_restore_npm
"
$req_file
"
;;
META.yml
)
[
-s
"
$req_file
"
]
&&
__epm_restore_perl
"
$req_file
"
;;
*
.sln|
*
.csproj
)
local
PROJ
=
"
$(
echo
$req_file
)
"
[
-s
"
$PROJ
"
]
&&
__epm_restore_nupkg
"
$PROJ
"
...
...
@@ -393,7 +461,7 @@ epm_restore()
# if run with empty args
for
i
in
requirements.txt requirements/default.txt requirements_dev.txt requirements-dev.txt requirements/dev.txt dev-requirements.txt
\
requirements-test.txt requirements_test.txt requirements/test.txt test-requirements.txt requirements/coverage.txt
\
Gemfile requires.txt package.json setup.py python_dependencies.py
\
Gemfile requires.txt package.json setup.py python_dependencies.py
META.yml
\
*
.sln
*
.csproj
;
do
__epm_restore_by
$i
done
...
...
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