Добавлена поддеркжа virtio устройств для установщика

atratsevskiy
Mike Khiretskiy 10 years ago
parent 93793e2d30
commit 08d9eee5ba

@ -0,0 +1,43 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
PYTHON_COMPAT=(python2_7)
inherit distutils-r1 eutils
SRC_URI="ftp://ftp.calculate.ru/pub/calculate/calculate3/${PN}/${P}.tar.bz2
http://mirror.yandex.ru/calculate/calculate3/${PN}/${P}.tar.bz2"
DESCRIPTION="The program of installation Calculate Linux"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="x86 amd64"
IUSE="pxe minimal"
DEPEND="~sys-apps/calculate-core-3.2.3
!<sys-apps/calculate-install-2.2.29
app-portage/layman
>=virtual/udev-197
!app-misc/livecd-tools
sys-apps/iproute2[-minimal]
!minimal? ( sys-boot/grub
sys-apps/gptfdisk
>=sys-apps/util-linux-2.19.1
sys-fs/dosfstools
sys-fs/squashfs-tools
sys-block/parted )
pxe? ( sys-apps/calculate-server
net-ftp/tftp-hpa
net-misc/dhcp
net-fs/nfs-utils )"
src_unpack() {
unpack "${A}"
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-install-3.2.3-r5.patch"
}

