Commit 8bde27db authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm addrepo/removerepo: fix repo manipulating on deb systems

parent c2061231
...@@ -114,20 +114,50 @@ __epm_addrepo_altlinux() ...@@ -114,20 +114,50 @@ __epm_addrepo_altlinux()
return return
fi fi
if [ -z "$repo" ] ; then sudocmd apt-repo $dryrun add "$repo"
info "Add branch repo. Use follow params:"
sudocmd apt-repo $dryrun add branch }
echo "etersoft - for LINUX@Etersoft repo"
echo "basealt - for BaseALT repo" __epm_addrepo_deb()
echo "yandex - for BaseALT repo mirror on yandex (recommended)" {
echo "<task number> - add task repo" assure_exists apt-add-repository software-properties-common
echo "archive 2018/02/09 - for archive from that date" local ad="$($DISTRVENDOR --distro-arch)"
echo "autoimports - for BaseALT autoimports repo" # TODO: move to distro_info
local nd="$(lsb_release -cs)"
local repo="$*"
if [ -z "$repo" ] || [ "$repo" = "--help" ]; then
info "Add repo. You can use follow params:"
echo " docker - add official docker repo"
echo " ppa:<user>/<ppa-name> - add PPA repo"
echo " distribution component name"
echo " full sources list line"
echo " URL version component"
return return
fi fi
sudocmd apt-repo $dryrun add "$repo" # keywords
case "$1" in
docker)
# sudo apt-add-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
repo="https://download.docker.com/linux/$PKGVENDOR $nd stable"
;;
esac
# if started from url, use heroistic
if echo "$repo" | egrep -q "^https?://" ; then
repo="deb [arch=$ad] $repo"
fi
if echo "$repo" | grep -q "https://" ; then
assure_exists /usr/share/doc/apt-transport-https apt-transport-https
assure_exists /usr/sbin/update-ca-certificates ca-certificates
fi
# FIXME: quotes in showcmd/sudocmd
showcmd apt-add-repository "$repo"
$SUDO apt-add-repository "$repo"
info "Check file /etc/apt/sources.list if needed"
} }
epm_addrepo() epm_addrepo()
...@@ -143,12 +173,8 @@ esac ...@@ -143,12 +173,8 @@ esac
case $PMTYPE in case $PMTYPE in
apt-dpkg) apt-dpkg)
assure_exists apt-add-repository software-properties-common # Note! Don't use quotes here
if echo "$repo" | grep -q "https://" ; then __epm_addrepo_deb $repo
assure_exists apt-transport-https
fi
sudocmd apt-add-repository "$repo"
info "Check file /etc/apt/sources.list if needed"
;; ;;
aptitude-dpkg) aptitude-dpkg)
info "You need manually add repo to /etc/apt/sources.list (TODO)" info "You need manually add repo to /etc/apt/sources.list (TODO)"
......
...@@ -83,7 +83,8 @@ esac; ...@@ -83,7 +83,8 @@ esac;
case $PMTYPE in case $PMTYPE in
apt-dpkg) apt-dpkg)
assure_exists apt-add-repository software-properties-common assure_exists apt-add-repository software-properties-common
sudocmd apt-add-repository --remove "$@" showcmd apt-add-repository --remove "$*"
$SUDO apt-add-repository --remove "$*"
info "Check file /etc/apt/sources.list if needed" info "Check file /etc/apt/sources.list if needed"
;; ;;
aptitude-dpkg) aptitude-dpkg)
......
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