Commit 92051791 authored by Vitaly Lipatov's avatar Vitaly Lipatov

add eopkg package manager support (Solus system)

parent 59327f37
...@@ -182,13 +182,13 @@ check_command() ...@@ -182,13 +182,13 @@ check_command()
# HELPCMD: PART: Base commands: # HELPCMD: PART: Base commands:
case $1 in case $1 in
-i|install|add|i) # HELPCMD: install package(s) from remote repositories or from local file -i|install|add|i|it) # HELPCMD: install package(s) from remote repositories or from local file
epm_cmd=install epm_cmd=install
;; ;;
-e|-P|rm|del|remove|delete|uninstall|erase|purge|e) # HELPCMD: remove (delete) package(s) from the database and the system -e|-P|rm|del|remove|delete|uninstall|erase|purge|e) # HELPCMD: remove (delete) package(s) from the database and the system
epm_cmd=remove epm_cmd=remove
;; ;;
-s|search|s|find) # HELPCMD: search in remote package repositories -s|search|s|find|sr) # HELPCMD: search in remote package repositories
epm_cmd=search epm_cmd=search
;; ;;
-qp|qp|query_package) # HELPCMD: search in the list of installed packages -qp|qp|query_package) # HELPCMD: search in the list of installed packages
...@@ -211,7 +211,7 @@ check_command() ...@@ -211,7 +211,7 @@ check_command()
installed) # HELPCMD: check presence of package(s) (like -q with --quiet) installed) # HELPCMD: check presence of package(s) (like -q with --quiet)
epm_cmd=installed epm_cmd=installed
;; ;;
-sf|sf|filesearch) # HELPCMD: search in which package a file is included -sf|sf|filesearch|search-file) # HELPCMD: search in which package a file is included
epm_cmd=search_file epm_cmd=search_file
;; ;;
-ql|ql|filelist|get-files) # HELPCMD: print package file list -ql|ql|filelist|get-files) # HELPCMD: print package file list
...@@ -246,7 +246,7 @@ check_command() ...@@ -246,7 +246,7 @@ check_command()
conflicts) # HELPCMD: print package conflicts conflicts) # HELPCMD: print package conflicts
epm_cmd=conflicts epm_cmd=conflicts
;; ;;
-qa|qa|-l|list|ls|packages) # HELPCMD: print list of installed package(s) -qa|qa|-l|list|ls|packages|list-installed|li) # HELPCMD: print list of installed package(s)
epm_cmd=packages epm_cmd=packages
;; ;;
programs) # HELPCMD: print list of installed GUI program(s) (they have .desktop files) programs) # HELPCMD: print list of installed GUI program(s) (they have .desktop files)
...@@ -261,7 +261,7 @@ check_command() ...@@ -261,7 +261,7 @@ check_command()
;; ;;
# HELPCMD: PART: Repository control: # HELPCMD: PART: Repository control:
update) # HELPCMD: update remote package repository databases update|update-repo|ur) # HELPCMD: update remote package repository databases
epm_cmd=update epm_cmd=update
direct_args=1 direct_args=1
;; ;;
...@@ -269,7 +269,7 @@ check_command() ...@@ -269,7 +269,7 @@ check_command()
epm_cmd=addrepo epm_cmd=addrepo
direct_args=1 direct_args=1
;; ;;
repolist|sl|rl|listrepo|repo-list) # HELPCMD: print repo list repolist|sl|rl|listrepo|repo-list|list-repo|lr) # HELPCMD: print repo list
epm_cmd=repolist epm_cmd=repolist
direct_args=1 direct_args=1
;; ;;
...@@ -277,7 +277,7 @@ check_command() ...@@ -277,7 +277,7 @@ check_command()
epm_cmd=repofix epm_cmd=repofix
direct_args=1 direct_args=1
;; ;;
removerepo|rr) # HELPCMD: remove package repo (shortcut for epm repo remove) removerepo|remove-repo|rr) # HELPCMD: remove package repo (shortcut for epm repo remove)
epm_cmd=removerepo epm_cmd=removerepo
direct_args=1 direct_args=1
;; ;;
...@@ -307,7 +307,7 @@ check_command() ...@@ -307,7 +307,7 @@ check_command()
;; ;;
# HELPCMD: PART: Other commands: # HELPCMD: PART: Other commands:
clean) # HELPCMD: clean local package cache clean|delete-cache|dc) # HELPCMD: clean local package cache
epm_cmd=clean epm_cmd=clean
direct_args=1 direct_args=1
;; ;;
...@@ -324,10 +324,10 @@ check_command() ...@@ -324,10 +324,10 @@ check_command()
history) # HELPCMD: show a log of actions taken by the software management history) # HELPCMD: show a log of actions taken by the software management
epm_cmd=history epm_cmd=history
;; ;;
autoorphans|--orphans) # HELPCMD: remove all packages not from the repository autoorphans|--orphans|remove-orphans) # HELPCMD: remove all packages not from the repository
epm_cmd=autoorphans epm_cmd=autoorphans
;; ;;
upgrade|dist-upgrade) # HELPCMD: performs upgrades of package software distributions upgrade|up|dist-upgrade) # HELPCMD: performs upgrades of package software distributions
epm_cmd=upgrade epm_cmd=upgrade
;; ;;
Upgrade) # HELPCMD: force update package base, then run upgrade Upgrade) # HELPCMD: force update package base, then run upgrade
...@@ -337,7 +337,7 @@ check_command() ...@@ -337,7 +337,7 @@ check_command()
downgrade) # HELPCMD: downgrade [all] packages to the repo state downgrade) # HELPCMD: downgrade [all] packages to the repo state
epm_cmd=downgrade epm_cmd=downgrade
;; ;;
download) # HELPCMD: download package(s) file to the current dir download|fetch|fc) # HELPCMD: download package(s) file to the current dir
epm_cmd=download epm_cmd=download
;; ;;
# TODO: replace with install --simulate # TODO: replace with install --simulate
......
...@@ -108,6 +108,9 @@ case $PMTYPE in ...@@ -108,6 +108,9 @@ case $PMTYPE in
# clean-system removes non official packages # clean-system removes non official packages
sudocmd slackpkg clean-system sudocmd slackpkg clean-system
;; ;;
eopkg)
sudocmd eopkg remove-orphans
;;
#guix) #guix)
# sudocmd guix gc # sudocmd guix gc
# ;; # ;;
......
...@@ -61,6 +61,13 @@ check_pkg_integrity() ...@@ -61,6 +61,13 @@ check_pkg_integrity()
__epm_check_all_pkgs() __epm_check_all_pkgs()
{ {
case $PMTYPE in
eopkg)
sudocmd eopkg check
return
;;
esac
local j cl local j cl
#local play_installed="$(epm play --list-installed-packages)" #local play_installed="$(epm play --list-installed-packages)"
epm qa --short | xargs -n20 | while read cl ; do epm qa --short | xargs -n20 | while read cl ; do
...@@ -89,6 +96,9 @@ case $PMTYPE in ...@@ -89,6 +96,9 @@ case $PMTYPE in
assure_exists equery assure_exists equery
docmd equery check $@ docmd equery check $@
;; ;;
eopkg)
sudocmd eopkg check $@
;;
*) *)
fatal "Have no suitable command for $PMTYPE" fatal "Have no suitable command for $PMTYPE"
;; ;;
......
...@@ -77,6 +77,9 @@ case $PMTYPE in ...@@ -77,6 +77,9 @@ case $PMTYPE in
;; ;;
slackpkg) slackpkg)
;; ;;
eopkg)
sudocmd eopkg delete-cache
;;
pkgng) pkgng)
sudocmd pkg clean -a sudocmd pkg clean -a
;; ;;
......
...@@ -227,6 +227,9 @@ epm_download() ...@@ -227,6 +227,9 @@ epm_download()
opkg) opkg)
docmd opkg $* docmd opkg $*
;; ;;
eopkg)
docmd eopkg fetch $*
;;
homebrew) homebrew)
docmd brew fetch $* docmd brew fetch $*
;; ;;
......
...@@ -101,6 +101,10 @@ __epm_filelist_file() ...@@ -101,6 +101,10 @@ __epm_filelist_file()
assure_exists dpkg assure_exists dpkg
CMD="dpkg --contents" CMD="dpkg --contents"
;; ;;
eopkg)
assure_exists eopkg
CMD="eopkg --files info"
;;
*) *)
fatal "Have no suitable query command for $PMTYPE" fatal "Have no suitable query command for $PMTYPE"
;; ;;
...@@ -150,6 +154,10 @@ __epm_filelist_name() ...@@ -150,6 +154,10 @@ __epm_filelist_name()
opkg) opkg)
CMD="opkg files" CMD="opkg files"
;; ;;
eopkg)
docmd eopkg --files -s info $@ | grep "^/"
return
;;
xbps) xbps)
CMD="xbps-query -f" CMD="xbps-query -f"
;; ;;
......
...@@ -29,6 +29,9 @@ case $PMTYPE in ...@@ -29,6 +29,9 @@ case $PMTYPE in
dnf-rpm) dnf-rpm)
sudocmd dnf history sudocmd dnf history
;; ;;
eopkg)
sudocmd eopkg history
;;
zypper-rpm) zypper-rpm)
less /var/log/zypp/history less /var/log/zypp/history
;; ;;
......
...@@ -137,6 +137,9 @@ case $PMTYPE in ...@@ -137,6 +137,9 @@ case $PMTYPE in
winget) winget)
docmd winget show $pkg_names docmd winget show $pkg_names
;; ;;
eopkg)
docmd eopkg info $pkg_files $pkg_names
;;
appget) appget)
docmd appget view $pkg_names docmd appget view $pkg_names
;; ;;
......
...@@ -123,6 +123,9 @@ epm_install_names() ...@@ -123,6 +123,9 @@ epm_install_names()
mpkg) mpkg)
sudocmd mpkg install $@ sudocmd mpkg install $@
return ;; return ;;
eopkg)
sudocmd eopkg $(subst_option nodeps --ignore-dependency) install $@
return ;;
conary) conary)
sudocmd conary update $@ sudocmd conary update $@
return ;; return ;;
...@@ -227,6 +230,9 @@ epm_ni_install_names() ...@@ -227,6 +230,9 @@ epm_ni_install_names()
opkg) opkg)
sudocmd opkg -force-defaults install $@ sudocmd opkg -force-defaults install $@
return ;; return ;;
eopkg)
sudocmd eopkg --yes-all install $@
return ;;
nix) nix)
sudocmd nix-env --install $@ sudocmd nix-env --install $@
return ;; return ;;
...@@ -462,6 +468,9 @@ epm_install_files() ...@@ -462,6 +468,9 @@ epm_install_files()
android) android)
sudocmd pm install $files sudocmd pm install $files
return ;; return ;;
eopkg)
sudocmd eopkg install $files
return ;;
emerge) emerge)
load_helper epm-install-emerge load_helper epm-install-emerge
sudocmd epm_install_emerge $files sudocmd epm_install_emerge $files
...@@ -518,6 +527,9 @@ epm_print_install_command() ...@@ -518,6 +527,9 @@ epm_print_install_command()
opkg) opkg)
echo "opkg install $*" echo "opkg install $*"
;; ;;
eopkg)
echo "eopkg install $*"
;;
android) android)
echo "pm install $*" echo "pm install $*"
;; ;;
...@@ -584,6 +596,9 @@ epm_print_install_names_command() ...@@ -584,6 +596,9 @@ epm_print_install_names_command()
nix) nix)
echo "nix-env --install $*" echo "nix-env --install $*"
return ;; return ;;
eopkg)
echo "eopkg install $*"
return ;;
appget|winget) appget|winget)
echo "$PMTYPE install $*" echo "$PMTYPE install $*"
return ;; return ;;
......
...@@ -118,6 +118,9 @@ case $PMTYPE in ...@@ -118,6 +118,9 @@ case $PMTYPE in
conary) conary)
CMD="conary query" CMD="conary query"
;; ;;
eopkg)
CMD="eopkg list-installed"
;;
chocolatey) chocolatey)
CMD="chocolatey list" CMD="chocolatey list"
;; ;;
......
...@@ -235,6 +235,14 @@ __epm_query_name() ...@@ -235,6 +235,14 @@ __epm_query_name()
conary) conary)
CMD="conary query" CMD="conary query"
;; ;;
eopkg)
showcmd eopkg blame $1
local str
str="$(a= eopkg blame $1 | grep "^Name")"
[ -n "$str" ] || return 1
echo "$str" | sed -e "s|Name[[:space:]]*: \(.*\), version: \(.*\), release: \(.*\)|\1-\2-\3|"
return
;;
#homebrew) #homebrew)
# showcmd "brew info $1" # showcmd "brew info $1"
# local HBRESULT # local HBRESULT
...@@ -287,6 +295,14 @@ __epm_query_shortname() ...@@ -287,6 +295,14 @@ __epm_query_shortname()
conary) conary)
CMD="conary query" CMD="conary query"
;; ;;
eopkg)
showcmd eopkg blame $1
local str
str="$(a= eopkg blame $1 | grep "^Name")"
[ -n "$str" ] || return 1
echo "$str" | sed -e "s|Name[[:space:]]*: \(.*\), version: \(.*\), release: \(.*\)|\1|"
return
;;
homebrew) homebrew)
docmd brew info "$1" >/dev/null 2>/dev/null && echo "$1" && return docmd brew info "$1" >/dev/null 2>/dev/null && echo "$1" && return
return 1 return 1
......
...@@ -52,6 +52,9 @@ epm_reinstall_names() ...@@ -52,6 +52,9 @@ epm_reinstall_names()
opkg) opkg)
sudocmd opkg --force-reinstall install $@ sudocmd opkg --force-reinstall install $@
return ;; return ;;
eopkg)
sudocmd eopkg --reinstall install $@
return ;;
slackpkg) slackpkg)
sudocmd_foreach "/usr/sbin/slackpkg reinstall" $@ sudocmd_foreach "/usr/sbin/slackpkg reinstall" $@
return ;; return ;;
......
...@@ -66,6 +66,9 @@ epm_remove_low() ...@@ -66,6 +66,9 @@ epm_remove_low()
pacman) pacman)
sudocmd pacman -R $@ sudocmd pacman -R $@
return ;; return ;;
eopkg)
sudocmd eopkg $(subst_option nodeps --ignore-dependency) remove $@
return ;;
appget|winget) appget|winget)
sudocmd $PMTYPE uninstall $@ sudocmd $PMTYPE uninstall $@
return ;; return ;;
...@@ -131,6 +134,9 @@ epm_remove_names() ...@@ -131,6 +134,9 @@ epm_remove_names()
mpkg) mpkg)
sudocmd mpkg remove $@ sudocmd mpkg remove $@
return ;; return ;;
eopkg)
sudocmd eopkg $(subst_option nodeps --ignore-dependency) remove $@
return ;;
conary) conary)
sudocmd conary erase $@ sudocmd conary erase $@
return ;; return ;;
...@@ -219,6 +225,9 @@ epm_remove_nonint() ...@@ -219,6 +225,9 @@ epm_remove_nonint()
opkg) opkg)
sudocmd opkg -force-defaults remove $@ sudocmd opkg -force-defaults remove $@
return ;; return ;;
eopkg)
sudocmd eopkg $(subst_option nodeps --ignore-dependency) --yes-all remove $@
return ;;
appget|winget) appget|winget)
sudocmd $PMTYPE uninstall -s $@ sudocmd $PMTYPE uninstall -s $@
return ;; return ;;
...@@ -259,6 +268,9 @@ epm_print_remove_command() ...@@ -259,6 +268,9 @@ epm_print_remove_command()
opkg) opkg)
echo "opkg remove $*" echo "opkg remove $*"
;; ;;
eopkg)
echo "eopkg remove $*"
;;
aptcyg) aptcyg)
echo "apt-cyg remove $*" echo "apt-cyg remove $*"
;; ;;
......
...@@ -145,6 +145,9 @@ case $PMTYPE in ...@@ -145,6 +145,9 @@ case $PMTYPE in
winget) winget)
sudocmd winget source remove "$@" sudocmd winget source remove "$@"
;; ;;
eopkg)
sudocmd eopkg remove-repo "$@"
;;
slackpkg) slackpkg)
info "You need remove repo from /etc/slackpkg/mirrors" info "You need remove repo from /etc/slackpkg/mirrors"
;; ;;
......
...@@ -111,6 +111,9 @@ case $PMTYPE in ...@@ -111,6 +111,9 @@ case $PMTYPE in
winget) winget)
docmd winget source list docmd winget source list
;; ;;
eoget)
docmd eoget list-repo
;;
pacman) pacman)
docmd grep -v -- "^#\|^$" /etc/pacman.conf docmd grep -v -- "^#\|^$" /etc/pacman.conf
;; ;;
......
...@@ -51,6 +51,10 @@ epm_requires_files() ...@@ -51,6 +51,10 @@ epm_requires_files()
assure_exists dpkg >/dev/null assure_exists dpkg >/dev/null
a='' docmd dpkg -I $pkg_files | grep "^ *Depends:" | sed "s|^ *Depends:||g" a='' docmd dpkg -I $pkg_files | grep "^ *Depends:" | sed "s|^ *Depends:||g"
;; ;;
eopkg)
showcmd eopkg info $pkg_files
a= eopkg info $pkg_files | grep "^Dependencies" | head -n1 | sed -e "s|Dependencies[[:space:]]*: ||"
;;
*) *)
fatal "Have no suitable command for $PKGTYPE" fatal "Have no suitable command for $PKGTYPE"
;; ;;
...@@ -138,6 +142,11 @@ case $PMTYPE in ...@@ -138,6 +142,11 @@ case $PMTYPE in
opkg) opkg)
CMD="opkg depends" CMD="opkg depends"
;; ;;
eopkg)
showcmd eopkg info $pkg_names
a= eopkg info $pkg_names | grep "^Dependencies" | sed -e "s|Dependencies[[:space:]]*: ||"
return
;;
xbps) xbps)
CMD="xbps-query -x" CMD="xbps-query -x"
;; ;;
......
...@@ -56,6 +56,9 @@ case $PMTYPE in ...@@ -56,6 +56,9 @@ case $PMTYPE in
aura) aura)
CMD="aura -As --" CMD="aura -As --"
;; ;;
eopkg)
CMD="eopkg search --"
;;
yum-rpm) yum-rpm)
CMD="yum search --" CMD="yum search --"
;; ;;
......
...@@ -86,6 +86,9 @@ case $PMTYPE in ...@@ -86,6 +86,9 @@ case $PMTYPE in
opkg) opkg)
CMD="opkg -A search" CMD="opkg -A search"
;; ;;
eopkg)
CMD="eopkg search-file"
;;
xbps) xbps)
CMD="xbps-query -Ro" CMD="xbps-query -Ro"
;; ;;
......
...@@ -88,6 +88,9 @@ EOF ...@@ -88,6 +88,9 @@ EOF
urpm-rpm) urpm-rpm)
CMD="urpmi --test --auto" CMD="urpmi --test --auto"
;; ;;
eopkg)
CMD="eopkg --dry-run install"
;;
zypper-rpm) zypper-rpm)
if ! __use_zypper_dry_run >/dev/null ; then if ! __use_zypper_dry_run >/dev/null ; then
fatal "zypper is too old: does not support --dry-run" fatal "zypper is too old: does not support --dry-run"
......
...@@ -90,6 +90,9 @@ case $PMTYPE in ...@@ -90,6 +90,9 @@ case $PMTYPE in
opkg) opkg)
sudocmd opkg update sudocmd opkg update
;; ;;
eopkg)
sudocmd eopkg update-repo
;;
apk) apk)
sudocmd apk update sudocmd apk update
;; ;;
......
...@@ -59,6 +59,12 @@ epm_upgrade() ...@@ -59,6 +59,12 @@ epm_upgrade()
fi fi
fi fi
# Solus supports upgrade for a package (with all dependencies)
if [ -n "$1" ] && [ "$DISTRNAME" = "Solus" ] ; then
sudocmd eopkg upgrade "$@"
return
fi
info "Running command for upgrade packages" info "Running command for upgrade packages"
case $PMTYPE in case $PMTYPE in
...@@ -142,6 +148,9 @@ epm_upgrade() ...@@ -142,6 +148,9 @@ epm_upgrade()
opkg) opkg)
CMD="opkg upgrade" CMD="opkg upgrade"
;; ;;
eopkg)
CMD="eopkg upgrade"
;;
slackpkg) slackpkg)
CMD="/usr/sbin/slackpkg upgrade-all" CMD="/usr/sbin/slackpkg upgrade-all"
;; ;;
......
...@@ -80,6 +80,12 @@ case $PMTYPE in ...@@ -80,6 +80,12 @@ case $PMTYPE in
opkg) opkg)
CMD="opkg whatdepends" CMD="opkg whatdepends"
;; ;;
eopkg)
showcmd eopkg info $pkg
# eopkg info prints it only from repo info
a= eopkg info $pkg | grep "^Reverse Dependencies" | sed -e "s|Reverse Dependencies[[:space:]]*: ||" | grep -v "^$"
return
;;
xbps) xbps)
CMD="xbps-query -X" CMD="xbps-query -X"
;; ;;
......
NAME="Solus"
VERSION="4.3"
ID="solus"
VERSION_CODENAME=fortitude
VERSION_ID="4.3"
PRETTY_NAME="Solus 4.3 Fortitude"
ANSI_COLOR="1;34"
HOME_URL="https://getsol.us"
SUPPORT_URL="https://getsol.us/articles/contributing/getting-involved/en/"
BUG_REPORT_URL="https://dev.getsol.us/"
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