Commit 6a217f2e authored by Vitaly Lipatov's avatar Vitaly Lipatov

add initial support for FreeBSD's pkgng

parent 1fdebf61
......@@ -79,6 +79,9 @@ case $PMTYPE in
guix)
sudocmd guix gc
;;
pkgng)
sudocmd pkg autoremove
;;
#zypper-rpm)
# sudocmd zypper clean
# ;;
......
......@@ -56,6 +56,9 @@ case $PMTYPE in
conary)
sudocmd conary verify
;;
pkgng)
sudocmd pkg check -d -a
;;
homebrew)
sudocmd brew doctor
;;
......
......@@ -47,6 +47,9 @@ case $PMTYPE in
;;
slackpkg)
;;
pkgng)
sudo pkg clean
;;
*)
fatal "Have no suitable command for $PMTYPE"
;;
......
......@@ -113,6 +113,9 @@ __epm_filelist_name()
assure_exists equery
CMD="equery files"
;;
pkgng)
CMD="pkg info -l"
;;
slackpkg)
is_installed $pkg_names || fatal "Query filelist for non installed packages does not realized"
docmd awk 'BEGIN{desk=1}{if(/^FILE LIST:$/){desk=0} else if (desk==0) {print}}' /var/log/packages/${pkg_filenames}* | less
......
......@@ -96,6 +96,9 @@ case $PMTYPE in
ipkg)
docmd ipkg info $pkg_names
;;
pkgng)
docmd pkg info $pkg_names
;;
homebrew)
docmd brew info $pkg_names
;;
......
......@@ -106,6 +106,9 @@ epm_install_names()
pkgsrc)
sudocmd pkg_add -r $@
return ;;
pkgng)
sudocmd pkg install $@
return ;;
emerge)
sudocmd emerge -uD $@
return ;;
......@@ -185,6 +188,9 @@ epm_ni_install_names()
pkgsrc)
sudocmd pkg_add -r $@
return ;;
pkgng)
sudocmd pkg install -y $@
return ;;
emerge)
sudocmd emerge -uD $@
return ;;
......@@ -299,6 +305,17 @@ epm_install_files()
pkgsrc)
sudocmd pkg_add $@
return ;;
pkgng)
local PKGTYPE="$(get_package_type $@)"
case "$PKGTYPE" in
tbz)
sudocmd pkg_add $@
;;
*)
sudocmd pkg add $@
;;
esac
return ;;
android)
sudocmd pm install $@
return ;;
......@@ -336,6 +353,9 @@ epm_print_install_command()
pkgsrc)
echo "pkg_add $@"
;;
pkgng)
echo "pkg add $@"
;;
emerge)
# need be placed in /usr/portage/packages/somewhere
echo "emerge --usepkg $@"
......
......@@ -59,6 +59,17 @@ case $PMTYPE in
;;
pkgsrc)
CMD="pkg_info"
docmd $CMD | sed -e "s| .*||g"
return
;;
pkgng)
CMD="pkg info -E $pkg_filenames"
if [ -n "$short" ] ; then
docmd $CMD | sed -e "s| .*||g" | sed -e "s|-[0-9].*||g"
else
docmd $CMD | sed -e "s| .*||g"
fi
return
;;
pacman)
CMD="pacman -Qs $pkg_filenames"
......
......@@ -72,6 +72,9 @@ case $PMTYPE in
# yum-rpm)
# CMD="yum deplist"
# ;;
pkgng)
CMD="pkg info -b"
;;
apt-dpkg)
# FIXME: need fix for a few names case
if is_installed $pkg_names ; then
......
......@@ -146,8 +146,13 @@ __epm_query_name()
warning "fix query"
return 1
;;
# TODO: need to print name if exists
#pkgng)
# CMD="pkg info -e"
# ;;
# Note: slackpkg info pkgname
*)
# default slow workaround
_query_via_packages_list $@
return
;;
......
......@@ -86,6 +86,9 @@ __do_query()
pacman)
CMD="pacman -Qo"
;;
pkgng)
CMD="pkg which"
;;
conary)
CMD="conary query --path"
;;
......
......@@ -33,6 +33,9 @@ epm_remove_low()
pkgsrc)
sudocmd pkg_delete -r $@
return ;;
pkgng)
sudocmd pkg delete -R $@
return ;;
emerge)
sudocmd emerge --unmerge $@
return ;;
......@@ -69,6 +72,9 @@ epm_remove_names()
pkgsrc) # without dependencies
sudocmd pkg_delete $@
return ;;
pkgng)
sudocmd pkg delete -R $@
return ;;
emerge)
#sudocmd emerge --unmerge $@
sudocmd emerge -aC $@
......@@ -149,6 +155,9 @@ epm_remove_nonint()
slackpkg)
sudocmd /usr/sbin/slackpkg -batch=on -default_answer=yes remove $@
return ;;
pkgng)
sudocmd pkg delete -y -R $@
return ;;
ipkg)
sudocmd ipkg -force-defaults remove $@
return ;;
......@@ -168,6 +177,9 @@ epm_print_remove_command()
pkgsrc)
echo "pkg_delete -r $@"
;;
pkgng)
echo "pkg delete -R $@"
;;
pacman)
echo "pacman -R $@"
;;
......
......@@ -82,6 +82,10 @@ case $PMTYPE in
assure_exists equery
CMD="equery depgraph"
;;
pkgng)
#CMD="pkg rquery '%dn-%dv'"
CMD="pkg info -d"
;;
*)
fatal "Have no suitable command for $PMTYPE"
;;
......
......@@ -40,6 +40,9 @@ case $PMTYPE in
pkgsrc)
CMD="pkg_info -x --"
;;
pkgng)
CMD="pkg search -i --"
;;
emerge)
CMD="emerge --search --"
;;
......
......@@ -306,6 +306,14 @@ get_package_type()
echo "rpm"
return
;;
*.txz)
echo "txz"
return
;;
*.tbz)
echo "tbz"
return
;;
*)
#fatal "Don't know type of $1"
# return package name for info
......@@ -361,6 +369,7 @@ case $DISTRNAME in
;;
FreeBSD|NetBSD|OpenBSD|Solaris)
CMD="pkgsrc"
which pkg 2>/dev/null >/dev/null && CMD=pkgng
;;
Gentoo)
CMD="emerge"
......
......@@ -69,6 +69,10 @@ case $PMTYPE in
ipkg)
sudocmd ipkg update
;;
pkgsrc)
# portsnap extract for the first time?
sudocmd portsnap fetch update
;;
*)
fatal "Have no suitable update command for $PMTYPE"
;;
......
......@@ -66,6 +66,9 @@ epm_upgrade()
pkgsrc)
CMD="freebsd-update fetch install"
;;
pkgng)
CMD="pkg upgrade"
;;
chocolatey)
CMD="chocolatey update all"
;;
......
......@@ -40,6 +40,9 @@ case $PMTYPE in
assure_exists equery
CMD="equery depends -a"
;;
pkgng)
CMD="pkg info -r"
;;
*)
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