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