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
6f9fe99c
Commit
6f9fe99c
authored
Aug 18, 2016
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-install: add real support install by url
parent
aef38183
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
18 deletions
+59
-18
epm-install
bin/epm-install
+59
-18
No files found.
bin/epm-install
View file @
6f9fe99c
...
@@ -82,15 +82,6 @@ __separate_sudocmd()
...
@@ -82,15 +82,6 @@ __separate_sudocmd()
return
0
return
0
}
}
download_pkg_urls
()
{
local
url
[
-z
"
$1
"
]
&&
return
for
url
in
$*
;
do
eget
$url
||
warning
"Skipped"
done
}
# copied from etersoft-build-utils/share/eterbuild/functions/rpmpkg
# copied from etersoft-build-utils/share/eterbuild/functions/rpmpkg
epm_install_names
()
epm_install_names
()
{
{
...
@@ -490,6 +481,57 @@ epm_print_install_command()
...
@@ -490,6 +481,57 @@ 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
}
__handle_pkg_urls
()
{
[
-n
"
$pkg_urls
"
]
||
return
# TODO: do it correcly
to_remove_pkg_files
=
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"
# ;;
*
)
# use workaround with eget: download and put in pkg_files
download_pkg_urls
;;
esac
pkg_urls
=
}
epm_install
()
epm_install
()
{
{
...
@@ -498,19 +540,13 @@ epm_install()
...
@@ -498,19 +540,13 @@ epm_install()
return
return
fi
fi
# Download urls via eget pkg_urls and use eget
# in any case it will put pkg_urls into pkg_files or pkg_names
# TODO: use optimization (rpm can download packages by url, yum too?)
__handle_pkg_urls
#[ -n "$pkg_urls" ] && warning "URL using does not realize yet"
#download_pkg_urls "$pkg_urls"
# temp. hack
pkg_files
=
"
$pkg_files
$pkg_urls
"
# TODO: add downloaded files to $pkg_files
[
-z
"
$pkg_files$pkg_names
$pkg_urls
"
]
&&
info
"Skip empty install list"
&&
return
22
[
-z
"
$pkg_files$pkg_names
"
]
&&
info
"Skip empty install list"
&&
return
22
local
names
=
"
$(
echo
$pkg_names
| filter_out_installed_packages
)
"
local
names
=
"
$(
echo
$pkg_names
| filter_out_installed_packages
)
"
local
files
=
"
$(
echo
$pkg_files
| filter_out_installed_packages
)
"
local
files
=
"
$(
echo
$pkg_files
| filter_out_installed_packages
)
"
local
urls
=
"
$(
echo
$pkg_urls
| filter_out_installed_packages
)
"
[
-z
"
$files$names
"
]
&&
info
"Skip empty install list"
&&
return
22
[
-z
"
$files$names
"
]
&&
info
"Skip empty install list"
&&
return
22
...
@@ -521,4 +557,9 @@ epm_install()
...
@@ -521,4 +557,9 @@ epm_install()
epm_install_names
$names
||
return
epm_install_names
$names
||
return
epm_install_files
$files
epm_install_files
$files
# TODO: reinvent
local
RETVAL
=
$?
[
-n
"
$to_remove_pkg_files
"
]
&&
rm
-fv
$to_remove_pkg_files
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