Commit 214ab747 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add initial support for appget and winget

parent 5972d14d
...@@ -161,6 +161,9 @@ case $PMTYPE in ...@@ -161,6 +161,9 @@ case $PMTYPE in
npackd) npackd)
sudocmd npackdcl add-repo --url="$repo" sudocmd npackdcl add-repo --url="$repo"
;; ;;
winget)
sudocmd winget source add "$repo"
;;
slackpkg) slackpkg)
info "You need manually add repo to /etc/slackpkg/mirrors" info "You need manually add repo to /etc/slackpkg/mirrors"
;; ;;
......
...@@ -80,6 +80,9 @@ case $PMTYPE in ...@@ -80,6 +80,9 @@ case $PMTYPE in
pkgng) pkgng)
sudocmd pkg clean -a sudocmd pkg clean -a
;; ;;
appget|winget)
sudocmd $PMTYPE clean
;;
xbps) xbps)
sudocmd xbps-remove -O sudocmd xbps-remove -O
;; ;;
......
...@@ -134,6 +134,12 @@ case $PMTYPE in ...@@ -134,6 +134,12 @@ case $PMTYPE in
aptcyg) aptcyg)
docmd apt-cyg show $pkg_names docmd apt-cyg show $pkg_names
;; ;;
winget)
docmd winget show $pkg_names
;;
appget)
docmd appget view $pkg_names
;;
*) *)
fatal "Have no suitable command for $PMTYPE" fatal "Have no suitable command for $PMTYPE"
;; ;;
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012-2019 Etersoft # Copyright (C) 2012-2020 Etersoft
# Copyright (C) 2012-2019 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012-2020 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by
...@@ -201,6 +201,9 @@ epm_install_names() ...@@ -201,6 +201,9 @@ epm_install_names()
xbps) xbps)
sudocmd xbps-install $@ sudocmd xbps-install $@
return ;; return ;;
appget|winget)
sudocmd $PMTYPE install $@
return ;;
*) *)
fatal "Have no suitable install command for $PMTYPE" fatal "Have no suitable install command for $PMTYPE"
;; ;;
...@@ -273,6 +276,9 @@ epm_ni_install_names() ...@@ -273,6 +276,9 @@ epm_ni_install_names()
xbps) xbps)
sudocmd xbps-install -y $@ sudocmd xbps-install -y $@
return ;; return ;;
appget|winget)
sudocmd $PMTYPE -s install $@
return ;;
homebrew) homebrew)
# FIXME: sudo and quote # FIXME: sudo and quote
SUDO='' __separate_sudocmd "brew install" "brew upgrade" $@ SUDO='' __separate_sudocmd "brew install" "brew upgrade" $@
...@@ -494,6 +500,9 @@ epm_print_install_command() ...@@ -494,6 +500,9 @@ epm_print_install_command()
xbps) xbps)
echo "xbps-install -y $*" echo "xbps-install -y $*"
;; ;;
appget|winget)
echo "$PMTYPE install -s $*"
;;
homebrew) homebrew)
# FIXME: sudo and quote # FIXME: sudo and quote
echo "brew install $*" echo "brew install $*"
...@@ -541,6 +550,9 @@ epm_print_install_names_command() ...@@ -541,6 +550,9 @@ epm_print_install_names_command()
nix) nix)
echo "nix-env --install $*" echo "nix-env --install $*"
return ;; return ;;
appget|winget)
echo "$PMTYPE install $*"
return ;;
*) *)
fatal "Have no suitable appropriate install command for $PMTYPE" fatal "Have no suitable appropriate install command for $PMTYPE"
;; ;;
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012, 2016, 2017 Etersoft # Copyright (C) 2012, 2016, 2017, 2020 Etersoft
# Copyright (C) 2012, 2016, 2017 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012, 2016, 2017, 2020 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by
...@@ -146,6 +146,13 @@ case $PMTYPE in ...@@ -146,6 +146,13 @@ case $PMTYPE in
guix) guix)
CMD="guix package -I" CMD="guix package -I"
;; ;;
appget)
CMD="appget list"
;;
winget)
info "Use appget instead of winget"
return 0
;;
xbps) xbps)
CMD="xbps-query -l" CMD="xbps-query -l"
showcmd $CMD showcmd $CMD
......
...@@ -52,6 +52,9 @@ epm_remove_low() ...@@ -52,6 +52,9 @@ epm_remove_low()
pacman) pacman)
sudocmd pacman -R $@ sudocmd pacman -R $@
return ;; return ;;
appget|winget)
sudocmd $PMTYPE uninstall $@
return ;;
slackpkg) slackpkg)
sudocmd /sbin/removepkg $@ sudocmd /sbin/removepkg $@
return ;; return ;;
...@@ -145,6 +148,9 @@ epm_remove_names() ...@@ -145,6 +148,9 @@ epm_remove_names()
xbps) xbps)
sudocmd xbps remove -R $@ sudocmd xbps remove -R $@
return ;; return ;;
appget|winget)
sudocmd $PMTYPE uninstall $@
return ;;
opkg) opkg)
# shellcheck disable=SC2046 # shellcheck disable=SC2046
sudocmd opkg $(subst_option force -force-depends) remove $@ sudocmd opkg $(subst_option force -force-depends) remove $@
...@@ -197,6 +203,9 @@ epm_remove_nonint() ...@@ -197,6 +203,9 @@ epm_remove_nonint()
opkg) opkg)
sudocmd opkg -force-defaults remove $@ sudocmd opkg -force-defaults remove $@
return ;; return ;;
appget|winget)
sudocmd $PMTYPE uninstall -s $@
return ;;
xbps) xbps)
sudocmd xbps remove -y $@ sudocmd xbps remove -y $@
return ;; return ;;
...@@ -240,6 +249,9 @@ epm_print_remove_command() ...@@ -240,6 +249,9 @@ epm_print_remove_command()
xbps) xbps)
echo "xbps remove -y $*" echo "xbps remove -y $*"
;; ;;
appget|winget)
echo $PMTYPE uninstall -s $*"
;;
*) *)
fatal "Have no suitable appropriate remove command for $PMTYPE" fatal "Have no suitable appropriate remove command for $PMTYPE"
;; ;;
......
...@@ -107,6 +107,9 @@ case $PMTYPE in ...@@ -107,6 +107,9 @@ case $PMTYPE in
npackd) npackd)
sudocmd npackdcl remove-repo --url="$@" sudocmd npackdcl remove-repo --url="$@"
;; ;;
winget)
sudocmd winget source remove "$@"
;;
slackpkg) slackpkg)
info "You need remove repo from /etc/slackpkg/mirrors" info "You need remove repo from /etc/slackpkg/mirrors"
;; ;;
......
...@@ -48,6 +48,10 @@ epm_repo() ...@@ -48,6 +48,10 @@ epm_repo()
load_helper epm-reposave load_helper epm-reposave
epm_reporestore "$@" epm_reporestore "$@"
;; ;;
reset)
load_helper epm-reposave
epm_reporeset "$@"
;;
add) # HELPCMD: add package repo (etersoft, autoimports, archive 2017/12/31); run with param to get list add) # HELPCMD: add package repo (etersoft, autoimports, archive 2017/12/31); run with param to get list
load_helper epm-addrepo load_helper epm-addrepo
epm_addrepo "$@" epm_addrepo "$@"
......
...@@ -70,6 +70,9 @@ case $PMTYPE in ...@@ -70,6 +70,9 @@ case $PMTYPE in
xbps) xbps)
docmd xbps-query -L docmd xbps-query -L
;; ;;
winget)
docmd winget source list
;;
pacman) pacman)
docmd grep -v -- "^#\|^$" /etc/pacman.conf docmd grep -v -- "^#\|^$" /etc/pacman.conf
;; ;;
......
...@@ -44,3 +44,16 @@ case $PMTYPE in ...@@ -44,3 +44,16 @@ case $PMTYPE in
esac esac
} }
epm_reporeset()
{
case $PMTYPE in
winget)
sudocmd winget source reset
;;
*)
fatal "Have no suitable command for $PMTYPE"
;;
esac
}
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012, 2013, 2016-2019 Etersoft # Copyright (C) 2012, 2013, 2016-2020 Etersoft
# Copyright (C) 2012, 2013, 2016-2019 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012, 2013, 2016-2020 Vitaly Lipatov <lav@etersoft.ru>
# #
# This program is free software: you can redistribute it and/or modify # 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 # it under the terms of the GNU Affero General Public License as published by
...@@ -112,6 +112,9 @@ case $PMTYPE in ...@@ -112,6 +112,9 @@ case $PMTYPE in
xbps) xbps)
CMD="xbps-query -s" CMD="xbps-query -s"
;; ;;
appget|winget)
CMD="$PMTYPE search"
;;
*) *)
fatal "Have no suitable search command for $PMTYPE" fatal "Have no suitable search command for $PMTYPE"
;; ;;
......
...@@ -533,7 +533,9 @@ case $DISTRNAME in ...@@ -533,7 +533,9 @@ case $DISTRNAME in
CMD="conary" CMD="conary"
;; ;;
Windows) Windows)
CMD="chocolatey" CMD="appget"
which $CMD 2>/dev/null >/dev/null || CMD="chocolatey"
which $CMD 2>/dev/null >/dev/null || CMD="winget"
;; ;;
MacOS) MacOS)
CMD="homebrew" CMD="homebrew"
......
...@@ -98,6 +98,9 @@ case $PMTYPE in ...@@ -98,6 +98,9 @@ case $PMTYPE in
xbps) xbps)
sudocmd xbps-install -S sudocmd xbps-install -S
;; ;;
winget)
sudocmd winget source update
;;
*) *)
fatal "Have no suitable update command for $PMTYPE" fatal "Have no suitable update command for $PMTYPE"
;; ;;
......
...@@ -118,6 +118,9 @@ epm_upgrade() ...@@ -118,6 +118,9 @@ epm_upgrade()
guix) guix)
CMD="guix package -u" CMD="guix package -u"
;; ;;
appget|winget)
CMD="$PMTYPE update-all"
;;
aptcyg) aptcyg)
# shellcheck disable=SC2046 # shellcheck disable=SC2046
docmd_foreach "epm install" $(short=1 epm packages) docmd_foreach "epm install" $(short=1 epm packages)
......
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