Commit 54b6e87c authored by Vitaly Lipatov's avatar Vitaly Lipatov

addrepo/removerepo: add dry-run support

parent 22d78ade
...@@ -94,13 +94,13 @@ __epm_addrepo_altlinux() ...@@ -94,13 +94,13 @@ __epm_addrepo_altlinux()
assure_exists apt-repo assure_exists apt-repo
if tasknumber "$repo" >/dev/null ; then if tasknumber "$repo" >/dev/null ; then
sudocmd_foreach 'apt-repo add' $(tasknumber "$repo") sudocmd_foreach "apt-repo $dryrun add" $(tasknumber "$repo")
return return
fi fi
if [ -z "$repo" ] ; then if [ -z "$repo" ] ; then
info "Add branch repo. Use follow params:" info "Add branch repo. Use follow params:"
sudocmd apt-repo add branch sudocmd apt-repo $dryrun add branch
echo "etersoft - for LINUX@Etersoft repo" echo "etersoft - for LINUX@Etersoft repo"
echo "archive 2018/02/09 - for archive from that date" echo "archive 2018/02/09 - for archive from that date"
return return
...@@ -108,7 +108,7 @@ __epm_addrepo_altlinux() ...@@ -108,7 +108,7 @@ __epm_addrepo_altlinux()
# TODO: add other mirror (mirror.yandex.ru) # TODO: add other mirror (mirror.yandex.ru)
# TODO: apt-repo supports archive # TODO: apt-repo supports archive
sudocmd apt-repo add "$repo" sudocmd apt-repo $dryrun add "$repo"
} }
......
...@@ -24,7 +24,7 @@ __epm_removerepo_alt_grepremove() ...@@ -24,7 +24,7 @@ __epm_removerepo_alt_grepremove()
{ {
local rp local rp
epm repolist | grep -E "$1" | while read rp ; do epm repolist | grep -E "$1" | while read rp ; do
sudocmd apt-repo rm "$rp" sudocmd apt-repo $dryrun rm "$rp"
done done
} }
...@@ -48,7 +48,7 @@ __epm_removerepo_alt() ...@@ -48,7 +48,7 @@ __epm_removerepo_alt()
info "remove autoimports repo" info "remove autoimports repo"
[ -n "$DISTRVERSION" ] || fatal "Empty DISTRVERSION" [ -n "$DISTRVERSION" ] || fatal "Empty DISTRVERSION"
repo="autoimports.$(echo "$DISTRVERSION" | tr "[:upper:]" "[:lower:]")" repo="autoimports.$(echo "$DISTRVERSION" | tr "[:upper:]" "[:lower:]")"
sudocmd apt-repo rm "$repo" sudocmd apt-repo $dryrun rm "$repo"
;; ;;
archive) archive)
info "remove archive repos" info "remove archive repos"
...@@ -63,7 +63,7 @@ __epm_removerepo_alt() ...@@ -63,7 +63,7 @@ __epm_removerepo_alt()
__epm_removerepo_alt_grepremove " repo/$1/" __epm_removerepo_alt_grepremove " repo/$1/"
;; ;;
*) *)
sudocmd apt-repo rm "$*" sudocmd apt-repo $dryrun rm "$*"
;; ;;
esac esac
......
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