From 57406f3bc9d654abc974c542a73a8419fbd73e04 Mon Sep 17 00:00:00 2001 From: skullbocks Date: Mon, 8 Jun 2015 18:56:24 +0200 Subject: [PATCH] [modules/packages] Added support for Portage and Entropy --- CMakeModules/BoostPython3.cmake | 10 +++++----- src/modules/packages/main.py | 10 +++++++++- src/modules/packages/packages.conf | 2 ++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/CMakeModules/BoostPython3.cmake b/CMakeModules/BoostPython3.cmake index 71372bba3..d5387d469 100644 --- a/CMakeModules/BoostPython3.cmake +++ b/CMakeModules/BoostPython3.cmake @@ -8,7 +8,7 @@ # what FindBoost.cmake is looking for. It looks for a library named # "libboost_${component}.so". # -# On Gentoo instead, the >=dev-libs/boost-1.54 package provides boost library +# On Gentoo instead, the >=dev-libs/boost-1.54 package provides boost library # with a name like: # libboost_python-2.7.so # libboost_python-3.3.so @@ -16,9 +16,9 @@ # depending on what python's targets you selected during install # # find_boost_python3() tries to find the package with different component -# names. By default it tries "python3", "python-py$suffix" and -# "python-$dotsuffix", where suffix is based on the `python_version` argument. -# One can supply a custom component name by setting the +# names. By default it tries "python3", "python-py$suffix" and +# "python-$dotsuffix", where suffix is based on the `python_version` argument. +# One can supply a custom component name by setting the # `CALAMARES_BOOST_PYTHON3_COMPONENT` variable at CMake time. set( CALAMARES_BOOST_PYTHON3_COMPONENT python3 CACHE STRING @@ -40,7 +40,7 @@ macro( find_boost_python3 boost_version python_version found_var ) break() endif() endforeach() - # The following loop chage the searched name for Gentoo based distributions + # The following loop changes the searched name for Gentoo based distributions # turns "3.4.123abc" into "3.4" string( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\..*" "\\1.\\2" _fbp_python_short_version ${python_version} ) foreach( _fbp_name ${CALAMARES_BOOST_PYTHON3_COMPONENT} python-${_fbp_python_short_version} ) diff --git a/src/modules/packages/main.py b/src/modules/packages/main.py index 1d5673abe..72ab693b5 100644 --- a/src/modules/packages/main.py +++ b/src/modules/packages/main.py @@ -55,6 +55,10 @@ class PackageManager: elif self.backend == "pacman": pacman_flags = "-U" if from_local else "-Sy" check_chroot_call(["pacman", pacman_flags, "--noconfirm"] + pkgs) + elif self.backend == "portage": + check_chroot_call(["emerge", "-v"] + pkgs) + elif self.backend == "entropy": + check_chroot_call(["equo", "i"] + pkgs) def remove(self, pkgs): """ Removes packages. @@ -78,6 +82,10 @@ class PackageManager: check_chroot_call(["apt-get", "--purge", "-q", "-y", "autoremove"]) elif self.backend == "pacman": check_chroot_call(["pacman", "-Rs", "--noconfirm"] + pkgs) + elif self.backend == "portage": + check_chroot_call(["emerge", "-C"] + pkgs) + elif self.backend == "entropy": + check_chroot_call(["equo", "rm"] + pkgs) def run_operations(pkgman, entry): @@ -102,7 +110,7 @@ def run(): :return: """ backend = libcalamares.job.configuration.get("backend") - if backend not in ("packagekit", "zypp", "yum", "dnf", "urpmi", "apt", "pacman"): + if backend not in ("packagekit", "zypp", "yum", "dnf", "urpmi", "apt", "pacman", "portage", "entropy"): return ("Bad backend", "backend=\"{}\"".format(backend)) pkgman = PackageManager(backend) diff --git a/src/modules/packages/packages.conf b/src/modules/packages/packages.conf index d96267a88..e72763731 100644 --- a/src/modules/packages/packages.conf +++ b/src/modules/packages/packages.conf @@ -8,6 +8,8 @@ # - urpmi - Mandriva package manager # - apt - APT frontend for DEB and RPM # - pacman - Pacman +# - portage - Gentoo package manager +# - entropy - Sabayon package manager # backend: packagekit #