@ -0,0 +1,64 @@
diff --git pym/install/migrate_users.py pym/install/migrate_users.py
index d00a5c5..f862eb2 100644
--- pym/install/migrate_users.py
+++ pym/install/migrate_users.py
@@ -401,11 +401,11 @@ class migrate:
notWrite = lambda x: not os.access(x, os.W_OK)
filesNotRead = filter(notRead,checkThisFiles)
if filesNotRead:
- raise MigrationError(_("Failed to read files") + ": " +\
+ raise MigrationError(_("Failed to read files") + _(": ") +
", ".join(filesNotRead))
filesNotWrite = filter(notWrite,checkNewFiles)
if filesNotWrite:
- raise MigrationError(_("Failed to write to files") + ": " +\
+ raise MigrationError(_("Failed to write to files") + _(": ") +
", ".join(filesNotWrite))
# Check permissions backup files
checkNewBackupFiles = map(lambda x:pathJoin(self.prefixNewSystem,x+"-"),
@@ -415,7 +415,7 @@ class migrate:
not os.access(os.path.dirname(x), os.W_OK))
filesNotWrite = filter(notWriteBackup, checkNewBackupFiles)
if filesNotWrite:
- raise MigrationError(_("Failed to write to files") + ": " +\
+ raise MigrationError(_("Failed to write to files") + _(": ") +
", ".join(filesNotWrite))
return True
diff --git pym/install/variables/disk.py pym/install/variables/disk.py
index 17b0e2c..d07dcd8 100644
--- pym/install/variables/disk.py
+++ pym/install/variables/disk.py
@@ -125,7 +125,8 @@ class VariableOsDeviceDev(ReadonlyVariable,DeviceHelper):
def _getDiskName(devpath):
"""Get devname only for by udevadm that devpath is device (disk)"""
prop = getUdevDeviceInfo(devpath)
- if prop.get("ID_TYPE","")=="disk" and \
+ if (prop.get("ID_TYPE","")=="disk" or
+ path.exists(path.join(devpath,"device"))) and \
prop.get("DEVTYPE","")=="disk":
return prop.get('DEVNAME','')
diff --git pym/install/wsdl_install.py pym/install/wsdl_install.py
index 1c117be..cf2d1ea 100644
--- pym/install/wsdl_install.py
+++ pym/install/wsdl_install.py
@@ -137,7 +137,8 @@ class Wsdl(WsdlBase):
'method_name':"install_pxe",
'category':__("Installation"),
'title':__("PXE Install"),
- 'image':'network-server,preferences-desktop-remote-desktop',
+ 'image':('gnome-network-properties,network-server,'
+ 'preferences-desktop-remote-desktop'),
'command':'cl-install-pxe',
'gui':True,
'rights':['installpxe'],
@@ -187,7 +188,7 @@ class Wsdl(WsdlBase):
'method_name':"setup_network",
'category':__("Configuration"),
'title':__("Network"),
- 'image':'gnome-network-properties,'
+ 'image':'network-workgroup,'
'network-idle,preferences-system-network',
'command':'cl-setup-network',
'gui':True,

@ -0,0 +1,36 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
PYTHON_COMPAT=(python2_7)
inherit distutils-r1 eutils
SRC_URI="ftp://ftp.calculate.ru/pub/calculate/calculate3/${PN}/${P}.tar.bz2
http://mirror.yandex.ru/calculate/calculate3/${PN}/${P}.tar.bz2"
DESCRIPTION="The library for Calculate 3"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="x86 amd64"
IUSE="minimal"
DEPEND="!minimal? ( dev-python/py-smbpasswd )
>=dev-python/pyxml-0.8
sys-apps/iproute2
sys-apps/pciutils
dev-python/progressbar
sys-fs/lvm2
sys-fs/mdadm
dev-python/pyinotify
sys-apps/file[python]"
RDEPEND="${DEPEND}"
src_unpack() {
unpack "${A}"
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-lib-3.2.3-r6.patch"
}

@ -0,0 +1,648 @@
diff --git pym/calculate/lib/cl_template.py pym/calculate/lib/cl_template.py
index a0f773f..fb62bf7 100644
--- pym/calculate/lib/cl_template.py
+++ pym/calculate/lib/cl_template.py
@@ -610,9 +610,9 @@ class fileHeader(_terms):
if term in i:
foundTerm = True
errorMsg = _("Incorrect template") +\
- ": "+ templateName +"\n"+\
+ _(": ") + templateName +"\n"+\
_("template header not valid")+\
- ": "+ i
+ _(": ") + i
if function:
rezTerm = self._equalTerm(i,
errorMsg,
@@ -771,9 +771,10 @@ class dirHeader(_terms):
for term in self.terms:
if term in i:
foundTerm = True
- errorMsg = _("Incorrect template") +\
- ": "+ templateName +"\n"+\
- _("template header not valid")+ ": "+ i
+ errorMsg = (_("Incorrect template") +
+ _(": ") + templateName +"\n" +
+ _("template header not valid")+ _(": ")
+ + i)
if function:
rezTerm = self._equalTerm(i, errorMsg,
function)
@@ -3221,9 +3222,11 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
re_resol = re.compile("^(\d+)x(\d+)$")
resol = re_resol.match(resol)
if not resol:
- self.raiseErrTemplate(_("first parameter must be resolution"))
+ self.raiseErrTemplate(
+ _("the first parameter must be the resolution"))
re_resol = re.compile(".*?(\d+)x(\d+).*")
+ wpath = pathJoin(self._baseDir, wpath)
res = map(lambda x:(int(x.group(1)),int(x.group(2)),x.group()),
filter(None,
map(re_resol.search,
@@ -3358,10 +3361,13 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
for term in terms:
if term.startswith('"') and term.endswith('"'):
replTerms = [(r"\'", "'"), (r'\"', '"'), (r'\n', '\n'),
- (r'\r', '\r'), (r'\t', '\t'), (r"\\", "\\")]
+ (r'\r', '\r'),
+ (r'\t', '\t'), (r"\\", "\\")]
textArgv = term[1:-1]
for replTerm in replTerms:
textArgv = textArgv.replace(*replTerm)
+ textArgv = re.sub(r'\\x([0-9a-fA-F]{2})',
+ lambda x:chr(int(x.group(1),16)),textArgv)
listArgv.append(textArgv)
elif term.startswith("'") and term.endswith("'"):
listArgv.append(term[1:-1])
@@ -4567,7 +4573,7 @@ gettext -d cl_template "$*"
self.queueExecute.extend(self.cltObj.queueExecute)
for processor,text,nameTemplate in self.queueExecute:
if not self.executeTemplate(text,processor):
- self.setError(_("Failed to execute") + ": " +\
+ self.setError(_("Failed to execute") + _(": ") +
nameTemplate)
return False
self.queueExecute = []
@@ -4586,7 +4592,7 @@ gettext -d cl_template "$*"
"""
Verbose output applied templates
"""
- self.printWARNING(_("Calculate Utilities have changed files")+":")
+ self.printWARNING(_("Calculate Utilities have changed files")+_(":"))
reGrey = re.compile(r"\._cfg\d{4}_")
rootPath = self.objVar.Get('cl_root_path')
for fn in sorted(list(set(filesApply))):
@@ -4833,7 +4839,7 @@ gettext -d cl_template "$*"
if not self.functObj.checkCorrectPkgName(x)):
self.printWARNING(
_("Wrong package '%s' for 'merge' in the template")%
- wrongPkg + ": " + templateDirFile)
+ wrongPkg + _(": ") + templateDirFile)
if self.objVar.Get('cl_ebuild_phase') == 'postinst':
for pkg in postmergePkgs:
if not pkg in self.objVar.Get('cl_merge_pkg_pass'):
@@ -4924,7 +4930,7 @@ gettext -d cl_template "$*"
textTemplate = "%s %s"%(textTemplate[:-1],buf.rstrip())
FD.close()
except:
- self.setError(_("Failed to open the template") + ": " +\
+ self.setError(_("Failed to open the template") + _(": ") +
templateDirFile)
return ("", False, [])
@@ -4949,7 +4955,7 @@ gettext -d cl_template "$*"
# Директория с профилями не будет применена
if not objHead.headerTerm:
if objHead.getError():
- self.setError(_("Incorrect template") + ": " +\
+ self.setError(_("Incorrect template") + _(": ") +
templateDirFile)
return ("", False, [])
@@ -4968,8 +4974,8 @@ gettext -d cl_template "$*"
path = os.path.join(self.homeDir,
path.partition("/")[2],"")[:-1]
elif not path or path and path[0] != "/":
- self.setError(_("Wrong value 'path' in the template") + ": " +\
- templateDirFile)
+ self.setError(_("Wrong value 'path' in the template") +
+ _(": ") + templateDirFile)
return ("", False, [])
else:
path = pathJoin(self._baseDir, path)
@@ -4978,8 +4984,8 @@ gettext -d cl_template "$*"
if "name" in objHead.params:
nameDir = objHead.params['name']
if "/" in nameDir or nameDir == ".." or nameDir == ".":
- self.setError(_("Wrong value 'name' in the template") + ": " +\
- templateDirFile)
+ self.setError(_("Wrong value 'name' in the template") +
+ _(": ") + templateDirFile)
return ("", False, [])
# Новый путь к директории
applyDir = pathJoin(path, nameDir)
@@ -5043,8 +5049,8 @@ gettext -d cl_template "$*"
self.setError(_("Failed to change the mode for "
"the directory: ") +applyDir)
else:
- self.setError(_("Wrong value 'chmod' in the template") + ": " +\
- templateDirFile)
+ self.setError(_("Wrong value 'chmod' in the template") +
+ _(": ") + templateDirFile)
return ("", False, [])
# chown - изменяем владельца и группу
if "chown" in objHead.params:
@@ -5059,8 +5065,8 @@ gettext -d cl_template "$*"
except:
self.setError(_("No such user on the system: ")
+ strUid)
- self.setError(_("Wrong value 'chown' in the template")+\
- ": " + templateDirFile)
+ self.setError(_("Wrong value 'chown' in the template")+
+ _(": ") + templateDirFile)
return ("", False, [])
gid = self.getGidFromGroup(strGid)
try:
@@ -5070,8 +5076,8 @@ gettext -d cl_template "$*"
self.setError(_("Group not found on the system: ")
+strGid)
self.setError(
- _("Wrong value 'chown' in the template") +\
- ": "+ templateDirFile)
+ _("Wrong value 'chown' in the template") +
+ _(": ") + templateDirFile)
return ("", False, [])
if not os.path.exists(applyDir):
@@ -5085,12 +5091,12 @@ gettext -d cl_template "$*"
templateDirFile):
return ("", False, [])
else:
- self.setError(_("Wrong value 'chown' in the template")
- + ": " + templateDirFile)
+ self.setError(_("Wrong value 'chown' in the template") +
+ _(": ") + templateDirFile)
return ("", False, [])
else:
self.setError(_("Wrong value 'chown' in the template") +
- ": " + templateDirFile)
+ _(": ") + templateDirFile)
return ("", False, [])
else:
# Устанавливаем владельцем директории, пользователя по умолчанию
@@ -5265,7 +5271,7 @@ gettext -d cl_template "$*"
self.nameFileTemplate = os.path.abspath(nameFileTemplate)
self.F_TEMPL = self.openTemplFile(self.nameFileTemplate)
if not self.F_TEMPL:
- self.setError(_("Failed to open the template") + ": " +\
+ self.setError(_("Failed to open the template") + _(": ") +
self.nameFileTemplate)
return False
self.textTemplate = self.F_TEMPL.read()
@@ -5276,7 +5282,7 @@ gettext -d cl_template "$*"
# файл шаблона не будет применен
if not objHeadNew.headerTerm:
if objHeadNew.getError():
- self.setError(_("Incorrect template") + ": " +\
+ self.setError(_("Incorrect template") + _(": ") +
nameFileTemplate)
return ([], False)
@@ -5292,8 +5298,8 @@ gettext -d cl_template "$*"
# Получаем путь с заменой ~ на директорию пользователя
path = os.path.join(self.homeDir,path.partition("/")[2],"")[:-1]
elif not path or path and path[0] != "/":
- self.setError(_("Wrong value 'path' in the template") + ": " +\
- nameFileTemplate)
+ self.setError(_("Wrong value 'path' in the template") +
+ _(": ") + nameFileTemplate)
return ([], False)
else:
path = pathJoin(self._baseDir, path)
@@ -5303,8 +5309,8 @@ gettext -d cl_template "$*"
if objHeadNew.params.has_key("name"):
nameFile = objHeadNew.params['name']
if "/" in nameFile or nameFile == ".." or nameFile == ".":
- self.setError(_("Wrong value 'name' in the template") + ": " +\
- nameFileTemplate)
+ self.setError(_("Wrong value 'name' in the template") +
+ _(": ") + nameFileTemplate)
return ([], False)
# Новый путь к оригинальному файлу
pathOldFile = pathJoin(path,nameFile)
@@ -5332,14 +5338,13 @@ gettext -d cl_template "$*"
self.executeType = paramName
execPath = objHeadNew.params[paramName]
if not os.access(execPath,os.X_OK):
- self.setError(_("Wrong value '%s' in the template")%paramName \
- + ": " + nameFileTemplate)
+ self.setError(_("Wrong value '%s' in the template")%paramName +
+ _(": ") + nameFileTemplate)
self.setError(_("Failed to execute %s") %execPath)
return ([], False)
if typeAppendTemplate == "join":
self.setError(_("Wrong value 'append=join' in the template") +
- ": " +\
- nameFileTemplate)
+ _(": ") + nameFileTemplate)
return ([], False)
# Очищаем оригинальный файл
@@ -5348,10 +5353,10 @@ gettext -d cl_template "$*"
open(pathOldFile, "w").truncate(0)
newBuffer = ""
except:
- self.setError(_("Template error") + ": " +\
- nameFileTemplate)
- self.setError(_("Failed to clear the file") + ": " +\
- pathOldFile)
+ self.setError(_("Template error") + _(": ") +
+ nameFileTemplate)
+ self.setError(_("Failed to clear the file") + _(": ") +
+ pathOldFile)
return (applyFiles, False)
# Удаляем оригинальный файл
if typeAppendTemplate == "remove":
@@ -5363,10 +5368,10 @@ gettext -d cl_template "$*"
os.unlink(pathOldFile)
return (applyFiles, False)
except:
- self.setError(_("Template error") + ": " +\
+ self.setError(_("Template error") + _(": ") +
nameFileTemplate)
- self.setError(_("Failed to delete the link") + ": " +\
- pathOldFile)
+ self.setError(_("Failed to delete the link") + _(": ") +
+ pathOldFile)
return ([], False)
if os.path.isfile(pathOldFile) and self.configMode == T_ORIGIN:
# удаляем файл
@@ -5374,10 +5379,10 @@ gettext -d cl_template "$*"
os.remove(pathOldFile)
return (applyFiles, False)
except:
- self.setError(_("Template error") + ": " +\
+ self.setError(_("Template error") + _(": ") +
nameFileTemplate)
- self.setError(_("Failed to delete the file") + ": " +\
- pathOldFile)
+ self.setError(_("Failed to delete the file") + _(": ") +
+ pathOldFile)
return ([], False)
return ([], False)
# Пропускаем обработку шаблона
@@ -5396,10 +5401,10 @@ gettext -d cl_template "$*"
newBuffer = ""
os.unlink(pathOldFile)
except:
- self.setError(_("Template error") + ": " +\
+ self.setError(_("Template error") + _(": ") +
nameFileTemplate)
- self.setError(_("Failed to delete the link") + ": " +\
- pathOldFile)
+ self.setError(_("Failed to delete the link") + _(": ") +
+ pathOldFile)
return ([], False)
if os.path.isfile(pathOldFile):
# удаляем файл
@@ -5407,10 +5412,10 @@ gettext -d cl_template "$*"
newBuffer = ""
os.remove(pathOldFile)
except:
- self.setError(_("Template error") + ": " +\
+ self.setError(_("Template error") + _(": ") +
nameFileTemplate)
- self.setError(_("Failed to delete the file") + ": " +\
- pathOldFile)
+ self.setError(_("Failed to delete the file") + _(": ") +
+ pathOldFile)
return ([], False)
flagSymlink = False
@@ -5430,9 +5435,9 @@ gettext -d cl_template "$*"
newBuffer = ""
os.remove(pathOldFile)
except:
- self.setError(_("Template error") + ": " +\
+ self.setError(_("Template error") + _(": ") +
nameFileTemplate)
- self.setError(_("Failed to delete the file") + ": " +\
+ self.setError(_("Failed to delete the file") + _(": ") +
pathOldFile)
return ([], False)
elif not os.path.exists(pathOldFile):
@@ -5454,20 +5459,20 @@ gettext -d cl_template "$*"
F_CONF.close()
fMode, fUid, fGid = getModeFile(templateFile)
except:
- self.setError(_("Template error") + ": " +\
+ self.setError(_("Template error") + _(": ") +
nameFileTemplate)
- self.setError(_("Failed to open the file") + ": " +\
- templateFile)
+ self.setError(_("Failed to open the file") + _(": ") +
+ templateFile)
return ([], False)
if os.path.exists(pathOldFile):
try:
newBuffer = ""
os.remove(pathOldFile)
except:
- self.setError(_("Template error") + ": " +\
- nameFileTemplate)
- self.setError(_("Failed to delete the file") + ": " +\
- pathOldFile)
+ self.setError(_("Template error") + _(": ") +
+ nameFileTemplate)
+ self.setError(_("Failed to delete the file") + _(": ") +
+ pathOldFile)
return ([], False)
if foundTemplateFile:
try:
@@ -5476,7 +5481,7 @@ gettext -d cl_template "$*"
FD.write(buff)
FD.close()
except:
- self.setError(_("Template error") + ": " +\
+ self.setError(_("Template error") + _(": ") +
nameFileTemplate)
self.setError(_("Failed to create the file") + " '%s'"\
%pathOldFile)
@@ -5503,8 +5508,8 @@ gettext -d cl_template "$*"
try:
os.chdir(pathLink)
except:
- self.setError(_("Template error") + ": " +\
- nameFileTemplate)
+ self.setError(_("Template error") + _(": ") +
+ nameFileTemplate)
self.setError(
_("Failed to change the current directory to")+\
" " + pathLink)
@@ -5518,8 +5523,8 @@ gettext -d cl_template "$*"
preReturn(pathProg)
return ([], False)
else:
- self.setError(_("Wrong value 'chmod' in the template") + ": " +\
- nameFileTemplate)
+ self.setError(_("Wrong value 'chmod' in the template") +
+ _(": ") + nameFileTemplate)
preReturn(pathProg)
return ([], False)
# chown - изменяем владельца и группу
@@ -5541,7 +5546,7 @@ gettext -d cl_template "$*"
strUid)
self.setError(
_("Wrong value 'chown' in the template") +
- ": "+ nameFileTemplate)
+ _(": ") + nameFileTemplate)
preReturn(pathProg)
return ([], False)
if strGid.isdigit():
@@ -5557,7 +5562,7 @@ gettext -d cl_template "$*"
strGid)
self.setError(
_("Wrong value 'chown' in the template") +
- ": "+ nameFileTemplate)
+ _(": ") + nameFileTemplate)
preReturn(pathProg)
return ([], False)
# Изменяем владельца файла
@@ -5566,12 +5571,12 @@ gettext -d cl_template "$*"
return ([], False)
else:
self.setError(_("Wrong value 'chown' in the template") +
- ": " + nameFileTemplate)
+ _(": ") + nameFileTemplate)
preReturn(pathProg)
return ([], False)
else:
- self.setError(_("Wrong value 'chown' in the template")
- + ": " + nameFileTemplate)
+ self.setError(_("Wrong value 'chown' in the template") +
+ _(": ") + nameFileTemplate)
preReturn(pathProg)
return ([], False)
if not flagSymlink:
@@ -5600,10 +5605,10 @@ gettext -d cl_template "$*"
# иначе удаляем файл
os.remove(prevOldFile)
except:
- self.setError(_("Template error") + ": " +\
- nameFileTemplate)
- self.setError(_("Failed to delete the file") + ": " +\
- prevOldFile)
+ self.setError(_("Template error") + _(": ") +
+ nameFileTemplate)
+ self.setError(_("Failed to delete the file") + _(": ") +
+ prevOldFile)
preReturn(pathProg)
return ([], False)
if not "/" == pathOldFile[0]:
@@ -5613,9 +5618,9 @@ gettext -d cl_template "$*"
try:
os.symlink(pathOldFile, prevOldFile)
except:
- self.setError(_("Template error") + ": " +\
+ self.setError(_("Template error") + _(": ") +\
nameFileTemplate)
- self.setError(_("Failed to create a symbolic link") + " :" +\
+ self.setError(_("Failed to create a symbolic link") + _(": ") +\
"%s -> %s"%(prevOldFile, pathOldFile))
preReturn(pathProg)
return ([], False)
@@ -5814,7 +5819,8 @@ gettext -d cl_template "$*"
self.textConfig = objHeadOld.body
# обработка конфигурационного файла
self.textTemplate = objTempl.processingFile(self.textConfig,
- self.objVar.Get('cl_root_path'))
+ pathJoin(self.objVar.Get('cl_chroot_path'),
+ self.objVar.Get('cl_root_path')))
if objTempl.getError():
raise TemplatesError(_("Failed to use patch ") + \
nameFileTemplate)
@@ -5833,9 +5839,9 @@ gettext -d cl_template "$*"
if 'run' in objHeadNew.params:
if not self.executeTemplate(self.textConfig,
objHeadNew.params['run']):
- self.setError(_("Wrong template") + ": " +\
+ self.setError(_("Wrong template") + _(": ") +\
nameFileTemplate)
- self.setError(_("Failed to execute") + ": " +\
+ self.setError(_("Failed to execute") + _(": ") +\
self.nameFileConfig)
return False
return False
@@ -5861,7 +5867,7 @@ gettext -d cl_template "$*"
return False
if "xml_" in formatTemplate:
if objTemplNew.getError():
- self.setError(_("Wrong template") + ": " +\
+ self.setError(_("Wrong template") + _(": ") +\
nameFileTemplate)
return False
# Имя файла внутри xml xfce конфигурационных файлов
@@ -5906,9 +5912,9 @@ gettext -d cl_template "$*"
if 'run' in objHeadNew.params:
if not self.executeTemplate(self.textConfig,
objHeadNew.params['run']):
- self.setError(_("Wrong template") + ": " +\
+ self.setError(_("Wrong template") + _(": ") +\
nameFileTemplate)
- self.setError(_("Failed to execute") + ": " +\
+ self.setError(_("Failed to execute") + _(": ") +\
self.nameFileConfig)
return False
return False
@@ -5935,9 +5941,9 @@ gettext -d cl_template "$*"
if 'run' in objHeadNew.params:
if not self.executeTemplate(self.textConfig,
objHeadNew.params['run']):
- self.setError(_("Wrong template") + ": " +\
+ self.setError(_("Wrong template") + _(": ") +\
nameFileTemplate)
- self.setError(_("Failed to execute") + ": " +\
+ self.setError(_("Failed to execute") + _(": ") +\
self.nameFileConfig)
return False
return False
@@ -5963,9 +5969,9 @@ gettext -d cl_template "$*"
if 'run' in objHeadNew.params:
if not self.executeTemplate(self.textConfig,
objHeadNew.params['run']):
- self.setError(_("Wrong template") + ": " +\
+ self.setError(_("Wrong template") + _(": ") +\
nameFileTemplate)
- self.setError(_("Failed to execute") + ": " +\
+ self.setError(_("Failed to execute") + _(": ") +\
self.nameFileConfig)
return False
return False
@@ -5992,7 +5998,7 @@ gettext -d cl_template "$*"
return False
if "xml_" in formatTemplate:
if objTemplNew.getError():
- self.setError(_("Wrong template") + ": " +\
+ self.setError(_("Wrong template") + _(": ") +\
nameFileTemplate)
return False
nameRootNode=nameFileConfig.rpartition("/")[2].split(".")[0]
@@ -6027,7 +6033,7 @@ gettext -d cl_template "$*"
return False
if "xml_" in formatTemplate:
if objTemplOld.getError():
- self.setError(_("Wrong template") + ": " +\
+ self.setError(_("Wrong template") + _(": ") +\
nameFileConfig)
return False
nameRootNode=nameFileConfig.rpartition("/")[2].split(".")[0]
@@ -6036,7 +6042,7 @@ gettext -d cl_template "$*"
objTemplOld.join(objTemplNew)
if "xml_" in formatTemplate:
if objTemplOld.getError():
- self.setError(_("Wrong template") + ": " +\
+ self.setError(_("Wrong template") + _(": ") +\
nameFileTemplate)
return False
data = objTemplOld.getConfig().encode("UTF-8").split("\n")
@@ -6057,16 +6063,16 @@ gettext -d cl_template "$*"
if 'run' in objHeadNew.params:
if not self.executeTemplate(self.textConfig,
objHeadNew.params['run']):
- self.setError(_("Wrong template") + ": " +\
+ self.setError(_("Wrong template") + _(": ") +\
nameFileTemplate)
- self.setError(_("Failed to execute") + ": " +\
+ self.setError(_("Failed to execute") + _(": ") +\
self.nameFileConfig)
return False
return False
return filesApply if not 'exec' in objHeadNew.params else False
else:
- self.setError(_("Wrong template option (type append)") + ": " +\
- typeAppendTemplate)
+ self.setError(_("Wrong template option (type append)")
+ + _(": ") + typeAppendTemplate)
return False
else:
self.setError(_("Template type not found: ") + nameFileTemplate)
@@ -6396,7 +6402,7 @@ class iniParser(_error, templateFormat):
def writeIniFile(self, txtConfig):
if self.readOnly:
self.setError(_("Failed to write to file")
- + ": " + self.iniFile)
+ + _(": ") + self.iniFile)
return False
if not os.path.exists(self.iniFile):
try:
@@ -6406,11 +6412,11 @@ class iniParser(_error, templateFormat):
os.chmod(self.iniFile, self.mode)
except:
self.setError(_("Failed to create the file") +
- ": " + self.iniFile)
+ _(": ") + self.iniFile)
return False
if not self.FD:
self.setError(_("Failed to write to file")
- + ": " + self.iniFile)
+ + _(": ") + self.iniFile)
return False
self.FD.truncate(0)
self.FD.seek(0)
@@ -6487,7 +6493,7 @@ class iniParser(_error, templateFormat):
try:
objIni = self.getClassObj("plasma")(textIni)
except:
- self.setError(_("Incorrect file format") + ": " + \
+ self.setError(_("Incorrect file format") + _(": ") + \
self.iniFile)
self.checkIni = False
return self.checkIni
diff --git pym/calculate/lib/utils/common.py pym/calculate/lib/utils/common.py
index 1604cce..aebb033 100644
--- pym/calculate/lib/utils/common.py
+++ pym/calculate/lib/utils/common.py
@@ -101,8 +101,8 @@ def getUserPassword(flag="dialog", pwDialog=False):
if not pwDialog:
pwDialog = [_("New password"),
_("Retype the new password")]
- pwdA = getpass.getpass(pwDialog[0]+":")
- pwdB = getpass.getpass(pwDialog[1]+":")
+ pwdA = getpass.getpass(pwDialog[0]+_(":"))
+ pwdB = getpass.getpass(pwDialog[1]+_(":"))
elif flag == "stdin":
pwdA = sys.stdin.readline().rstrip()
pwdB = sys.stdin.readline().rstrip()
diff --git pym/calculate/lib/utils/device.py pym/calculate/lib/utils/device.py
index 26f5321..9d5fc15 100644
--- pym/calculate/lib/utils/device.py
+++ pym/calculate/lib/utils/device.py
@@ -93,18 +93,19 @@ def getLvmPartitions(vg_name,lv_name,cache=[]):
def getPartitionDevice(syspath):
"""Get real parent device by partition,lvm,mdraid"""
+ if not syspath.startswith('/sys'):
+ syspath = pathJoin('/sys',syspath)
prop = getUdevDeviceInfo(path=syspath)
# real device
- if prop.get('ID_TYPE',"") == "disk" and \
- prop.get('DEVTYPE',"") == "disk":
+ if (prop.get('DEVTYPE',"") == "disk" and
+ (prop.get('ID_TYPE',"") == "disk" or
+ path.exists(path.join(syspath,"device")))):
return prop.get('DEVNAME',"")
# partition
if prop.get('DEVTYPE') == "partition":
return getPartitionDevice(path.dirname(syspath))
# md raid
if prop.get('MD_LEVEL',"").startswith("raid"):
- if not syspath.startswith('/sys'):
- syspath = pathJoin('/sys',syspath)
syspath = pathJoin(syspath,"md")
for rd in filter(lambda x:path.basename(x).startswith('rd'),
listDirectory(syspath,fullPath=True)):
diff --git pym/calculate/lib/utils/portage.py pym/calculate/lib/utils/portage.py
index 359c520..37b4848 100644
--- pym/calculate/lib/utils/portage.py
+++ pym/calculate/lib/utils/portage.py
@@ -587,7 +587,7 @@ class Git:
_("Branch {branch} not found in repository {rpath}").format(
branch=branch, rpath=rpath))
raise GitError(
- _("Failed to change branch to {branch} in the {rpath} "
+ _("Failed to move to branch {branch} in the {rpath} "
"repository").format(branch=branch,
rpath=rpath), error)
return True
diff --git pym/calculate/lib/variables/__init__.py pym/calculate/lib/variables/__init__.py
index 0e13beb..7f1f72c 100644
--- pym/calculate/lib/variables/__init__.py
+++ pym/calculate/lib/variables/__init__.py
@@ -41,4 +41,4 @@ class VariableClVer(ReadonlyVariable):
"""
Package version
"""
- value = "3.2.3"
+ value = "3.2.3.1"

@ -0,0 +1,26 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=4
DESCRIPTION="Calculate Utilities meta package"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
SRC_URI=""
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS="x86 amd64"
IUSE="cl_consolegui cl_client cl_desktop cl_console"
RDEPEND="${RDEPEND}
=sys-apps/calculate-install-3.2.3-r5
=sys-apps/calculate-i18n-3.2.3-r3
=sys-apps/calculate-lib-3.2.3-r6
=sys-apps/calculate-core-3.2.3-r4
=sys-apps/calculate-update-3.2.3-r6
cl_client? ( =sys-apps/calculate-client-3.2.3-r4 )
cl_desktop? ( =sys-apps/calculate-desktop-3.2.3-r2 )
cl_consolegui? ( =sys-apps/calculate-console-gui-3.2.3-r2 )
cl_console? ( =sys-apps/calculate-console-3.2.3-r3 )
"
Loading…
Cancel
Save