Добавлена поддежка Gentoo профиля 17.1

legacy27 3.6.5.1
Mike Hiretsky 5 years ago
parent bed3dbc21b
commit ea1e153f6e

@ -22,6 +22,7 @@ import importlib
from calculate.lib.utils.portage import getInstalledAtom, RepositoryPath, \
searchProfile, RepositorySubstituting
from calculate.lib.cl_xml import xmlShare
from calculate.lib.utils.system import SystemPath
from functools import wraps
import types
import random
@ -3562,9 +3563,9 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction,
if self.objVar.Get('cl_chroot_path') == "/":
replace = current_version
else:
usrlib = SystemPath(self.objVar.Get('cl_chroot_path')).usrlib
module_path = os.path.join(
self.objVar.Get('cl_chroot_path'),
"usr/lib/python2.7/site-packages/calculate/%s/variables"
usrlib, "python2.7/site-packages/calculate/%s/variables"
% funArgv)
if os.path.exists(module_path):
pkg = "sys-apps/calculate-utils:3"

@ -20,6 +20,7 @@ import re
import math
from os import path
from calculate.lib.utils.dracut import Dracut
from calculate.lib.utils.system import SystemPath
import sys
import getpass
from types import StringType
@ -135,7 +136,8 @@ def getTupleVersion(ver):
def getInstalledVideo(prefix="/"):
"""Get installed video drivers"""
x11Drivers = path.join(prefix, "usr/lib/xorg/modules/drivers")
usrlib = SystemPath(prefix).usrlib
x11Drivers = "%s/xorg/modules/drivers" % usrlib
return map(lambda x: x[:-7],
filter(lambda x: x.endswith('_drv.so'),
listDirectory(x11Drivers)))

@ -34,6 +34,7 @@ from .files import (getProgPath, find, process, listDirectory, readFile,
FilesError, rsync_files, RsyncOptions,
removeDir, removeFileWithEmptyDirectory, FindFileType)
from .tools import SavableIterator, ignore
from .system import SystemPath
from collections import Mapping, defaultdict
from .common import getTupleVersion
from contextlib import closing
@ -1407,8 +1408,14 @@ def getlibpaths(prefix="/"):
else:
yield l
rval = list(read_ld_so_conf(path.join(prefix, "etc", "ld.so.conf")))
rval.append("/usr/lib")
rval.append("/lib")
systempath = SystemPath(prefix)
rval.append(systempath.lib)
rval.append(systempath.usrlib)
rval.append(systempath.clib)
rval.append(systempath.cusrlib)
return sorted(list(set([path.normpath(x) for x in rval if x])))
_re_req_arches = re.compile("(\w+:\s.*?)(?=\s\w+:|$)")

@ -15,6 +15,7 @@
# limitations under the License.
import sys
from calculate.lib.utils.files import grepFile
from calculate.lib.utils.tools import cached
from os import path
_ = lambda x: x
@ -22,6 +23,37 @@ from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('cl_lib3', sys.modules[__name__])
class X86(object):
def __init__(self, rootdn):
self.rootdn = rootdn
self.usrlib = path.join(rootdn, "usr/lib")
self.lib = path.join(rootdn, "lib")
self.cusrlib = path.join(rootdn, "usr/lib")
self.clib = path.join(rootdn, "lib")
self.libmodules = path.join(rootdn, "lib/modules")
self.pythonsite = path.join(rootdn, "usr/lib/python2.7/site-packages")
self.libopengl = path.join(rootdn, "usr/lib/opengl")
class Amd64(object):
def __init__(self, rootdn):
self.rootdn = rootdn
self.usrlib = path.join(rootdn, "usr/lib64")
self.lib = path.join(rootdn, "lib64")
self.cusrlib = path.join(rootdn, "usr/lib")
self.clib = path.join(rootdn, "lib")
self.libmodules = path.join(rootdn, "lib/modules")
self.pythonsite = path.join(rootdn, "usr/lib64/python2.7/site-packages")
self.libopengl = path.join(rootdn, "usr/lib64/opengl")
@cached(each_instance=True)
def SystemPath(rootdn):
lib64path = path.join(rootdn, "lib64")
libpath = path.join(rootdn, "lib")
if path.exists(lib64path):
return Amd64(rootdn)
else:
return X86(rootdn)
class SystemType(object):
"""

Loading…
Cancel
Save