Commit 9956f583 authored by Vitaly Lipatov's avatar Vitaly Lipatov

addrepo: add support for dnf, add support for epel repo add

parent 16a6e203
#!/bin/sh
#
# Copyright (C) 2012, 2017 Etersoft
# Copyright (C) 2012, 2017 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2012, 2017, 2019 Etersoft
# Copyright (C) 2012, 2017, 2019 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
......@@ -19,6 +19,24 @@
load_helper epm-sh-altlinux
__epm_addrepo_rhel()
{
local repo="$@"
if [ -z "$repo" ] ; then
echo "Add repo."
echo "1. Use with repository URL, f.i. http://www.example.com/example.repo"
echo "2. Use with epel to add EPEL repository"
return 1
fi
case "$1" in
epel)
epm install epel-release
return 1
;;
esac
return 0
}
__epm_addrepo_altlinux()
{
local repo="$@"
......@@ -114,8 +132,13 @@ case $PMTYPE in
;;
yum-rpm)
assure_exists yum-utils
__epm_addrepo_rhel "$repo" || return
sudocmd yum-config-manager --add-repo "$repo"
;;
dnf-rpm)
__epm_addrepo_rhel "$repo" || return
sudocmd dnf config-manager --add-repo "$repo"
;;
urpm-rpm)
sudocmd urpmi.addmedia "$repo"
;;
......
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