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
c2b4006a
Commit
c2b4006a
authored
Nov 24, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-install: move download code to epm-download
parent
5899ab56
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
61 deletions
+76
-61
epm-download
bin/epm-download
+69
-0
epm-install
bin/epm-install
+7
-61
No files found.
bin/epm-download
View file @
c2b4006a
...
@@ -17,6 +17,75 @@
...
@@ -17,6 +17,75 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
__use_url_install
()
{
case
$PMTYPE
in
apt-rpm
)
# ALT Linux really?
pkg_names
=
"
$pkg_names
$pkg_urls
"
;;
#deepsolver-rpm)
# pkg_names="$pkg_names $pkg_urls"
# ;;
#urpm-rpm)
# pkg_names="$pkg_names $pkg_urls"
# ;;
pacman
)
pkg_names
=
"
$pkg_names
$pkg_urls
"
;;
yum-rpm|dnf-rpm
)
pkg_names
=
"
$pkg_names
$pkg_urls
"
;;
#zypper-rpm)
# pkg_names="$pkg_names $pkg_urls"
# ;;
*
)
return
1
;;
esac
return
0
}
# for download before install / checking
__download_pkg_urls
()
{
local
url
[
-z
"
$pkg_urls
"
]
&&
return
for
url
in
$pkg_urls
;
do
# TODO: use some individual tmp dir
local
new_file
=
/tmp/
$(
basename
"
$url
"
)
if
eget
-O
$new_file
$url
&&
[
-s
"
$new_file
"
]
;
then
pkg_files
=
"
$pkg_files
$new_file
"
to_remove_pkg_files
=
"
$to_remove_pkg_files
$new_file
"
else
warning
"Failed to download
$url
, ignoring"
fi
done
}
# NOTE: call __clean_downloaded_pkg_files after
__handle_pkg_urls_to_install
()
{
#[ -n "$pkg_urls" ] || return
# TODO: do it correctly
to_remove_pkg_files
=
if
[
"
$(
get_package_type
"
$pkg
"
)
"
!=
$PKGFORMAT
]
||
!
__use_url_install
;
then
# use workaround with eget: download and put in pkg_files
__download_pkg_urls
fi
pkg_urls
=
}
#__clean_downloaded_pkg_files()
#{
# [ -z "$to_remove_pkg_files" ] && return
# rm -fv $to_remove_pkg_files
#}
epm_download
()
epm_download
()
{
{
local
CMD
local
CMD
...
...
bin/epm-install
View file @
c2b4006a
...
@@ -506,64 +506,6 @@ epm_print_install_command()
...
@@ -506,64 +506,6 @@ epm_print_install_command()
esac
esac
}
}
download_pkg_urls
()
{
local
url
[
-z
"
$pkg_urls
"
]
&&
return
for
url
in
$pkg_urls
;
do
# TODO: use some individual tmp dir
local
new_file
=
/tmp/
$(
basename
"
$url
"
)
if
eget
-O
$new_file
$url
&&
[
-s
"
$new_file
"
]
;
then
pkg_files
=
"
$pkg_files
$new_file
"
to_remove_pkg_files
=
"
$to_remove_pkg_files
$new_file
"
else
warning
"Failed to download
$url
, ignoring"
fi
done
}
__use_url_install
()
{
case
$PMTYPE
in
apt-rpm
)
# ALT Linux really?
pkg_names
=
"
$pkg_names
$pkg_urls
"
;;
#deepsolver-rpm)
# pkg_names="$pkg_names $pkg_urls"
# ;;
#urpm-rpm)
# pkg_names="$pkg_names $pkg_urls"
# ;;
pacman
)
pkg_names
=
"
$pkg_names
$pkg_urls
"
;;
yum-rpm|dnf-rpm
)
pkg_names
=
"
$pkg_names
$pkg_urls
"
;;
#zypper-rpm)
# pkg_names="$pkg_names $pkg_urls"
# ;;
*
)
return
1
;;
esac
return
0
}
__handle_pkg_urls
()
{
[
-n
"
$pkg_urls
"
]
||
return
# TODO: do it correctly
to_remove_pkg_files
=
if
[
"
$(
get_package_type
"
$pkg
"
)
"
!=
$PKGFORMAT
]
||
!
__use_url_install
;
then
# use workaround with eget: download and put in pkg_files
download_pkg_urls
fi
pkg_urls
=
}
epm_install
()
epm_install
()
{
{
...
@@ -572,8 +514,11 @@ epm_install()
...
@@ -572,8 +514,11 @@ epm_install()
return
return
fi
fi
# in any case it will put pkg_urls into pkg_files or pkg_names
# if possible, it will put pkg_urls into pkg_files or pkg_names
__handle_pkg_urls
if
[
-n
"
$pkg_urls
"
]
;
then
load_helper epm-download
__handle_pkg_urls_to_install
fi
[
-z
"
$pkg_files$pkg_names
"
]
&&
info
"Skip empty install list"
&&
return
22
[
-z
"
$pkg_files$pkg_names
"
]
&&
info
"Skip empty install list"
&&
return
22
...
@@ -589,9 +534,10 @@ epm_install()
...
@@ -589,9 +534,10 @@ epm_install()
epm_install_names
$names
||
return
epm_install_names
$names
||
return
epm_install_files
$files
epm_install_files
$files
local
RETVAL
=
$?
# TODO: reinvent
# TODO: reinvent
local
RETVAL
=
$?
[
-n
"
$to_remove_pkg_files
"
]
&&
rm
-fv
$to_remove_pkg_files
[
-n
"
$to_remove_pkg_files
"
]
&&
rm
-fv
$to_remove_pkg_files
return
$RETVAL
return
$RETVAL
}
}
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