From af1d3207dae68eb59f274883c114b6a2885424f0 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 17:02:24 +0100 Subject: move PKGDIR to /var/cache/packages and DISTDIR to /var/cache/distfiles (Debian model) --- conf/intel/portage/bashrc | 20 ++++++++------------ conf/intel/portage/global.conf/layout.conf | 4 ++-- 2 files changed, 10 insertions(+), 14 deletions(-) (limited to 'conf/intel') diff --git a/conf/intel/portage/bashrc b/conf/intel/portage/bashrc index a6f4f25..34c6248 100644 --- a/conf/intel/portage/bashrc +++ b/conf/intel/portage/bashrc @@ -1,25 +1,21 @@ cleancache() { # By default, binary mode portage downloads binary packages from repository and saves - # them in /usr/portage/packages. This saves bandwidth in case of reinstalls/downgrades, + # them in /var/cache/packages. This saves bandwidth in case of reinstalls/downgrades, # but will eat up lots of HDD space, possibly preventing further installs/upgrades. - # To address this issue, we check if /usr/portage/packages directory is on its own partition + # To address this issue, we check if /var/cache/packages directory is on its own partition # case in which we do nothing assuming that user gave it plenty space anyway. But if its - # not the case, and /usr/portage/packages is just a directory in the system / root hierarchy, + # not the case, and /var/cache/packages is just a directory in the system / root hierarchy, # then we make sure we remove downloaded binary packages after every installation. # This function hooks into the pkg_postinst() phase, after the package files are written # into the filesystem and registered into the database, and just removes the content of - # /usr/portage/packages directory (which is the binary package cache). + # /var/cache/packages directory (which is the binary package cache). - # In orther for this to work PORTDIR (/usr/portage) and PKGDIR(/usr/portage/packages) - # must be on the same filesystem, which is 99% the case. If they are on different - # filesystems, package cache is always saved, as mentioned above. - - export local PORTDIRDEV=$(find /usr/ports/gentoo -maxdepth 0 -printf "%D") - export local PKGDIRDEV=$(find /usr/ports/gentoo/packages -maxdepth 0 -printf "%D") - if [ $PORTDIRDEV = $PKGDIRDEV ]; then - rm -rf /usr/ports/gentoo/packages/"${CATEGORY}"/"${P}"*.tbz2 + export local PORTDIRDEV=$(find /var/cache -maxdepth 0 -printf "%D") + export local PKGDIRDEV=$(find /var/cache/packages -maxdepth 0 -printf "%D") + if [ $PORTDIRDEV = $PKGDIRDEV ] ; then + rm -rf /var/cache/packages/"${CATEGORY}"/"${P}"*.tbz2 fi } diff --git a/conf/intel/portage/global.conf/layout.conf b/conf/intel/portage/global.conf/layout.conf index a4d7b9a..82d8631 100644 --- a/conf/intel/portage/global.conf/layout.conf +++ b/conf/intel/portage/global.conf/layout.conf @@ -1,6 +1,6 @@ PORTDIR="/usr/ports/gentoo" -PKGDIR="${PORTDIR}/packages" -DISTDIR="${PORTDIR}/distfiles" +PKGDIR="/var/cache/packages" +DISTDIR="/var/cache/distfiles" INSTALL_MASK="/etc/systemd /usr/lib/systemd -- cgit v1.2.3