Перенос /usr/portage в /var/db/repos/gentoo

master 3.7.2.12
parent c0e1c32534
commit 148f26ba66

@ -25,7 +25,12 @@ depend() {
check_install_ability()
{
local pkg=$1
FEATURES="-getbinpkg" FETCHCOMMAND=false DISTDIR=/usr/portage/distfiles emerge -fq $pkg &>/dev/null
if [[ -d "/var/db/repos/gentoo" ]]
then
FEATURES="-getbinpkg" FETCHCOMMAND=false DISTDIR=/var/calculate/distfiles emerge -fq $pkg &>/dev/null
else
FEATURES="-getbinpkg" FETCHCOMMAND=false DISTDIR=/usr/portage/distfiles emerge -fq $pkg &>/dev/null
fi
}
is_already_install()
@ -41,7 +46,12 @@ install_pkg()
{
local pkg=$1
ebegin "Installing $pkg"
FEATURES="-getbinpkg" FETCHCOMMAND=false DISTDIR=/usr/portage/distfiles emerge $pkg &>/dev/null
if [[ -d "/var/db/repos/gentoo" ]]
then
FEATURES="-getbinpkg" FETCHCOMMAND=false DISTDIR=/var/calculate/distfiles emerge $pkg &>/dev/null
else
FEATURES="-getbinpkg" FETCHCOMMAND=false DISTDIR=/usr/portage/distfiles emerge $pkg &>/dev/null
fi
}
new_install_pkg()
@ -50,7 +60,12 @@ new_install_pkg()
local mask=$2
pkg=`echo $pkg | cut -d\/ -f2`
ebegin "Installing $pkg"
FETCHCOMMAND=false DISTDIR=/usr/portage/distfiles PKGDIR=/usr/portage/packages ${CL_VIDEO_INSTALL} $pkg $mask &>/dev/null
if [[ -d "/var/db/repos/gentoo" ]]
then
FETCHCOMMAND=false DISTDIR=/var/calculate/distfiles PKGDIR=/var/calculate/packages ${CL_VIDEO_INSTALL} $pkg $mask &>/dev/null
else
FETCHCOMMAND=false DISTDIR=/usr/portage/distfiles PKGDIR=/usr/portage/packages ${CL_VIDEO_INSTALL} $pkg $mask &>/dev/null
fi
eend $?
}
@ -211,8 +226,14 @@ start() {
if [[ $roottype == "hdd" ]]
then
/usr/sbin/cl-core --clear-localuser-cert
local distdir="/usr/portage/distfiles"
local pkgdir="/usr/portage/packages"
if [[ -d "/var/db/repos/gentoo" ]]
then
local distdir="/var/calculate/distfiles"
local pkgdir="/var/calculate/packages"
else
local distdir="/usr/portage/distfiles"
local pkgdir="/usr/portage/packages"
fi
local video_script="/usr/local/sbin/cl-video-install"
local cache_video="/var/cache/calculate/video_drivers"
[[ -d "${distdir}" ]] && [[ -n "`ls ${distdir}`" ]] && rm ${distdir}/*

@ -19,7 +19,12 @@ done </var/cache/calculate/video_drivers
if [[ -n $binary_packages ]]
then
ACCEPT_KEYWORDS="**" FEATURES="-getbinpkg" PKGDIR=/usr/portage/packages emerge -OK1 $binary_packages 2>&1 | cat &>>$LOG || exit 1
if [[ -d "/var/db/repos/gentoo" ]]
then
ACCEPT_KEYWORDS="**" FEATURES="-getbinpkg" PKGDIR=/var/calculate/packages emerge -OK1 $binary_packages 2>&1 | cat &>>$LOG || exit 1
else
ACCEPT_KEYWORDS="**" FEATURES="-getbinpkg" PKGDIR=/usr/portage/packages emerge -OK1 $binary_packages 2>&1 | cat &>>$LOG || exit 1
fi
fi
while read category pn pv package_dir pkgname pkgmask;
@ -31,7 +36,12 @@ do
cd $package_dir
ebuild=$category/$pn/$pn-${pv}.ebuild
[[ -f $ebuild ]] || git checkout $(dirname $ebuild) 2>&1 | cat &>>$LOG
DISTDIR=/usr/portage/distfiles ebuild $ebuild merge --skip-manifest | grep --color=never -P "^>>> [^/]" 2>&1 | cat &>>$LOG || exit 1
if [[ -d "/var/db/repos/gentoo" ]]
then
DISTDIR=/var/calculate/distfiles ebuild $ebuild merge --skip-manifest | grep --color=never -P "^>>> [^/]" 2>&1 | cat &>>$LOG || exit 1
else
DISTDIR=/usr/portage/distfiles ebuild $ebuild merge --skip-manifest | grep --color=never -P "^>>> [^/]" 2>&1 | cat &>>$LOG || exit 1
fi
WRITEPKG="$category/$pn"
fi
fi

@ -725,8 +725,12 @@ class VariableOsNvidiaMask(ReadonlyVariable):
chrootPath = image.getDirectory()
else:
chrootPath = self.Get("cl_chroot_path")
nvidiaeclass = path.join(chrootPath,
'usr/portage/eclass/nvidia-driver.eclass')
if os.path.isdir('/var/db/repos/gentoo'):
nvidiaeclass = path.join(chrootPath,
'var/db/repos/gentoo/eclass/nvidia-driver.eclass')
else:
nvidiaeclass = path.join(chrootPath,
'usr/portage/eclass/nvidia-driver.eclass')
if not os.access(nvidiaeclass, os.R_OK):
return ""
#TODO investigate

Loading…
Cancel
Save