Commit bcb434ab authored by Vitaly Lipatov's avatar Vitaly Lipatov

add Void Linux initial support

parent 66d8f76d
#!/bin/sh #!/bin/sh
# Author: Vitaly Lipatov <lav@etersoft.ru> # Author: Vitaly Lipatov <lav@etersoft.ru>
# 2007, 2009, 2010, 2012 (c) Etersoft # 2007, 2009, 2010, 2012, 2016 (c) Etersoft
# 2007 Public domain # 2007-2016 Public domain
# Detect the distro and version # Detect the distro and version
# Welcome to send updates! # Welcome to send updates!
...@@ -32,6 +32,7 @@ rpmvendor() ...@@ -32,6 +32,7 @@ rpmvendor()
[ "$DISTRIB_ID" = "AstraLinux" ] && echo "astra" && return [ "$DISTRIB_ID" = "AstraLinux" ] && echo "astra" && return
[ "$DISTRIB_ID" = "LinuxXP" ] && echo "lxp" && return [ "$DISTRIB_ID" = "LinuxXP" ] && echo "lxp" && return
[ "$DISTRIB_ID" = "TinyCoreLinux" ] && echo "tcl" && return [ "$DISTRIB_ID" = "TinyCoreLinux" ] && echo "tcl" && return
[ "$DISTRIB_ID" = "VoidLinux" ] && echo "void" && return
echo "$DISTRIB_ID" | tr "[A-Z]" "[a-z]" echo "$DISTRIB_ID" | tr "[A-Z]" "[a-z]"
} }
...@@ -55,6 +56,7 @@ pkgtype() ...@@ -55,6 +56,7 @@ pkgtype()
android) echo "apk" ;; android) echo "apk" ;;
alpine) echo "apk" ;; alpine) echo "apk" ;;
tinycorelinux) echo "tcz" ;; tinycorelinux) echo "tcz" ;;
voidlinux) echo "xbps" ;;
cygwin) echo "tar.xz" ;; cygwin) echo "tar.xz" ;;
debian|ubuntu|mint|runtu|mcst|astra) echo "deb" ;; debian|ubuntu|mint|runtu|mcst|astra) echo "deb" ;;
alt|asplinux|suse|mandriva|rosa|mandrake|pclinux|sled|sles) alt|asplinux|suse|mandriva|rosa|mandrake|pclinux|sled|sles)
...@@ -147,6 +149,11 @@ elif distro os-release && which tce-ab 2>/dev/null >/dev/null ; then ...@@ -147,6 +149,11 @@ elif distro os-release && which tce-ab 2>/dev/null >/dev/null ; then
DISTRIB_ID="TinyCoreLinux" DISTRIB_ID="TinyCoreLinux"
DISTRIB_RELEASE="$VERSION_ID" DISTRIB_RELEASE="$VERSION_ID"
elif distro os-release && which xbps-query 2>/dev/null >/dev/null ; then
. $ROOTDIR/etc/os-release
DISTRIB_ID="VoidLinux"
DISTRIB_RELEASE="Live"
elif distro arch-release ; then elif distro arch-release ; then
DISTRIB_ID="ArchLinux" DISTRIB_ID="ArchLinux"
DISTRIB_RELEASE="2010" DISTRIB_RELEASE="2010"
...@@ -333,7 +340,7 @@ case $1 in ...@@ -333,7 +340,7 @@ case $1 in
exit 0 exit 0
;; ;;
-V) -V)
echo "20120519" echo "20160822"
exit 0 exit 0
;; ;;
*) *)
......
...@@ -90,6 +90,9 @@ case $PMTYPE in ...@@ -90,6 +90,9 @@ case $PMTYPE in
local PKGLIST=$(zypper packages --orphaned | tail -n +5 | cut -d \| -f 3 | sort -u) local PKGLIST=$(zypper packages --orphaned | tail -n +5 | cut -d \| -f 3 | sort -u)
sudocmd zypper remove --clean-deps $PKGLIST sudocmd zypper remove --clean-deps $PKGLIST
;; ;;
xbps)
CMD="xbps-remove -o"
;;
*) *)
fatal "Have no suitable command for $PMTYPE" fatal "Have no suitable command for $PMTYPE"
;; ;;
......
...@@ -127,6 +127,9 @@ case $PMTYPE in ...@@ -127,6 +127,9 @@ case $PMTYPE in
local PKGLIST=$(zypper packages --unneeded | tail -n +5 | cut -d \| -f 3 | sort -u) local PKGLIST=$(zypper packages --unneeded | tail -n +5 | cut -d \| -f 3 | sort -u)
sudocmd zypper remove --clean-deps $PKGLIST sudocmd zypper remove --clean-deps $PKGLIST
;; ;;
xbps)
CMD="xbps-remove -O"
;;
*) *)
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
pkgng) pkgng)
sudocmd pkg clean -a sudocmd pkg clean -a
;; ;;
xbps)
sudocmd xbps-remove -O
;;
*) *)
fatal "Have no suitable command for $PMTYPE" fatal "Have no suitable command for $PMTYPE"
;; ;;
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012-2015 Etersoft # Copyright (C) 2012-2016 Etersoft
# Copyright (C) 2012-2015 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012-2016 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
...@@ -123,6 +123,9 @@ __epm_filelist_name() ...@@ -123,6 +123,9 @@ __epm_filelist_name()
pkgng) pkgng)
CMD="pkg info -l" CMD="pkg info -l"
;; ;;
xbps)
CMD="xbps-query -f"
;;
aptcyg) aptcyg)
docmd apt-cyg listfiles $@ | sed -e "s|^|/|g" docmd apt-cyg listfiles $@ | sed -e "s|^|/|g"
return return
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012,2014 Etersoft # Copyright (C) 2012, 2014, 2016 Etersoft
# Copyright (C) 2012,2014 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012, 2014, 2016 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
...@@ -103,6 +103,9 @@ case $PMTYPE in ...@@ -103,6 +103,9 @@ case $PMTYPE in
pkgng) pkgng)
docmd pkg info $pkg_names docmd pkg info $pkg_names
;; ;;
xbps)
docmd xbps-query --show $pkg_names
;;
homebrew) homebrew)
docmd brew info $pkg_names docmd brew info $pkg_names
;; ;;
......
...@@ -170,6 +170,9 @@ epm_install_names() ...@@ -170,6 +170,9 @@ epm_install_names()
aptcyg) aptcyg)
sudocmd apt-cyg install $@ sudocmd apt-cyg install $@
return ;; return ;;
xbps)
sudocmd xbps-install $@
return ;;
*) *)
fatal "Have no suitable install command for $PMTYPE" fatal "Have no suitable install command for $PMTYPE"
;; ;;
...@@ -235,6 +238,9 @@ epm_ni_install_names() ...@@ -235,6 +238,9 @@ epm_ni_install_names()
tce) tce)
sudocmd tce-load -wi $@ sudocmd tce-load -wi $@
return ;; return ;;
xbps)
sudocmd xbps-install -y $@
return ;;
#android) #android)
# sudocmd pm install $@ # sudocmd pm install $@
# return ;; # return ;;
...@@ -475,6 +481,10 @@ epm_print_install_command() ...@@ -475,6 +481,10 @@ epm_print_install_command()
tce) tce)
echo "tce-load -wi $@" echo "tce-load -wi $@"
;; ;;
xbps)
echo "xbps-install -y $@"
;;
*) *)
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 Etersoft # Copyright (C) 2012, 2016 Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012, 2016 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
...@@ -131,6 +131,9 @@ case $PMTYPE in ...@@ -131,6 +131,9 @@ case $PMTYPE in
guix) guix)
CMD="guix package -I" CMD="guix package -I"
;; ;;
xbps)
CMD="xbps-query -l"
;;
android) android)
CMD="pm list packages" CMD="pm list packages"
docmd $CMD | sed -e "s|^package:||g" docmd $CMD | sed -e "s|^package:||g"
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2009, 2012 Etersoft # Copyright (C) 2009, 2012, 2016 Etersoft
# Copyright (C) 2009, 2012 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2009, 2012, 2016 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
...@@ -98,6 +98,10 @@ __do_query() ...@@ -98,6 +98,10 @@ __do_query()
ipkg) ipkg)
CMD="ipkg files" CMD="ipkg files"
;; ;;
xbps)
# FIXME: maybe it is search file?
CMD="xbps-query -Ro"
;;
aptcyg) aptcyg)
#CMD="apt-cyg packageof" #CMD="apt-cyg packageof"
# do not realized locally # do not realized locally
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012-2014 Etersoft # Copyright (C) 2012-2014, 2016 Etersoft
# Copyright (C) 2012-2014 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012-2014, 2016 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
...@@ -128,6 +128,9 @@ epm_remove_names() ...@@ -128,6 +128,9 @@ epm_remove_names()
aptcyg) aptcyg)
sudocmd apt-cyg remove $@ sudocmd apt-cyg remove $@
return ;; return ;;
xbps)
sudocmd xbps remove -R $@
return ;;
ipkg) ipkg)
sudocmd ipkg $(subst_option force -force-depends) remove $@ sudocmd ipkg $(subst_option force -force-depends) remove $@
return ;; return ;;
...@@ -171,6 +174,9 @@ epm_remove_nonint() ...@@ -171,6 +174,9 @@ epm_remove_nonint()
ipkg) ipkg)
sudocmd ipkg -force-defaults remove $@ sudocmd ipkg -force-defaults remove $@
return ;; return ;;
xbps)
sudocmd xbps remove -y $@
return ;;
esac esac
return 5 return 5
} }
...@@ -205,6 +211,9 @@ epm_print_remove_command() ...@@ -205,6 +211,9 @@ epm_print_remove_command()
aptcyg) aptcyg)
echo "apt-cyg remove $@" echo "apt-cyg remove $@"
;; ;;
xbps)
echo "xbps remove -y $@"
;;
*) *)
fatal "Have no suitable appropriate remove command for $PMTYPE" fatal "Have no suitable appropriate remove command for $PMTYPE"
;; ;;
......
...@@ -84,14 +84,18 @@ case $PMTYPE in ...@@ -84,14 +84,18 @@ case $PMTYPE in
__fix_apt_sources_list /etc/apt/sources.list __fix_apt_sources_list /etc/apt/sources.list
__fix_apt_sources_list /etc/apt/sources.list.d/*.list __fix_apt_sources_list /etc/apt/sources.list.d/*.list
docmd apt-repo list docmd apt-repo list
# FIXME: what the best place?
# rebuild rpm database # rebuild rpm database
#sudocmd rm -fv /var/lib/rpm/__db* #sudocmd rm -fv /var/lib/rpm/__db*
#sudocmd rpm --rebuilddb #sudocmd rpm --rebuilddb
;; ;;
yum-rpm|dnf-rpm) yum-rpm|dnf-rpm)
sudocmd rm -fv /var/lib/rpm/__db* # FIXME: what the best place?
sudocmd rpm --rebuilddb #sudocmd rm -fv /var/lib/rpm/__db*
#sudocmd rpm --rebuilddb
;;
xbps)
sudocmd xbps-pkgdb -a
;; ;;
*) *)
fatal "Have no suitable command for $PMTYPE" fatal "Have no suitable command for $PMTYPE"
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012 Etersoft # Copyright (C) 2012, 2016 Etersoft
# Copyright (C) 2012 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012, 2016 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
...@@ -58,6 +58,9 @@ case $PMTYPE in ...@@ -58,6 +58,9 @@ case $PMTYPE in
docmd eselect profile list docmd eselect profile list
docmd layman -L docmd layman -L
;; ;;
xbps)
docmd xbps-query -L
;;
pacman) pacman)
docmd grep -v -- "^#\|^$" /etc/pacman.conf docmd grep -v -- "^#\|^$" /etc/pacman.conf
;; ;;
......
...@@ -105,6 +105,9 @@ case $PMTYPE in ...@@ -105,6 +105,9 @@ case $PMTYPE in
#CMD="pkg rquery '%dn-%dv'" #CMD="pkg rquery '%dn-%dv'"
CMD="pkg info -d" CMD="pkg info -d"
;; ;;
xbps)
CMD="xbps-query -x"
;;
aptcyg) aptcyg)
#CMD="apt-cyg depends" #CMD="apt-cyg depends"
# print show version # print show version
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012,2013 Etersoft # Copyright (C) 2012, 2013, 2016 Etersoft
# Copyright (C) 2012,2013 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012, 2013, 2016 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
...@@ -97,6 +97,9 @@ case $PMTYPE in ...@@ -97,6 +97,9 @@ case $PMTYPE in
aptcyg) aptcyg)
CMD="apt-cyg searchall" CMD="apt-cyg searchall"
;; ;;
xbps)
CMD="xbps-query -s"
;;
*) *)
fatal "Have no suitable search command for $PMTYPE" fatal "Have no suitable search command for $PMTYPE"
;; ;;
......
...@@ -424,6 +424,8 @@ if [ -n "$FORCEPM" ] ; then ...@@ -424,6 +424,8 @@ if [ -n "$FORCEPM" ] ; then
return return
fi fi
# TODO: move it in distr_vendor?
# FIXME: some problems with multibased distros (Server Edition on CentOS and Desktop Edition on Ubuntu)
case $DISTRNAME in case $DISTRNAME in
ALTLinux) ALTLinux)
CMD="apt-rpm" CMD="apt-rpm"
...@@ -487,6 +489,9 @@ case $DISTRNAME in ...@@ -487,6 +489,9 @@ case $DISTRNAME in
TinyCoreLinux) TinyCoreLinux)
CMD="tce" CMD="tce"
;; ;;
VoidLinux)
CMD="xbps"
;;
*) *)
fatal "Have no suitable DISTRNAME $DISTRNAME" fatal "Have no suitable DISTRNAME $DISTRNAME"
;; ;;
......
#!/bin/sh #!/bin/sh
# #
# Copyright (C) 2012,2014 Etersoft # Copyright (C) 2012, 2014, 2016 Etersoft
# Copyright (C) 2012,2014 Vitaly Lipatov <lav@etersoft.ru> # Copyright (C) 2012, 2014, 2016 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
...@@ -90,6 +90,9 @@ case $PMTYPE in ...@@ -90,6 +90,9 @@ case $PMTYPE in
aptcyg) aptcyg)
sudocmd apt-cyg update sudocmd apt-cyg update
;; ;;
xbps)
sudocmd xbps-install -S
;;
*) *)
fatal "Have no suitable update command for $PMTYPE" fatal "Have no suitable update command for $PMTYPE"
;; ;;
......
...@@ -97,6 +97,9 @@ epm_upgrade() ...@@ -97,6 +97,9 @@ epm_upgrade()
docmd_foreach "epm install" $(short=1 epm packages) docmd_foreach "epm install" $(short=1 epm packages)
return return
;; ;;
xbps)
CMD="xbps-install -Su"
;;
*) *)
fatal "Have no suitable command for $PMTYPE" fatal "Have no suitable command for $PMTYPE"
;; ;;
......
...@@ -56,6 +56,9 @@ case $PMTYPE in ...@@ -56,6 +56,9 @@ case $PMTYPE in
aptcyg) aptcyg)
CMD="apt-cyg rdepends" CMD="apt-cyg rdepends"
;; ;;
xbps)
CMD="xbps-query -X"
;;
*) *)
fatal "Have no suitable command for $PMTYPE" fatal "Have no suitable command for $PMTYPE"
;; ;;
......
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