Изменено вычисление shortname

develop
Mike Hiretsky 10 years ago
parent 105978466b
commit cf4e8290fc

@ -462,14 +462,17 @@ class varsShare:
def getShortnameByMakeprofile(self,systemroot):
"""Get shortname by symlink of make.profile"""
makeprofile = path.join(systemroot,'etc/make.profile')
if path.exists(makeprofile):
link = os.readlink(makeprofile)
reMakeProfileLink = re.compile('/calculate/(desktop|server)/(%s)/'%
"|".join(self.dictLinuxName.keys()),re.S)
shortnameSearch = reMakeProfileLink.search(link)
if shortnameSearch:
return shortnameSearch.groups()[1]
for makeprofile in (path.join(systemroot,'etc/portage/make.profile'),
path.join(systemroot,'etc/make.profile')):
if path.exists(makeprofile):
link = os.readlink(makeprofile)
for pattern in ('/calculate/(?:desktop|server)/(%s)/',
'/distros/profiles/(%s)/'):
reMakeProfileLink = re.compile(pattern%
"|".join(self.dictLinuxName.keys()),re.S)
shortnameSearch = reMakeProfileLink.search(link)
if shortnameSearch:
return shortnameSearch.groups()[0]
return None
def getShortnameByIni(self,systemroot):

Loading…
Cancel
Save