Commit fd536664 authored by Vitaly Lipatov's avatar Vitaly Lipatov

commit packed 3.8.5

parent 35604943
...@@ -6285,6 +6285,11 @@ epm_requires() ...@@ -6285,6 +6285,11 @@ epm_requires()
# File bin/epm-restore: # File bin/epm-restore:
__epm_restore_print_comment()
{
echo "#$2 generated by 'epm restore --dry-run' from $(basename $(dirname $(realpath "$1")))/$(basename "$1")$3"
}
__epm_filter_pip_to_rpm() __epm_filter_pip_to_rpm()
{ {
tr "A-Z" "a-z" | sed -e "s|_|-|g" -e "s|^python[-_]||" \ tr "A-Z" "a-z" | sed -e "s|_|-|g" -e "s|^python[-_]||" \
...@@ -6320,10 +6325,11 @@ __epm_pi_sign_to_rpm() ...@@ -6320,10 +6325,11 @@ __epm_pi_sign_to_rpm()
local pi='' local pi=''
local sign ll local sign ll
for sign in "<=" "<" ">=" ">" "==" "!="; do for sign in "<=" "<" ">=" ">" "==" "!=" "~="; do
ll=$(fill_sign "$sign" "$l") ll=$(fill_sign "$sign" "$l")
[ -n "$ll" ] || continue [ -n "$ll" ] || continue
[ "$sign" = "==" ] && sign="$equal" [ "$sign" = "==" ] && sign="$equal"
[ "$sign" = "~=" ] && sign="$equal"
[ "$sign" = "!=" ] && sign=">=" [ "$sign" = "!=" ] && sign=">="
[ -n "$pi" ] && pi="$pi [ -n "$pi" ] && pi="$pi
" "
...@@ -6360,7 +6366,7 @@ __epm_restore_convert_to_rpm_notation() ...@@ -6360,7 +6366,7 @@ __epm_restore_convert_to_rpm_notation()
if echo "$l" | grep -qE "^ *#" || [ -z "$l" ] ; then if echo "$l" | grep -qE "^ *#" || [ -z "$l" ] ; then
continue continue
fi fi
local t="$(echo "$l" | sed -E -e "s|[[:space:]]*[<>!=]+.*||" -e "s| *#.*||" | __epm_filter_pip_to_rpm)" local t="$(echo "$l" | sed -E -e "s|[[:space:]]*[<>!=~]+.*||" -e "s| *#.*||" | __epm_filter_pip_to_rpm)"
[ -n "$t" ] || continue [ -n "$t" ] || continue
# until new section # until new section
if echo "$l" | grep -qE "^\[" ; then if echo "$l" | grep -qE "^\[" ; then
...@@ -6390,7 +6396,7 @@ __epm_restore_pip() ...@@ -6390,7 +6396,7 @@ __epm_restore_pip()
reqmacro="%py3_use" reqmacro="%py3_use"
basename "$req_file" | egrep -q "(dev|test)" && reqmacro="%py3_buildrequires" basename "$req_file" | egrep -q "(dev|test)" && reqmacro="%py3_buildrequires"
echo echo
echo "# generated by epm restore --dry-run from $(basename $(dirname $(realpath $req_file)))/$req_file" __epm_restore_print_comment "$req_file"
cat $req_file | __epm_restore_convert_to_rpm_notation | sed -e "s|^|$reqmacro |" cat $req_file | __epm_restore_convert_to_rpm_notation | sed -e "s|^|$reqmacro |"
return return
else else
...@@ -6451,7 +6457,7 @@ $l" ...@@ -6451,7 +6457,7 @@ $l"
if [ -n "$dryrun" ] ; then if [ -n "$dryrun" ] ; then
echo echo
echo "# generated by epm restore --dry-run from $(basename $(dirname $(realpath $req_file)))/$req_file $(__epm_get_array_name "$section")" __epm_restore_print_comment "$req_file" "" " $(__epm_get_array_name "$section")"
__epm_lineprint_python_array "$ar" | __epm_restore_convert_to_rpm_notation ">=" | sed -e "s|^|$reqmacro |" __epm_lineprint_python_array "$ar" | __epm_restore_convert_to_rpm_notation ">=" | sed -e "s|^|$reqmacro |"
else else
ilist="$ilist $(__epm_lineprint_python_array "$ar" | __epm_restore_convert_to_rpm_notation ">=" | cut -d' ' -f 1 | sed -e "s|^|python3-module-|")" ilist="$ilist $(__epm_lineprint_python_array "$ar" | __epm_restore_convert_to_rpm_notation ">=" | cut -d' ' -f 1 | sed -e "s|^|python3-module-|")"
...@@ -6514,11 +6520,11 @@ __epm_restore_npm() ...@@ -6514,11 +6520,11 @@ __epm_restore_npm()
local lt=$(mktemp) local lt=$(mktemp)
a= jq .dependencies <$req_file >$lt a= jq .dependencies <$req_file >$lt
echo echo
echo "# generated by epm restore --dry-run from $(basename $(dirname $(realpath $req_file)))/$req_file" __epm_restore_print_comment "$req_file"
__epm_print_npm_list "Requires:" $lt __epm_print_npm_list "Requires:" $lt
echo echo
echo "# devDependencies generated by epm restore --dry-run from $(basename $(dirname $(realpath $req_file)))/$req_file" __epm_restore_print_comment "$req_file" " devDependencies"
a= jq .devDependencies <$req_file >$lt a= jq .devDependencies <$req_file >$lt
__epm_print_npm_list "BuildRequires:" $lt __epm_print_npm_list "BuildRequires:" $lt
rm -f $lt rm -f $lt
...@@ -6553,6 +6559,12 @@ __epm_restore_by() ...@@ -6553,6 +6559,12 @@ __epm_restore_by()
return return
fi fi
case $req_file in
requirements/default.txt|requirements/dev.txt|requirements/test.txt)
[ -s "$req_file" ] && __epm_restore_pip "$req_file" && return
;;
esac
case $(basename $req_file) in case $(basename $req_file) in
requirements.txt|dev-requirements.txt|requirements-dev.txt|requirements_dev.txt|requirements_test.txt|requirements-test.txt|test-requirements.txt|requires.txt) requirements.txt|dev-requirements.txt|requirements-dev.txt|requirements_dev.txt|requirements_test.txt|requirements-test.txt|test-requirements.txt|requires.txt)
[ -s "$req_file" ] && __epm_restore_pip "$req_file" [ -s "$req_file" ] && __epm_restore_pip "$req_file"
...@@ -6588,7 +6600,7 @@ epm_restore() ...@@ -6588,7 +6600,7 @@ epm_restore()
# if run with empty args # if run with empty args
for i in requirements.txt requirements_dev.txt requirements-dev.txt dev-requirements.txt requirements-test.txt requirements_test.txt test-requirements.txt Gemfile requires.txt package.json setup.py python_dependencies.py; do 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 Gemfile requires.txt package.json setup.py python_dependencies.py; do
__epm_restore_by $i __epm_restore_by $i
done done
...@@ -9296,7 +9308,7 @@ Examples: ...@@ -9296,7 +9308,7 @@ Examples:
print_version() print_version()
{ {
echo "EPM package manager version 3.8.4 https://wiki.etersoft.ru/Epm" echo "EPM package manager version 3.8.5 https://wiki.etersoft.ru/Epm"
echo "Running on $($DISTRVENDOR -e) ('$PMTYPE' package manager uses '$PKGFORMAT' package format)" echo "Running on $($DISTRVENDOR -e) ('$PMTYPE' package manager uses '$PKGFORMAT' package format)"
echo "Copyright (c) Etersoft 2012-2020" echo "Copyright (c) Etersoft 2012-2020"
echo "This program may be freely redistributed under the terms of the GNU AGPLv3." echo "This program may be freely redistributed under the terms of the GNU AGPLv3."
...@@ -9306,7 +9318,7 @@ print_version() ...@@ -9306,7 +9318,7 @@ print_version()
Usage="Usage: epm [options] <command> [package name(s), package files]..." Usage="Usage: epm [options] <command> [package name(s), package files]..."
Descr="epm - EPM package manager" Descr="epm - EPM package manager"
EPMVERSION=3.8.4 EPMVERSION=3.8.5
verbose= verbose=
quiet= quiet=
nodeps= nodeps=
......
...@@ -2788,7 +2788,7 @@ print_version() ...@@ -2788,7 +2788,7 @@ print_version()
local on_text="(host system)" local on_text="(host system)"
local virt="$($DISTRVENDOR -i)" local virt="$($DISTRVENDOR -i)"
[ "$virt" = "(unknown)" ] || [ "$virt" = "(host system)" ] || on_text="(under $virt)" [ "$virt" = "(unknown)" ] || [ "$virt" = "(host system)" ] || on_text="(under $virt)"
echo "Service manager version 3.8.4 https://wiki.etersoft.ru/Epm" echo "Service manager version 3.8.5 https://wiki.etersoft.ru/Epm"
echo "Running on $($DISTRVENDOR -e) $on_text with $SERVICETYPE" echo "Running on $($DISTRVENDOR -e) $on_text with $SERVICETYPE"
echo "Copyright (c) Etersoft 2012-2019" echo "Copyright (c) Etersoft 2012-2019"
echo "This program may be freely redistributed under the terms of the GNU AGPLv3." echo "This program may be freely redistributed under the terms of the GNU AGPLv3."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment