3
# Copyright (C) 2016, 2020, 2023 Etersoft
4
# Copyright (C) 2016 Danil Mikhailov <danil@etersoft.ru>
5
# Copyright (C) 2016, 2020, 2023 Vitaly Lipatov <lav@etersoft.ru>
7
# This program is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU Affero General Public License as published by
9
# the Free Software Foundation, either version 3 of the License, or
10
# (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU Affero General Public License for more details.
17
# You should have received a copy of the GNU Affero General Public License
18
# along with this program. If not, see <http://www.gnu.org/licenses/>.
21
load_helper epm-install
24
EPM_KORINF_REPO_URL="https://updates.etersoft.ru/pub/Korinf"
26
__epm_korinf_site_mask() {
29
# short hack to install needed package
30
rhas "$MASK" "[-_]" || MASK="${MASK}[-_][0-9]"
31
# set arch for Korinf compatibility
32
[ "$SYSTEMARCH" = "x86_64" ] && archprefix="x86_64/"
33
local URL="$EPM_KORINF_REPO_URL/$archprefix$DISTRNAME/$DISTRVERSION"
34
if ! eget --check "$URL" ; then
35
tURL="$EPM_KORINF_REPO_URL/$archprefix$BASEDISTRNAME/$DISTRREPONAME"
36
docmd eget --check "$tURL" && URL="$tURL"
38
eget --list --latest "$URL/$MASK*.$PKGFORMAT"
43
MASK="$(__epm_korinf_site_mask "$MASK")"
44
showcmd eget --list "$MASK"
45
eget --list "$MASK" | sort
49
__epm_korinf_install() {
54
pkg="$(__epm_korinf_site_mask "$pkgurl")"
55
[ -n "$pkg" ] || fatal "Can't get package url from $pkgurl"
56
[ -n "$pkg_urls" ] && pkg_urls="$pkg_urls $pkg" || pkg_urls="$pkg"
58
# due Error: Can't use epm call from the piped script
59
#epm install $(__epm_korinf_site_mask "$PACKAGE")
60
pkg_names='' pkg_files='' epm_install
63
__epm_korinf_install_eepm()
66
if [ "$BASEDISTRNAME" = "alt" ] && [ "$DISTRVERSION" != "Sisyphus" ] && [ "$EPMMODE" = "package" ] ; then
67
if epm status --original eepm ; then
68
warning "Using external (Korinf) repo is forbidden for stable ALT branch $DISTRVERSION."
69
info "Check https://bugzilla.altlinux.org/44314 for reasons."
70
info "You can install eepm package from Korinf manually, check instruction at https://eepm.ru"
72
info "Trying update eepm from the stable ALT repository ..."
73
docmd epm install eepm
78
# enable interactive for install eepm from console
79
if inputisatty && [ "$EPMMODE" != "pipe" ] ; then
80
[ -n "$non_interactive" ] || interactive="--interactive"
82
[ -n "$interactive" ] || non_interactive="--auto"
85
# as now, can't install one package from task (and old apt-repo can't install one package)
86
if false && [ "$BASEDISTRNAME" = "alt" ] && [ -z "$direct" ] ; then
87
local task="$(docmd eget -O- https://eepm.ru/vendor/alt/task)"
88
if [ -n "$task" ] ; then
89
docmd epm install $task
92
info "Can't get actual task for ALT, fallback to Korinf"
97
# TODO: reenable eepm-repack build
98
# don't lose epm-repack if installed
99
# is_installed epm-repack && pkg_list="$pkg_list eepm-repack"
101
# enable scripts to resolve dependencies with apt
102
scripts='--scripts' __epm_korinf_install $pkg_list
105
epm_epm_install_help()
107
echo "epm ei [URL] [packages] - install packages from EPM based Korinf repository"
108
get_help HELPCMD $SHAREDIR/epm-epm_install
111
Default Korinf repository: $EPM_KORINF_REPO_URL
114
epm ei [epm|eepm] - install latest eepm (default action)
115
epm ei <package1> [<package2>...] - install package(s) from default Korinf repo
116
epm http://someurl.ru <package> - install package(s) from a repo defined by URL
117
epm --list <package mask> - list available packages by mask
124
if is_url "$1" ; then
125
EPM_KORINF_REPO_URL="$1"
126
info "Using $EPM_KORINF_REPO_URL repo ..."
132
# install epm by default
133
__epm_korinf_install_eepm
136
-h|--help) # HELPCMD: help
140
--list) # HELPCMD: list only packages
142
__epm_korinf_list "$1"
147
__epm_korinf_install "$@"