diff --git a/profiles/calculate.env b/profiles/calculate.env index 72bfd512e..dd0b4a83a 100644 --- a/profiles/calculate.env +++ b/profiles/calculate.env @@ -11,6 +11,7 @@ os_linux_name = Gentoo cl_autopartition_set = off cl_autopartition_table = gpt cl_autopartition_boot_size = 536870912 +cl_autopartition_bios_grub_size = 10485760 cl_uuid_set = on os_install_ntp = ntp0.zenon.net os_install_proxy = '' diff --git a/sys-apps/calculate-install/Manifest b/sys-apps/calculate-install/Manifest index b856f18e4..9dfeeda6f 100644 --- a/sys-apps/calculate-install/Manifest +++ b/sys-apps/calculate-install/Manifest @@ -1,5 +1,6 @@ AUX calculate-install-3.1.6-r3.patch 7194 SHA256 2e4d5e73bb4d18dbe25f508e0586c4dcfc409d9c0102223ee42ed66d90106c70 SHA512 74dc94b0614882923d104b19392e32925d7283e66f6d8e842e55cc1973ecadd6fba1d8a98c7e30d93ae577a1d2974fbe8c8cb54a20cb5fa05769743dbf65c1ab WHIRLPOOL 5147637209a4019b216a420b8a36365a849d17d809f163f83bec9bddd0ba8182be146a815d9ed5547e9ba0c19de17d70cfac0191eac148b1c23f6851cb6d4fd3 AUX calculate-install-3.1.8-r1.patch 2525 SHA256 fd9d137e0c9448e06def0bbd8df8c7e1e20dd995658121f138efc91b588d0b7a SHA512 7e9b101ee9d3a88650b7bf1818abf387215dcb60282827e1a8d02fd4d8b0a2b9eab46d1273f31e31469ca25e03b626f651b51689b0f1831ed65bba49593ec059 WHIRLPOOL e78c1b26c08893bfc132f085b8b9b55b65fb6f349e62acaef13a8e437486276dd93b4108d347b755d5a25c0096fe3127abd715c371d4a8bc2236356a6912f6f0 +AUX calculate-install-3.1.8-r10.patch 41338 SHA256 d943c6a892c3954486d4fb85cfc4002d3f4eadcdefdf82e0d3bea9d693ea0c69 SHA512 be618f1b0db11c30a5bb32b46a09e376dbef63d7f540ec45528eaa14dff346285b7b8154996cdde19bb81051389784e7d89357fb5e3ae7aad03e3644a18c96a5 WHIRLPOOL 1ce34fc30d2b3b542a3e0210399c063a6eeb2dc852b11f5ff70cf8e04514a7e13b6fa43ef6379fb8e34b1198749a22bf36de3eb62de2985a8ffc8c49167ecb23 AUX calculate-install-3.1.8-r2.patch 4745 SHA256 8a85bd667b53a2758375f85d29a60d9570199ff4317e1991ee58b2f7faffa232 SHA512 720b01b466f7fa32a712f4a5f99813ca1f7c4052e9c606bcbfa9e8d377d4ee5d6bb856839f5c76d6fe5f5bbd51632ad85626b63da119f6d49410253fd21420dd WHIRLPOOL 7776f9bfb7406a679ee7ad2f18ccbf48601de1c4ea2e4637c7e7418f559a7b931f13c50168eb9466dbc29b85fdc3f5b7622177e24bcad089e648cd5702cdc842 AUX calculate-install-3.1.8-r3.patch 6265 SHA256 4786199915488125e4081350ac096c23284128e8451cce411351d761653b099a SHA512 0360d2b1b6e0fc4b87b86f3ddc405d589ad5f7237ed46cad0b050c3a8ac4c8d2dc4f78b126f7fa2a37313cebcec2b85094146280baddcc75e070874bf99eb466 WHIRLPOOL 18f6c7044c02d197493ae1380bad58561a1c72756c48e41330e92cff855f81aab85a01c6bcf69c359dcc0bb3b4bc7fd28f170b12f772a3fff4d1ae8c6e568adf AUX calculate-install-3.1.8-r4.patch 8350 SHA256 7e239492df59b943367954a735348753811e20f0e00bbf58c9dd4c9e175ea55d SHA512 6a68a10cd5c3827f5bab9ef83a3a60c3ff37cececb726918bc9b75d68d853204d3aaa3e66768f48b77a5d2ae2a9073de87a4c33b1626ab2e4da7ee50cc519efc WHIRLPOOL 1b0949d3c19f4a227722ef86108fb12394ff42707d70bf707a44687ce07b7da1a369210c6232730ebf02139501f53cfcb235968e4620d4272e10f037c5952f5b @@ -12,6 +13,7 @@ DIST calculate-install-3.1.6.tar.bz2 77530 SHA256 799a353e4ca01318508183d5e8a1eb DIST calculate-install-3.1.8.tar.bz2 76501 SHA256 316657b710dfd4b84784d88e34ae59cedf88bafea128be7538eef3408d9c1c69 SHA512 06c2c204ef704c7dbefbfb37d9ae994b32f75fe1b51ae9839a30c61a29914ef3cbe722bdfb6d3d049e345687cdffdb00a960d21e64ae7ca9cf39aa2c9bcfb317 WHIRLPOOL 18aef654b09c0fc8be177e34164af79e07c1148f0de23a6febd5f035cc33c76fb61583da8711328f13292d010dd6ab3d69a102002f2899d17d09ddaa59d71711 EBUILD calculate-install-3.1.6-r3.ebuild 1042 SHA256 474f803954d18922a224ae9d754dcbd8dbba56be471e30f93db73b243fed5bb9 SHA512 0631ca0a9452835cae1d782385dd624464a06342f6332f6b8e85ccc4d53a9caf5b7cb066f9df2d31db42df7686484bd39d383969912247d7d7853e5e84876889 WHIRLPOOL 2f9f501c0ca24a94197ff354ab96aa08e26ffd12e5ce5c8261b2936178f33f3801fa100150c3d34ef7f2fa73a35b14f51b409c090a56c1021a6aaee38f1b9e70 EBUILD calculate-install-3.1.8-r1.ebuild 1043 SHA256 b0cec08222a82f567cd8b4cd367e2e5241349cf2485bd23688824a3b8b788432 SHA512 afaeae1a025a1d3633263ecf61096d3bfc374bb2512272274cd87c005882e5c6b2ad4e21d54462412b492e348fecfba1dd6d3728070e80ee97075df8b23f9511 WHIRLPOOL 699c1f09ff83fe4dbb2fe81c802e80769848fe01efd7d82256d9444f48444e9ef39a0b1e106ba7fd789e953eb37d034827203a207739884323103ade5e271f9a +EBUILD calculate-install-3.1.8-r10.ebuild 1044 SHA256 9e63b457fd08f28a6c570d091458035af86eeae0735aa86a83be7d9bae55a5f9 SHA512 a9c83bafbad5a75fec50d20dab03191aa06f2cad929b2b5b1f0835bdccc493e8265c940913d5ccef45479199189da22f7f3e3fe33945003972f58d209a83dd47 WHIRLPOOL 2dbc3ddb7ae249c19b9fe68add53cb11edfb64020f2cfd3c6c20f74794cb3ca9ab6f725d4757eaf19950c8ede9fc045122efe1fd33891c9be35fe3cc2ae265e6 EBUILD calculate-install-3.1.8-r2.ebuild 1043 SHA256 1c7d5d8c73ee22f5735297b6d3907cfbb056e75a978a2e033862563a08e23de8 SHA512 7973f22afe6641d0d624c9df8a77d9d60dfe78da19ea3cc6c53c60ad64740b8f291b683ec0284d6aed204fc239aa1a0274ad41739b2ff44501264c3cc241f6f0 WHIRLPOOL d2abf60da36365820eb0c76415409d999546d6d0e31e1831c7347eaf483b1c375ba770c5d651ec5a0ed9b8a74fb027d98528d3ffdf9e775f5dae3b272b1bbfff EBUILD calculate-install-3.1.8-r3.ebuild 1043 SHA256 547c7cf9961711b2d21d414119f7ef1173b443541023f01d658f98e3a7e7d75b SHA512 09c617f331293ae40fabbedde3943e6e5007ee4d79a96d97fe49cfbcf208ce9e90db499c790a6ee5ce22f60ae7ffe527bf81bb63c30363d4a25c96a8b6ddb38a WHIRLPOOL 17c8038a0a34953826ea0f6644cca48dd09001fbc6db432ba375873143658cecd406b80625920d50d56230e811ee2845bca790c76afc14d78ae3880435499746 EBUILD calculate-install-3.1.8-r4.ebuild 1043 SHA256 326a2601f0789b9c22538910bf65b08b7a9fe2837a6c20bfadf032936b30b6d5 SHA512 2a51ccf307c7d826a9227b5f39ad7e9468ff80ed5c3bb199805680b2f5f7cb60583633081d7d37e9349c4fa2d08e60796f925bdc673c868b3348d2abb80fced0 WHIRLPOOL 98d128f9f26a4e4af7b06f08bae94c53a120101c3adf3f467b73a6bac8367e10518afbc0ba8238aaa4f489972b332915f58f4b3b5ad9c3a5597e0002ef0f1fdb diff --git a/sys-apps/calculate-install/calculate-install-3.1.8-r10.ebuild b/sys-apps/calculate-install/calculate-install-3.1.8-r10.ebuild new file mode 100644 index 000000000..9c6b50dd1 --- /dev/null +++ b/sys-apps/calculate-install/calculate-install-3.1.8-r10.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="3" +SUPPORT_PYTHON_ABIS="1" +PYTHON_DEPEND="2:2.7" +RESTRICT_PYTHON_ABIS="2.4 2.5 2.6 3.*" + +inherit distutils eutils + +SRC_URI="ftp://ftp.calculate.ru/pub/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="amd64 x86" +IUSE="pxe minimal" + +DEPEND="~sys-apps/calculate-core-3.1.8 + !=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.1.8-r10.patch" +} diff --git a/sys-apps/calculate-install/files/calculate-install-3.1.8-r10.patch b/sys-apps/calculate-install/files/calculate-install-3.1.8-r10.patch new file mode 100644 index 000000000..3642ca0c8 --- /dev/null +++ b/sys-apps/calculate-install/files/calculate-install-3.1.8-r10.patch @@ -0,0 +1,1004 @@ +diff --git install/distr.py install/distr.py +index 545168b..88de47f 100644 +--- install/distr.py ++++ install/distr.py +@@ -604,12 +604,13 @@ class PartitionDistributive(Distributive): + 'ext4':'/sbin/mkfs.ext4 %s %s', + 'jfs':'/sbin/mkfs.jfs %s -f %s', + 'reiserfs':'/sbin/mkfs.reiserfs %s -f %s', +- 'btrfs':'/sbin/mkfs.btrfs %s %s', ++ 'btrfs':'/sbin/mkfs.btrfs -f %s %s', + 'nilfs2':'/sbin/mkfs.nilfs2 %s %s', + 'xfs':'/sbin/mkfs.xfs %s -f %s', + 'vfat':'/usr/sbin/mkfs.vfat %s -F 32 %s', + 'ntfs-3g':'/usr/sbin/mkfs.ntfs %s -FQ %s', + 'ntfs':'/usr/sbin/mkfs.ntfs %s -FQ %s', ++ 'uefi':'/usr/sbin/mkfs.vfat %s %s', + 'swap':'/sbin/mkswap %s' + } + labelForUtilities = { 'ext2':'-L %s', +@@ -780,14 +781,16 @@ class PartitionDistributive(Distributive): + self.multipartition.getPartitionTable() + \ + [self.partitionTable]) + # get partition which need format +- formatPartitions = map(lambda x: (x[FS],x[DEV]), ++ formatPartitions = map(lambda x: (x[FS],x[DEV],x[NEWID]), + filter(lambda x: x[NEEDFORMAT] and x[FS]!="bind", + dataPartitions)) + # format all get partition +- for fileSystem, dev in formatPartitions: ++ for fileSystem, dev, newID in formatPartitions: + if fileSystem=="swap": + self.formatSwapPartition(dev) + else: ++ if newID == "EF00": ++ fileSystem = "uefi" + if dev == self.partition: + self.formatPartition(dev, format=fileSystem, + label=self.rootLabel) +diff --git install/fs_manager.py install/fs_manager.py +index 1f448a3..b2c2fa2 100644 +--- install/fs_manager.py ++++ install/fs_manager.py +@@ -60,7 +60,7 @@ class FileSystemManager: + 'type':['hdd','usb-hdd']}, + 'btrfs': {'defaultopt': defaultOpt, + 'format':'/sbin/mkfs.btrfs', +- 'formatparam': '{labelparam} {device}', ++ 'formatparam': '{labelparam} -f {device}', + 'gpt': '8300', + 'label': '-L {labelname}', + 'msdos': '83', +diff --git install/install.py install/install.py +index 3ae3eb9..fdd6b04 100644 +--- install/install.py ++++ install/install.py +@@ -350,7 +350,7 @@ class Install: + newModuleName = defaultGL + curModuleName = map(lambda x:x.strip().rpartition('=')[-1].strip('"\''), + filter(lambda x: x.startswith("OPENGL_PROFILE="), +- open(openGLenv,'r'))) ++ readFile(openGLenv))) + curModuleName = curModuleName[-1] if curModuleName else "" + if curModuleName == newModuleName: + return True +@@ -393,17 +393,19 @@ class Install: + raise InstallError(("Unable to change the I/O scheduler")) + return True + +- def autopartition(self,table,devices,data,lvm,lvm_vgname,bios_grub): ++ def autopartition(self,table,devices,data,lvm,lvm_vgname,bios_grub, ++ bios_grub_size): + """ + Авторазметка диска с таблицей разделов 'table', диски указываются + 'device', параметры таблицы 'data', 'lvm' использование LVM, + 'lvm_vgname' название группы томов LVM, bios_grub - создавать +- bios_grub раздел ++ bios_grub раздел, bios_grub_size - раздел bios grub раздела в байтах + """ + ap = AutoPartition() + ap.clearLvm(devices,self.clVars) + ap.clearRaid(devices,self.clVars) +- ap.recreateSpace(table,devices,data,lvm,lvm_vgname,bios_grub) ++ ap.recreateSpace(table,devices,data,lvm, ++ lvm_vgname,bios_grub,bios_grub_size) + return True + + def format(self,target): +diff --git install/utils/cl_install.py install/utils/cl_install.py +index 7d7ee74..29e6c8f 100644 +--- install/utils/cl_install.py ++++ install/utils/cl_install.py +@@ -44,7 +44,8 @@ class ClInstallAction(Action): + 'method':"Install.autopartition(cl_autopartition_table," + "cl_autopartition_device,cl_autopartition_disk_data," + "cl_autopartition_lvm_set,cl_autopartition_lvm_vgname," +- "cl_autopartition_bios_grub_set)", ++ "cl_autopartition_bios_grub_set," ++ "cl_autopartition_bios_grub_size)", + 'condition':lambda dv:dv.Get('cl_autopartition_set') == 'on'}, + # форматирование разделов на которые устанавливается дистрибутив + {'name':'format', +diff --git install/utils/cl_setup.py install/utils/cl_setup.py +index fab08b9..e4ad417 100644 +--- install/utils/cl_setup.py ++++ install/utils/cl_setup.py +@@ -18,6 +18,7 @@ import sys + from calculate.core.server.func import Action,Tasks + from calculate.lib.cl_lang import setLocalTranslate,getLazyLocalTranslate + from calculate.lib.utils.files import FilesError ++from calculate.lib.utils.portage import isPkgInstalled + from calculate.install.install import (MigrationError, TemplatesError, + InstallError, + AutopartitionError, DistributiveError) +@@ -43,10 +44,12 @@ class ClSetupVideoAction(Action): + {'name':'check_video', + 'message':__("Checking the video driver"), + 'method':'Install.checkVideoDriver()', ++ 'condition': lambda:isPkgInstalled('xorg-server') + }, + {'name':'setup_opengl', + 'message':__("Configuring OpenGL"), + 'method':'Install.setupOpenGL()', ++ 'condition': lambda:isPkgInstalled('xorg-server') + }, + {'name':'reboot', + 'warning':__("To apply the changes, reboot the system"), +@@ -142,7 +145,12 @@ class ClSetupBootAction(ClSetupSystemAction): + 'method':'Install.prepareBoot(cl_image)', + 'condition':(lambda Get:(Get('os_install_mbr') or + Get('os_install_uefi_set') == 'on') and +- Get('os_root_type') != 'livecd') ++ Get('os_root_type') != 'livecd' and ++ Get('os_install_scratch') == 'off') ++ }, ++ {'name':'no_scratch', ++ 'warning':_("The builder mode is not longer supported"), ++ 'condition':lambda Get:Get('os_install_scratch') == 'on' + }, + # изменить IO планировщик + {'name':'change_ioscheduler', +diff --git install/variables/X11.py install/variables/X11.py +index 3634b02..accda6b 100644 +--- install/variables/X11.py ++++ install/variables/X11.py +@@ -18,14 +18,14 @@ import os + import sys + import re + from os import path +-from calculate.lib.datavars import Variable,VariableError,ReadonlyVariable ++from calculate.lib.datavars import Variable, VariableError, ReadonlyVariable + from calculate.lib.utils.portage import isPkgInstalled +-from calculate.lib.utils.files import process,STDOUT,getProgPath ++from calculate.lib.utils.files import process, STDOUT, getProgPath, readFile + from calculate.lib.utils.common import (getVideoFromXorgLog, + getVideoFromXorgConf, getVideoFromCmdLine, + getAvailableVideo, getValueFromCmdLine, + getCompositeFromXorgconf, getVideoFromModules, +- getVideoFromVendor,getInstalledVideo) ++ getVideoFromVendor, getInstalledVideo) + from calculate.install.distr import DistributiveError + + from calculate.lib.cl_lang import setLocalTranslate +@@ -44,7 +44,7 @@ class VideoVariable(Variable): + if self.Get('os_install_root_type') == 'flash': + return \ + _("Video configuration unavailable for Flash install") +- if self.Get('os_install_x11_server_set') == 'no' and self.xorg_need: ++ if self.Get('os_install_x11_server_set') == 'off' and self.xorg_need: + return \ + _("This distribution does not provide a Xorg server") + return "" +@@ -126,7 +126,7 @@ class VariableOsX11KmsVideoDrv(ReadonlyVariable): + type = "list" + value = ["radeon","i915","intel","nouveau","ati"] + +-class VariableOsInstallX11VideoDrv(VideoVariable): ++class VariableOsInstallX11VideoDrv(Variable): + """ + Video driver used by xorg + """ +@@ -136,54 +136,81 @@ class VariableOsInstallX11VideoDrv(VideoVariable): + + def init(self): + self.help = _("set the video driver") +- self.label = _("{0} video driver").format("Xorg") ++ self.label = _("Video driver") + + def choice(self): + """Get available (already installed or installable drivers""" +- return self.Get('os_install_x11_video_available') ++ if self.Get('os_install_x11_server_set') == 'on': ++ return self.Get('os_install_x11_video_available') ++ else: ++ return self.Get('os_x11_kms_video_drv') + ["other"] + + def get(self): +- # get available videodriver list from install or configure distributive +- list_video = self.Choice('os_install_x11_video_drv') +- if not list_video: ++ if self.Get('os_install_x11_server_set') == 'on': ++ # get available videodriver list from install or configure distributive ++ list_video = self.Choice('os_install_x11_video_drv') ++ if not list_video: ++ return "other" ++ # if type system is usb-hdd then get detect video driver ++ if self.Get('os_install_root_type') == 'usb-hdd': ++ methods = ((getVideoFromModules,()), ++ (getVideoFromCmdLine,()), ++ (getVideoFromVendor,(self.Get('hr_video'),list_video))) ++ else: ++ # test current video driver for install system ++ methods = ((getVideoFromXorgLog,('/',list_video)), ++ (getVideoFromXorgConf,('/',)), ++ (getVideoFromModules,()), ++ (getVideoFromCmdLine,()), ++ (getVideoFromVendor,(self.Get('hr_video'),list_video))) ++ for func,args in methods: ++ drv = func(*args) ++ if drv in list_video: ++ return drv + return "other" +- # if type system is usb-hdd then get detect video driver +- if self.Get('os_install_root_type') == 'usb-hdd': +- methods = ((getVideoFromModules,()), +- (getVideoFromCmdLine,()), +- (getVideoFromVendor,(self.Get('hr_video'),list_video))) + else: +- # test current video driver for install system +- methods = ((getVideoFromXorgLog,('/',list_video)), +- (getVideoFromXorgConf,('/',)), +- (getVideoFromModules,()), +- (getVideoFromCmdLine,()), +- (getVideoFromVendor,(self.Get('hr_video'),list_video))) +- for func,args in methods: +- drv = func(*args) +- if drv in list_video: +- return drv +- return "other" ++ for drv in self.choice(): ++ videoSysPath = path.join("/sys/module",drv,"refcnt") ++ refcnt = readFile(videoSysPath).strip() ++ if refcnt.isdigit() and int(refcnt) > 0: ++ return {'i915':'intel'}.get(drv,drv) ++ else: ++ return "other" + + pkgDrvMap = {'nvidia':('NVidia','x11-drivers/nvidia-drivers'), + 'fglrx':('ATI','x11-drivers/ati-drivers'), + 'vboxdrv':('VirtualBox','x11-drivers/xf86-video-virtualbox')} + + def check(self,value): +- if self.Get('cl_action') == 'system': +- availDrvs = self.Get('os_install_x11_video_available') +- if not value in availDrvs: +- raise VariableError(_("Only %s drivers are available")% +- ",".join(availDrvs)) ++ if self.Get('os_install_x11_server_set') == 'on': ++ if self.Get('cl_action') == 'system': ++ availDrvs = self.Get('os_install_x11_video_available') ++ if not value in availDrvs: ++ raise VariableError(_("Only %s drivers are available")% ++ ",".join(availDrvs)) ++ else: ++ if not value in getInstalledVideo(prefix="/") and \ ++ not value in ("auto","other"): ++ error =_("video driver %s is unavailable")%value ++ if value in self.pkgDrvMap: ++ error += ". " + (_("Install driver %s with:") ++ %self.pkgDrvMap[value][0]) ++ error += "\n" + ("emerge %s"%self.pkgDrvMap[value][1]) ++ raise VariableError(error) + else: +- if not value in getInstalledVideo(prefix="/") and \ +- not value in ("auto","other"): +- error =_("video driver %s is unavailable")%value +- if value in self.pkgDrvMap: +- error += ". " + (_("Install driver %s with:") +- %self.pkgDrvMap[value][0]) +- error += "\n" + ("emerge %s"%self.pkgDrvMap[value][1]) +- raise VariableError(error) ++ availDrivers = self.Get('os_x11_kms_video_drv') + ["other"] ++ if not value in availDrivers: ++ raise VariableError("Only %s drivers are available" % ++ ",".join(availDrivers)) ++ ++ def uncompatible(self): ++ """ ++ Video setting up unavailable for flash installation ++ """ ++ if self.Get('os_install_root_type') == 'flash': ++ return \ ++ _("Video configuration unavailable for Flash install") ++ return "" + + class VariableHrVideoId(ReadonlyVariable): + """ +@@ -258,21 +285,3 @@ class VariableOsInstallFbResolution(ResolutionVariable): + int(cxx11) >= int(cxfb) and int(cyx11) >= int(cyfb): + resolution = "%s-32"%textLines[0] + return resolution or "1024x768-32" +- +-class VariableOsInstallX11ServerSet(ReadonlyVariable): +- """ +- Is install xorg-server +- """ +- type = "bool" +- +- def get(self): +- try: +- image = self.Get('cl_image') +- if image: +- with image as distr: +- distrPath = image.getDirectory() +- if isPkgInstalled('xorg-server',prefix=distrPath): +- return "yes" +- except: +- pass +- return "no" +diff --git install/variables/__init__.py install/variables/__init__.py +index 9590a0d..88cfc35 100644 +--- install/variables/__init__.py ++++ install/variables/__init__.py +@@ -25,5 +25,6 @@ import system + import X11 + import lvm + import autopartition ++import audio + + section = "install" +diff --git install/variables/audio.py install/variables/audio.py +new file mode 100644 +index 0000000..0243ec3 +--- /dev/null ++++ install/variables/audio.py +@@ -0,0 +1,121 @@ ++#-*- coding: utf-8 -*- ++ ++# Copyright 2008-2013 Calculate Ltd. http://www.calculate-linux.org ++# ++# Licensed under the Apache License, Version 2.0 (the "License"); ++# you may not use this file except in compliance with the License. ++# You may obtain a copy of the License at ++# ++# http://www.apache.org/licenses/LICENSE-2.0 ++# ++# Unless required by applicable law or agreed to in writing, software ++# distributed under the License is distributed on an "AS IS" BASIS, ++# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++# See the License for the specific language governing permissions and ++# limitations under the License. ++ ++import os ++import sys ++import re ++from os import path ++from calculate.lib.datavars import (Variable, VariableError, ReadonlyVariable, ++ ReadonlyTableVariable, FieldValue) ++from calculate.lib.utils.files import (readFile, getProgPath, process) ++ ++from calculate.lib.cl_lang import setLocalTranslate ++setLocalTranslate('cl_install3',sys.modules[__name__]) ++ ++class VariableOsAudioData(ReadonlyTableVariable): ++ """ ++ Information about audio cards ++ """ ++ source = ['os_audio_id', ++ 'os_audio_name'] ++ ++ def get(self,hr=False): ++ alsaInfo = getProgPath('/usr/bin/alsa-info') ++ if not alsaInfo: ++ return [[]] ++ entry = re.compile('^Card hw:(\d+)\s*[^/]+/\'(.*?) at .*$') ++ return tuple(map(lambda x:x.groups(), ++ filter(None,map(entry.search, ++ process(alsaInfo,'--stdout',envdict=os.environ))))) ++ ++ setValue = Variable.setValue ++ ++class VariableOsAudioId(FieldValue,ReadonlyVariable): ++ """ ++ Order Id of audio card ++ """ ++ type = "list" ++ source_variable = "os_audio_data" ++ column = 0 ++ ++class VariableOsAudioName(FieldValue,ReadonlyVariable): ++ """ ++ Name of audio card ++ """ ++ type = "list" ++ source_variable = "os_audio_data" ++ column = 1 ++ ++class VariableOsAudioDefaultSet(ReadonlyVariable): ++ """ ++ Force write in config 0 ++ """ ++ type = "bool" ++ ++ def get(self): ++ res = self.Select('os_audio_id',where='os_audio_name', ++ notlike='HDMI',limit=1) ++ audioDefault = self.Get('os_audio_default') ++ if audioDefault != '0' or \ ++ res and res != "0" and audioDefault == '0' or \ ++ audioDefault != self.Get('os_audio_current'): ++ return 'on' ++ return 'off' ++ ++class VariableOsAudioCurrent(ReadonlyVariable): ++ """ ++ Current default audio card ++ """ ++ ++ def get(self): ++ defaultCardRe = re.compile('defaults.ctl.card\s+(\d+)') ++ entry = defaultCardRe.search(readFile('/etc/asound.conf')) ++ if entry and entry.groups()[0] in self.Get('os_audio_id'): ++ return entry.groups()[0] ++ res = self.Select('os_audio_id',where='os_audio_name', ++ notlike='HDMI',limit=1) ++ return res or '0' ++ ++class VariableOsAudioDefault(Variable): ++ """ ++ Current default audio card ++ """ ++ type = "choice" ++ opt = ['--audio'] ++ ++ def init(self): ++ self.label = _("Default audio card") ++ self.help = _("set the default audio") ++ ++ def get(self): ++ return self.Get('os_audio_current') ++ ++ def choice(self): ++ data = self.Get('os_audio_data') ++ if data and data[0]: ++ return self.Get('os_audio_data') ++ return [] ++ ++ def uncompatible(self): ++ """ ++ Audio setting up unavailable for flash installation ++ """ ++ if self.Get('os_install_root_type') == 'flash': ++ return _("Audio configuration unavailable for Flash install") ++ if self.Get('os_install_alsa_set') == 'off': ++ return \ ++ _("This distribution does not provide the alsa sound") ++ return "" +diff --git install/variables/autopartition.py install/variables/autopartition.py +index f00dd9a..452c0e0 100644 +--- install/variables/autopartition.py ++++ install/variables/autopartition.py +@@ -54,6 +54,27 @@ class Sizes(object): + else: + raise AttributeError + ++class SizeHelper: ++ def set(self,value): ++ # convert table from value to MB ++ sizeMap = {'kB':1/1000.0, ++ 'K':1/1024.0, ++ 'M':1.0, ++ 'Mb':1000/1024.0, ++ 'G':1024, ++ 'Gb':1000, ++ 'T':1024*1024, ++ 'Tb':1000*1000} ++ value = value.strip() ++ reSizeValue = re.compile('^(\d+)\s*(%s)?'%"|".join(sizeMap.keys())) ++ res = reSizeValue.search(value) ++ if not res: ++ return "0" ++ intValue = int(res.group(1)) ++ if res.group(2): ++ intValue = intValue * sizeMap[res.group(2)] ++ return str(int(intValue)) ++ + MINROOTSIZE=7*Sizes.G + + class AutopartitionError(Exception): +@@ -66,7 +87,7 @@ class AutoPartition: + """ + Autopartition maker + """ +- def recreateSpace(self,table,device,data,lvm,vgname,bios_grub): ++ def recreateSpace(self,table,device,data,lvm,vgname,bios_grub,bios_grub_size): + """ + Recreate disk space by table device data lvm flag and vgname + +@@ -77,23 +98,23 @@ class AutoPartition: + vgname lvm Volume Group Name + """ + if lvm: +- self.recreateLvm(table,device,data,vgname,bios_grub) ++ self.recreateLvm(table,device,data,vgname,bios_grub,bios_grub_size) + else: +- self.recreatePartitionTable(table,device,data,bios_grub) ++ self.recreatePartitionTable(table,device,data,bios_grub,bios_grub_size) + refreshUdev() + +- def recreatePartitionTable(self,table,device,data,bios_grub): ++ def recreatePartitionTable(self,table,device,data,bios_grub,bios_grub_size): + """ + """ + mapDispatch = {'dos':self.recreatePartitionTableDos, + 'gpt':self.recreatePartitionTableGpt} + if table in mapDispatch: +- mapDispatch[table](device,data,bios_grub) ++ mapDispatch[table](device,data,bios_grub,bios_grub_size) + else: + raise AutoPartitionError( + _('Autopartitioning for %s is not supported')%table) + +- def recreatePartitionTableDos(self,device,data,bios_grub): ++ def recreatePartitionTableDos(self,device,data,bios_grub,bios_grub_size): + """ + Create DOS partition table by /sbin/fdisk + """ +@@ -125,7 +146,8 @@ class AutoPartition: + fdisk.success() + self._waitDevice(device[0]+str(num-1)) + +- def recreatePartitionTableGpt(self,device,data,bios_grub=True): ++ def recreatePartitionTableGpt(self,device,data,bios_grub=True, ++ bios_grub_size=0): + """ + Create GPT partition table by /sbin/gdisk + """ +@@ -136,7 +158,7 @@ class AutoPartition: + WRITE_AND_QUIT = "w\ny\n" + + BIOS_BOOT_PART_NUM = 4 +- BIOS_BOOT_PART_SIZE = "2M" ++ BIOS_BOOT_PART_SIZE = "%dM"%(int(bios_grub_size) / Sizes.M) + + fdiskProg = getProgPath('/usr/sbin/gdisk') + fdisk = process(fdiskProg,device[0]) +@@ -251,7 +273,7 @@ class AutoPartition: + '--zero-superblock',disk_dev) + return not failed + +- def recreateLvm(self,table,devices,data,vgname,bios_grub): ++ def recreateLvm(self,table,devices,data,vgname,bios_grub,bios_grub_size): + """ + Create GPT partition table by /sbin/gdisk + """ +@@ -260,10 +282,12 @@ class AutoPartition: + DEV,MP,FS,SIZE,TABLE=0,1,2,3,4 + notInLvm = filter(lambda x:"boot" in x[MP],data) + self.recreatePartitionTable(table, +- [device],notInLvm+[['','','','allfree']],bios_grub) ++ [device],notInLvm+[['','','','allfree']],bios_grub, ++ bios_grub_size) + else: + self.recreatePartitionTable(table, +- [device],[['','','','allfree']],bios_grub) ++ [device],[['','','','allfree']],bios_grub, ++ bios_grub_size) + + lvmPartOffset = 1 + len(notInLvm) + iPart = [lvmPartOffset]+[1]*(len(devices)-1) +@@ -365,18 +389,27 @@ class VariableHrMemorySize(ReadonlyVariable): + def humanReadable(self): + return humanreadableSize(self.Get()) + +-class VariableClAutopartitionSwapSize(Variable): ++class VariableClAutopartitionSwapSize(SizeHelper,AutopartitionHelper,Variable): + """ + Swap size + """ +- type = "int" ++ opt = ["--swap-size"] ++ metavalue = "SIZE" ++ untrusted = True ++ ++ def init(self): ++ self.label = _("Swap partition size")+ " (MB)" ++ self.help = _("set the swap partition size for autopartition") + + def get(self): +- size = self.Get('hr_memory_size') +- if size < Sizes.G: +- size = Sizes.G ++ size = int(self.Get('hr_memory_size')) / Sizes.M ++ if size < Sizes.K: ++ size = Sizes.K + return str(size) + ++ def humanReadable(self): ++ return humanreadableSize(int(self.Get())*Sizes.M) ++ + class VariableClAutopartitionDevice(AutopartitionHelper,Variable): + """ + Device for autopartition +@@ -537,8 +570,7 @@ class VariableClAutopartitionScheme(AutopartitionHelper,Variable,AutoPartition): + raise VariableError( + _("The bios_grub partition need the partition table to be GPT")) + +- +-class VariableClAutopartitionRootSize(AutopartitionHelper,Variable): ++class VariableClAutopartitionRootSize(SizeHelper,AutopartitionHelper,Variable): + """ + Root partition size for autopartition + """ +@@ -560,26 +592,6 @@ class VariableClAutopartitionRootSize(AutopartitionHelper,Variable): + size = max(Sizes().to_M(deviceSize),Sizes().to_M(MINROOTSIZE)) + return str(size) + +- def set(self,value): +- # convert table from value to MB +- sizeMap = {'kB':1/1000.0, +- 'K':1/1024.0, +- 'M':1.0, +- 'Mb':1000/1024.0, +- 'G':1024, +- 'Gb':1000, +- 'T':1024*1024, +- 'Tb':1000*1000} +- value = value.strip() +- reSizeValue = re.compile('^(\d+)\s*(%s)?'%"|".join(sizeMap.keys())) +- res = reSizeValue.search(value) +- if not res: +- return "0" +- intValue = int(res.group(1)) +- if res.group(2): +- intValue = intValue * sizeMap[res.group(2)] +- return str(int(intValue)) +- + def check(self,value): + if self.Get('cl_autopartition_device') and \ + self.Get('cl_autopartition_set') == "on": +@@ -588,6 +600,9 @@ class VariableClAutopartitionRootSize(AutopartitionHelper,Variable): + _("The root partition should be at least {size}").format( + size="7 Gb")) + ++ def humanReadable(self): ++ return humanreadableSize(int(self.Get())*Sizes.M) ++ + class VariableClAutopartitionTable(AutopartitionHelper,Variable): + """ + Partition table for autopartition +@@ -855,7 +870,8 @@ class VariableClAutopartitionDiskSize(ReadonlyVariable,AutopartitionHelper): + availSize = self.Get('cl_autopartition_device_size') + if device: + return list(self.generateSize(scheme, +- self.Get('cl_autopartition_swap_size'), ++ str(int(self.Get('cl_autopartition_swap_size')) ++ *Sizes.M), + self.Get('cl_autopartition_boot_size'), + self.Get('cl_autopartition_uefi_size'), + str(int(self.Get('cl_autopartition_root_size')) +@@ -880,6 +896,12 @@ class VariableClAutopartitionBootSize(Variable): + """ + value = str(512*Sizes.M) + ++class VariableClAutopartitionBiosGrubSize(Variable): ++ """ ++ Размер раздела bios_grub для авторазметки ++ """ ++ value = str(10*Sizes.M) ++ + class VariableClAutopartitionDeviceSize(ReadonlyVariable): + """ + Available devices size +diff --git install/variables/disk.py install/variables/disk.py +index 97cb014..ef0f9e2 100644 +--- install/variables/disk.py ++++ install/variables/disk.py +@@ -29,6 +29,7 @@ from calculate.lib.utils.device import (getUdevDeviceInfo,getDeviceType, + getPartitionType,getPartitionDevice,getRaidPartitions, + getLvmPartitions,getPartitionSize, humanreadableSize, + getUUIDDict,getCommonDeviceName) ++from calculate.install.variables.autopartition import Sizes + from calculate.lib.utils.files import (listDirectory,pathJoin,readFile,FStab, + isMount) + from calculate.install.distr import PartitionDistributive +@@ -1682,6 +1683,10 @@ class VariableOsInstallMbr(LocationHelper,Variable): + _("For Flash install, you need only one disk")) + if self.Get('os_install_uefi_set') == 'on': + return ++ useBtrfs = "btrfs" in self.Select('os_install_disk_format', ++ where='os_install_disk_mount', ++ _in=('/','/boot'), ++ sort="DESC")[:1] + for mbrDisk in value: + if self.Get('cl_autopartition_set') == 'on': + tableOnBootDisk = self.Get('cl_autopartition_table') +@@ -1696,12 +1701,27 @@ class VariableOsInstallMbr(LocationHelper,Variable): + if tableOnBootDisk == "gpt": + raise VariableError(_("You need a disk with a dos " + "table for Flash install")) ++ if tableOnBootDisk == "dos" and useBtrfs: ++ raise VariableError(_("You need a disk with a gpt " ++ "table for install on btrfs")) + if rootType in ("usb-hdd","hdd") and tableOnBootDisk == "gpt": +- bios_grub = self.Select('os_disk_parent', +- where='os_disk_id',eq='EF02') +- if not mbrDisk in bios_grub: ++ efisize = self.Select('os_disk_size', ++ where=['os_disk_id','os_disk_parent'], ++ func=lambda os_disk_id,os_disk_parent:( ++ os_disk_id == 'EF02' and os_disk_parent == mbrDisk), ++ limit=1) ++ if not efisize: + raise VariableError( + _("Disk %s must have a 'bios_grub' partition")%mbrDisk) ++ # проверка размера EF02 при установке на btrfs ++ elif useBtrfs: ++ bios_grub_size = self.Get('cl_autopartition_bios_grub_size') ++ if (efisize.isdigit() and bios_grub_size.isdigit() and ++ int(efisize) < int(bios_grub_size)): ++ raise VariableError( ++ _("Disk {diskname} must have a 'bios_grub' " ++ "partition with size at least {size}Mb").format( ++ diskname=mbrDisk,size=int(bios_grub_size)/Sizes.M)) + if value: + if self.Get('os_grub2_path'): + self.checkForGrub2() +@@ -1709,12 +1729,14 @@ class VariableOsInstallMbr(LocationHelper,Variable): + self.checkForLegacyGrub() + + def checkForGrub2(self): +- """Check current disk configuration for installation for install +- GRUB2""" ++ """ ++ Проверить текущую конфигурацию диска для установки GRUB2 ++ """ + grubDiskType=self.Select('os_install_disk_parent', + where='os_install_disk_mount', + _in=('/','/boot'), + sort="DESC",limit=1) ++ + if "lvm-raid" in grubDiskType: + raise VariableError( + _("Grub does not support booting from a RAID assembled from a LVM") +diff --git install/variables/net.py install/variables/net.py +index fa3e28b..d8d22f6 100644 +--- install/variables/net.py ++++ install/variables/net.py +@@ -84,7 +84,7 @@ class VariableOsInstallNetInterfaces(NetHelper,ReadonlyVariable): + self.label = _("Interface") + + def get(self): +- return getInterfaces() ++ return sorted(getInterfaces()) + + class VariableOsInstallNetInterfacesOrig(NetHelper,ReadonlyVariable): + """ +@@ -150,10 +150,17 @@ class VariableOsInstallNetData(NetHelper,TableVariable): + "os_install_net_mac"] + + def init(self): ++ def defaultInterface(): ++ ifaces = getInterfaces() ++ if ifaces: ++ return ifaces[0] ++ else: ++ return "enp0s0" + self.label = _("Addresses") + # self.help = _("IP address with network (example:%s)")%"192.168.1.1/24" + self.help = _("Network interface, DHCP or IP address and network mask " +- "(example: %s)")%" --iface eth0:192.168.1.1:24" ++ "(example: %s)")%(" --iface %s:192.168.1.1:24"% ++ defaultInterface()) + + def raiseReadonlyIndexError(self,fieldname="",variablename="", + value=""): +@@ -453,7 +460,7 @@ class VariableOsInstallNetRouteData(NetHelper,TableVariable): + def getHumanReadableAuto(self): + return Variable.getHumanReadableAuto(self) + +- def setValue(self,value): ++ def setValue(self,value,force=False): + """ + Standard action for set value + """ +@@ -461,7 +468,8 @@ class VariableOsInstallNetRouteData(NetHelper,TableVariable): + self.wasSet = True + self.invalid = False + # run check +- self._check() ++ if not force: ++ self._check() + + class VariableOsInstallNetRouteNetwork(FieldValue,NetHelper,Variable): + """ +diff --git install/variables/system.py install/variables/system.py +index 1d32d8c..a9193b6 100644 +--- install/variables/system.py ++++ install/variables/system.py +@@ -47,21 +47,17 @@ class UserHelper: + """ + if self.Get('os_install_root_type') == 'flash': + return _("User configuration unavailable for Flash install") +- if self.Get('os_install_x11_server_set') == 'no' and self.xorg_need: ++ if self.Get('os_install_x11_server_set') == 'off' and self.xorg_need: + return _("Autologin is available for Xorg sessions only") + return "" + +-class VariableOsInstallScratch(Variable): ++class VariableOsInstallScratch(ReadonlyVariable): + """ + Install system in scratch mode + """ + type = "bool" + opt = ['--build'] + +- def init(self): +- self.label = _("Builder mode") +- self.help = _("build installation") +- + def get(self): + # for installation default - normal system + if self.Get('cl_action') == 'system': +@@ -69,25 +65,6 @@ class VariableOsInstallScratch(Variable): + else: + return self.Get('os_scratch') + +- def check(self,value): +- if value == "on": +- # scratch not use for falsh and multipartition +- if self.Get('os_install_root_type') == "flash": +- raise VariableError( +- _("Flash install does not support the builder mode")) +- if filter(lambda x: not x in ('/','swap','/boot/efi'), +- self.Get('os_install_disk_mount')): +- raise VariableError( +- _("The builder mode does not support " +- "multipartition install")) +- +- def uncompatible(self): +- """ +- Unavailable for flash installation +- """ +- if self.Get('os_install_root_type') == 'flash': +- return _("Flash install does not support the builder mode") +- + class VariableOsFormatType(ReadonlyVariable): + """ + Filesystem format support by calcualte-install +@@ -504,11 +481,13 @@ class VariableOsInstallMdadmSet(ReadonlyVariable): + class VariableClChrootGrub(ReadonlyVariable): + """ + Chroot for grub-mkconfig +- TODO: check for install scratch system. + """ + def get(self): + if self.Get('os_install_scratch') == "on": +- return path.join(self.Get('cl_chroot_path'),"mnt/scratch") ++ if self.Get('cl_action') == 'system': ++ return self.Get('cl_target').mdirectory ++ else: ++ return path.join(self.Get('cl_chroot_path'),"mnt/scratch") + else: + return self.Get('cl_chroot_path') + +@@ -690,86 +669,41 @@ class VariableOsInstallGrubTerminal(Variable): + return _("Grub configuration unavailable for Flash install") + return "" + +-class VariableOsAudioData(ReadonlyTableVariable): ++class PackageCheckHelper(ReadonlyVariable): + """ +- Information about audio cards ++ Конструктор для переменных проверки установлен ли пакет + """ +- source = ['os_audio_id', +- 'os_audio_name'] +- +- def get(self,hr=False): +- """LVM hash""" +- aplay = getProgPath('/usr/bin/aplay') +- if not aplay: +- return [[]] +- entry = re.compile('^card (\d+): ([^:]+)') +- return tuple(map(lambda x:x.groups(), +- filter(None,map(entry.search, +- process(aplay,'-l'))))) +- +- setValue = Variable.setValue ++ image = False ++ package = None ++ type = "bool" + +-class VariableOsAudioId(FieldValue,ReadonlyVariable): +- """ +- Order Id of audio card +- """ +- type = "list" +- source_variable = "os_audio_data" +- column = 0 ++ def get(self): ++ try: ++ if self.image: ++ image = self.Get('cl_image') ++ if image: ++ with image as distr: ++ distrPath = image.getDirectory() ++ if isPkgInstalled(self.package,prefix=distrPath): ++ return "on" ++ else: ++ if isPkgInstalled(self.package): ++ return "on" ++ except: ++ pass ++ return "off" + +-class VariableOsAudioName(FieldValue,ReadonlyVariable): +- """ +- Name of audio card +- """ +- type = "list" +- source_variable = "os_audio_data" +- column = 1 + +-class VariableOsAudioDefaultSet(ReadonlyVariable): ++class VariableOsInstallAlsaSet(PackageCheckHelper): + """ +- Force write in config 0 ++ Установлен ли media-sound/alsa-utils + """ +- type = "bool" ++ image = True ++ package = "media-sound/alsa-utils" + +- def get(self): +- res = self.Select('os_audio_id',where='os_audio_name', +- notlike='HDMI',limit=1) +- audioDefault = self.Get('os_audio_default') +- if audioDefault != '0' or \ +- res and res != "0" and audioDefault == '0': +- return 'on' +- return 'off' +- +-class VariableOsAudioDefault(Variable): ++class VariableOsInstallX11ServerSet(PackageCheckHelper): + """ +- Current default audio card ++ Установлен ли x11-base/xorg-server + """ +- type = "choice" +- opt = ['--audio'] +- +- def init(self): +- self.label = _("Default audio card") +- self.help = _("set the default audio") +- +- def get(self): +- defaultCardRe = re.compile('defaults.ctl.card\s+(\d+)') +- entry = defaultCardRe.search(readFile('/etc/asound.conf')) +- if entry and entry.groups()[0] in self.Get('os_audio_id'): +- return entry.groups()[0] +- res = self.Select('os_audio_id',where='os_audio_name', +- notlike='HDMI',limit=1) +- return res or '0' +- +- def choice(self): +- data = self.Get('os_audio_data') +- if data and data[0]: +- return self.Get('os_audio_data') +- return [] +- +- def uncompatible(self): +- """ +- Audio setting up unavailable for flash installation +- """ +- if self.Get('os_install_root_type') == 'flash': +- return _("Audio configuration unavailable for Flash install") +- return "" ++ image = True ++ package = "x11-base/xorg-server" +diff --git install/wsdl_install.py install/wsdl_install.py +index 7d0a51f..511e16c 100644 +--- install/wsdl_install.py ++++ install/wsdl_install.py +@@ -69,15 +69,17 @@ class Wsdl(WsdlBase): + 'cl_image_new_only')), + lambda group:group(_("Allocate drive space"), + normal=('cl_autopartition_set',), +- expert=('cl_autopartition_scheme','cl_autopartition_device', +- 'cl_autopartition_table','cl_autopartition_root_size'), ++ expert=('cl_autopartition_scheme', ++ 'cl_autopartition_table','cl_autopartition_root_size', ++ 'cl_autopartition_swap_size', ++ 'cl_autopartition_device'), + expert_label=_("Click to set up autopartition options")), + lambda group:group(_("Mount points"), + normal=('os_location_data',), + hide=('os_location_data','os_install_mbr','os_install_uefi_set'), + brief_force=('os_location_brief_data','os_install_bootloader', + 'os_install_uefi_set'), +- expert=('os_install_scratch','cl_uuid_set', ++ expert=('cl_uuid_set', + 'os_install_root_type', + 'os_install_mbr', + 'os_install_uefi_set', diff --git a/sys-apps/calculate-lib/Manifest b/sys-apps/calculate-lib/Manifest index cf1b572c1..c1a7726cf 100644 --- a/sys-apps/calculate-lib/Manifest +++ b/sys-apps/calculate-lib/Manifest @@ -8,6 +8,7 @@ AUX calculate-lib-3.1.6-r7.patch 18897 SHA256 c69c10571632e477023fbf7ccbb7ca9ed6 AUX calculate-lib-3.1.8-r1.patch 964 SHA256 db745543d0c3f0e1830058b9adaec8a5ed81a85f554a87cfa4980b61083c169d SHA512 eba607867835038cfed70790dd76bb9b28a0ddef0209d277fd08ea654ff423e63d835c9581b1a14c8a59923b2bd25c4c3ad3d1720b6b04269a0e5173b108e30b WHIRLPOOL 6ae59d7b577f115f494776076a94a21f8d51b40bb02dc8e7d614acd411d9bde68c8c3b82b06e49abd869af433b364a5cc5e43ad7d752035e99027731be380e80 AUX calculate-lib-3.1.8-r2.patch 1530 SHA256 bc7c287837bc1e2c360ff3c23bff6ce2c8d3a32a25aa90ec93e5a61afb7799c4 SHA512 c91f42e4540c04b307899a6716b6bb207ae810ae1fba71118886bf53fea411fbfbfa8340423008202e336e5fb4da5f4e8657e945b206eb4ee525b20ae9ebf921 WHIRLPOOL 0103b4365ac0e4f25bca20a16ebe994d6f9cb449f7c4862adbc97001c4fabf763d7f51b322a679ce02f4d8280bb602824f8b15ee6ab76eafee00ffdc563c510e AUX calculate-lib-3.1.8-r3.patch 3388 SHA256 b0d8c4611aa43dbc4c6a38b642d8970ef5abb040fb20e515abecd55e51d8316f SHA512 cb6fc3d87f244a172e2ebc089c8d73255d6aa70ce3e1f0039b03be0ed78c430bd9c3844bd4838ea1e02e8b248a0d203824014144874852843319c43aa9ae4885 WHIRLPOOL 11f73712ef5ed75ac6589ff7443b52e5c9a84c64e0ed6121fe05a3a5c54b8ee591e6f7deba96b935374d19367eab45757683d3e248eeb87b9c55845bd7297117 +AUX calculate-lib-3.1.8-r4.patch 3834 SHA256 ac7a72672237ab7ea52331fc9fca1e57000502e0b3ed601b8ef6147c81c40720 SHA512 ca76b00282c0155dfe1311fc3ca8eb37308c7465ebd358e9b09581e197b65c501d703c9e0bf97177f48ac141e854b0c4880b4dde62e7ec3711bd330c79d5493f WHIRLPOOL 80cb3116fdf7be95f77de750c0dee7fd7165ae29b76aa2bd33adff6d4c7366925ffe3c6fc7b8c00313bb5b562dcd36484bb993af6723bab6d8e5fd0c31fbf19b DIST calculate-lib-2.1.11.tar.bz2 61687 SHA256 62976c08d4fb4810389ace6f5a99abb5a962f6c8d9053ff943d0669480fb5599 SHA512 e3bc2168a55367cf19ad3a27921b53e5e845643238bf171209ab29752c91b5d4d338a2120774764ac1c79abd93f2deff8680f8faa1407940984ea9fd6a199e67 WHIRLPOOL 0ced92ea493dd8db02b0ae1514ebbb51ee76dc6f441b4a38c984c39da2121fb81dd1f2e840c4c5b71a117a12817a2a269d85676288202aa9801f69727e3338dc DIST calculate-lib-2.2.31.tar.bz2 120044 SHA256 ba38052d8b2349a1c60adc589a74eb8a3ffcbf6f3c1124e4c1fb0da3aa777f12 SHA512 902871b9159f2bcf7a0cc767fb6df5b19902fce6cf9468d96f902c383a422738b65debe3094c92d1f82de2124936496f89631c6eb9670da00807b63156b101b7 WHIRLPOOL 5179ee691519f3a7faa3135d040ad64bd6d67c026ebf39bb17f7d641130a2b58641d1fe5da4f6cfbd45d4442d93508f0a5f641ef2cd8c43e1a322aab3d11f4b9 DIST calculate-lib-3.1.6.tar.bz2 121830 SHA256 4dc08cb3246b533466457905d4fe44f7ee75266b66e8450ac7ddcb3d210980ca SHA512 578fa1f731c7b04b061abb68de8ceeb5e7cadac6858a7957f3e57f7249f9692965419da05bf3c16963c397ddbbc10a24ea5c7feda043d067f0274a52d2c56dac WHIRLPOOL ceea0a4719a5c8a0ef645f51f07bb7f813ecdb8fe8ed99f574523cd2c242223eec92c6078a15192d40a366e8231b6ff72acf63954b7f48d0f34e5c006f2eca95 @@ -20,6 +21,7 @@ EBUILD calculate-lib-3.1.6-r7.ebuild 824 SHA256 5aab4e17277422301131329e5204459c EBUILD calculate-lib-3.1.8-r1.ebuild 824 SHA256 efdb1261df13aafc739f3ba52f278752c80679ed5e562a6384b1fbbfa6cb669e SHA512 471c37f8bc2cb1926493d16acdbacac3d0c672ff6e0bfe59830e3bae1e5b9db1c47b23204128585740ae3b8c949a70d91ff7d9ed64d15b2a12e45d4772aae782 WHIRLPOOL afc350072644d970cf149e78fccc832e47347e89b4c02cfc8bb9f2f2257e8c07539c2b08b3f75a8d01d8bd75a9bf44cf171b3ded0c417ef08ed303948aa1bba9 EBUILD calculate-lib-3.1.8-r2.ebuild 824 SHA256 b8cf32c88f2db3f0ca7a99aafc39dc7373dac01afb3a03d593d0a1a6b4dc1d20 SHA512 67ccef05830100d64cca2d449bed7a7fb52b21e75760f6e64e5247943ef5daadab123b23d452cd980c992fa308b072411b73ea3e93a20e1cd4a9dd28da3201e2 WHIRLPOOL 05554bfe0a2013447b81ba9deee432f63379b659fbb9feb07b43b15ec62e6cbfdd8c6bc7aedd3fa1ae094efdd78d1a321508e2d53e4a6e2219f70c1f4ef78e1f EBUILD calculate-lib-3.1.8-r3.ebuild 824 SHA256 4fb3da3e834c22ef032cd497e99835aa7ab2c31cb9e8cd0a6cdbe6b1cc5d2a15 SHA512 9c272fdf3e3178e7d6b0bb2ddd9526540458844012581c0fcdef3a7d979744324027ad00056104467d9d6dcc8ae1d5e4f3b884735c14dba04f8d1170e497e5a5 WHIRLPOOL 6467bab45690a1bf336c90f5e5f6ee7d95e51f06160983d6c38d857d182d06e28d7017f6c167956afa77af1f1a384831e3741e357911ad6083efcfa951afcc53 +EBUILD calculate-lib-3.1.8-r4.ebuild 824 SHA256 4e1232bd35181b158e3813c7623f4e93d77289d88247c825757a11a7f69d62dd SHA512 34705e68a1128a3409489bff1cfb3153e090edd4ab9c62ea961f0bcfa30f807d28aea6f653d3a221ae6f7c61608fd3e6a64596fc182c78d0ccd022d3787bd652 WHIRLPOOL 27fbe25423e9bf661efd5da606d0702793c901497da9d552457d4d75c47088cb7ba5bf405d56caaa82b173637efddce0b004ffc8f22d7543a15412eda5b17f19 EBUILD calculate-lib-3.1.8.ebuild 690 SHA256 c89c29f5de3f70146e98f15035366506933f03e8a5066b1ad55aeccbebdeae2c SHA512 a7277c2e5fa64a5e5840be7fc8d3df9a31f41926386c5fe6a9bed31eeed6321af5881c218d9ce7eeb12aee518edb682b438e10397dcb815cc63645100430e43e WHIRLPOOL 8f19e4d46381e26fec81e20fa35599f4658b3891d6372c921a8b1354ad3b1821ea9c78f71caebf54610e0b5aacfb6e6ded018e155e1979322406a0ac1e823d09 EBUILD calculate-lib-3.1.9999.ebuild 708 SHA256 a1d64b7f014831bf6b0a38928d53cb55758b7a12e5f3e98fffd28025ffacbce1 SHA512 3873859a791941d421e2338b437521955da383ce986408f1a951305e2dd75a1a4f771c9ec2caa096c5c8ea6a1776d6d0ed99e025ffa786ba029cafdbadfa439b WHIRLPOOL 5ac1a10b53f810ab527a0ebe52bc87e8397e61375cf6e0acbed89d8f6b8385e72bf234e0fdce479c3a3f1652bb6e520710ce9356750a97d644c0db0a33f6facb MISC ChangeLog 29851 SHA256 16ca15c794bce78eefc487ed372c3d4960078fbd4c5fe4524211688d0146ef97 SHA512 be6bdf290f391529dce0deb67bf9d367e42e407601dd581f7c08d082399b5860cff2a76d4d64dd876154d51e84f34499db06c715145ac64f78d168aae7e78dbf WHIRLPOOL 2561ccd1eefe3423d97c67aff5c0fe6c8ca624e527fb885b042c8e812194bb1635d7e7d7d86c534562eb780c6b9144d92e24893f2d0696cf8a34a6a912a45788 diff --git a/sys-apps/calculate-lib/calculate-lib-3.1.8-r4.ebuild b/sys-apps/calculate-lib/calculate-lib-3.1.8-r4.ebuild new file mode 100644 index 000000000..aa94ce134 --- /dev/null +++ b/sys-apps/calculate-lib/calculate-lib-3.1.8-r4.ebuild @@ -0,0 +1,36 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI="3" +SUPPORT_PYTHON_ABIS="1" +PYTHON_DEPEND="2:2.7" +RESTRICT_PYTHON_ABIS="2.4 2.5 2.6 3.*" + +inherit distutils eutils + +SRC_URI="ftp://ftp.calculate.ru/pub/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="amd64 x86" +IUSE="minimal" +DEPEND="!minimal? ( dev-python/py-smbpasswd ) + >=dev-python/pyxml-0.8 + sys-apps/iproute2 + sys-apps/pciutils + 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.1.8-r4.patch" +} diff --git a/sys-apps/calculate-lib/files/calculate-lib-3.1.8-r4.patch b/sys-apps/calculate-lib/files/calculate-lib-3.1.8-r4.patch new file mode 100644 index 000000000..624dbadd4 --- /dev/null +++ b/sys-apps/calculate-lib/files/calculate-lib-3.1.8-r4.patch @@ -0,0 +1,107 @@ +diff --git calculate/lib/cl_ldap.py calculate/lib/cl_ldap.py +index b4ee12c..802ded4 100644 +--- calculate/lib/cl_ldap.py ++++ calculate/lib/cl_ldap.py +@@ -251,6 +251,7 @@ class ldapUser(_error): + if not self.ldapObj: + ldapObj = ldapFun(bindDn, bindPw, host) + if ldapObj.getError(): ++ ldapObj.clearErrors() + return False + # Устанавливаем у объекта соединение и объект LDAP функций + self.ldapObj = ldapObj +diff --git calculate/lib/cl_template.py calculate/lib/cl_template.py +index 14912c6..6c98b35 100644 +--- calculate/lib/cl_template.py ++++ calculate/lib/cl_template.py +@@ -3948,7 +3948,7 @@ re.M|re.S) + def executeTemplate(self, code, execPath): + """Execute template""" + p = process(execPath,lang=self.objVar.Get('os_locale_locale'), +- envdict=os.environ) ++ envdict=dict(os.environ)) + if "/bin/bash" in code.partition('\n')[0]: + p.write("""function translate() { + gettext -d cl_template "$*" +diff --git calculate/lib/datavars.py calculate/lib/datavars.py +index ffae995..1f57029 100644 +--- calculate/lib/datavars.py ++++ calculate/lib/datavars.py +@@ -263,15 +263,15 @@ class Variable: + section = self.parent.iniCache[self.name]['section'] + value = self.parent.unserialize(self.type, + value.encode('utf-8')) +- try: +- if self.mode == READONLY: +- raise VariableError( +- _("Attempt to rewrite readonly variable %s")% +- varname) +- else: ++ if self.mode == READONLY: ++ raise VariableError( ++ _("Attempt to rewrite readonly variable %s")% ++ self.name) ++ else: ++ try: + self._set(value) +- except Exception as e: +- return False ++ except Exception as e: ++ return False + return True + + def _get(self): +@@ -1305,7 +1305,10 @@ class DataVars(SimpleDataVars): + if zipVars is None: + zipVars = self.ZipVars + if func: +- filterFunc = func ++ if func.func_code.co_argcount > 1: ++ filterFunc = lambda x:func(*x[:func.func_code.co_argcount]) ++ else: ++ filterFunc = func + elif eq != None: + filterFunc = lambda x:x[0] == eq + elif ne != None: +diff --git calculate/lib/utils/common.py calculate/lib/utils/common.py +index a334435..9f13c66 100644 +--- calculate/lib/utils/common.py ++++ calculate/lib/utils/common.py +@@ -51,7 +51,7 @@ class _error: + return True + + def clearErrors(self): +- for i in range(len(self.error)): ++ while(self.error): + self.error.pop() + + class _warning: +diff --git calculate/lib/variables/__init__.py calculate/lib/variables/__init__.py +index 5004263..6608f3a 100644 +--- calculate/lib/variables/__init__.py ++++ calculate/lib/variables/__init__.py +@@ -41,4 +41,4 @@ class VariableClVer(ReadonlyVariable): + """ + Package version + """ +- value = "3.1.8" ++ value = "3.1.8.1" +diff --git calculate/lib/variables/system.py calculate/lib/variables/system.py +index 70bcf87..1e43f15 100644 +--- calculate/lib/variables/system.py ++++ calculate/lib/variables/system.py +@@ -154,3 +154,14 @@ class VariableClUsedAction(ReadonlyVariable): + type = "table" + def get(self): + return [] ++ ++class VariableClSystemBootSet(ReadonlyVariable): ++ """ ++ Система находится в стадии загрузки ++ """ ++ type = "bool" ++ def get(self): ++ if os.readlink('/proc/self/fd/0') == '/dev/console': ++ return "on" ++ else: ++ return "off" diff --git a/sys-apps/calculate-utilities/Manifest b/sys-apps/calculate-utilities/Manifest index 11a9b5ab3..396207e55 100644 --- a/sys-apps/calculate-utilities/Manifest +++ b/sys-apps/calculate-utilities/Manifest @@ -8,6 +8,7 @@ EBUILD calculate-utilities-3.1.8-r12.ebuild 764 SHA256 479823f019989ff30db871e21 EBUILD calculate-utilities-3.1.8-r13.ebuild 764 SHA256 f840519f891b465bf26a120da731abc1272c139fadf917b12ad479c3e34eb8c8 SHA512 f01aea0b0a9a356b767508d0a1cb2d0b2fac54f953028b31904b27f4b728d05e457dc84c9992e7f2a7226c4355d8a89bd0ba456d5559f4394d6d0b0981e1d102 WHIRLPOOL 004970e0351a0d279e3f56cbcaba96168264cd480e8dfe0a2f49e61cc769819403da4df60f3e76409ca7c9e57b7526d8f70a870dcb20088091b0d1d212dcf635 EBUILD calculate-utilities-3.1.8-r14.ebuild 764 SHA256 a6358d7abe6df1d1e702273d1281a9aeea4d8d164cd24a8382910ea5ff693a82 SHA512 701f79db7202b2d8e13bd20d2f3f40802eac5294bf673aa6c5e367a701d5b10694f68965c6fe8f4b9c791b026c9325c98c7c7860396639a744af7ee64d5ef338 WHIRLPOOL c42cc56b0b99a09524164d75c040312c6a4a4911104739f751eab9cba24c7dfb99e24ca0e9b533c148cc92e315e93e8d3d8db78fd206382451e79ac0b168adcc EBUILD calculate-utilities-3.1.8-r15.ebuild 764 SHA256 1749519559b69c322f95cc91e1dd5c094b544fd2f4225d0d40000ef3ab08046b SHA512 a1e918e2a5c38882b6554bdf53cee0bfbd6b7c2061a581e05434edc70704b6426a0adfb2afedb5d27b825d5a94f2b12ae60560bb8aad1028c9e74220247bc85b WHIRLPOOL ed70176e13d99c02f03f3a4bbcf7760053a92ce6965913b5063fc18c455ee9c0d0669395c0769397fd1f39c669dd868f43658f12e73a46929bfdae6a8cdefdcf +EBUILD calculate-utilities-3.1.8-r16.ebuild 765 SHA256 884a68a4c527a02ce1c911f38e25e66616cd622f0e4fbe036df111e49716b150 SHA512 cc0e81ca175561cfa4bf3742641df2d6c86288a3290801a025a7938468af74dc5a3b57610ba5de2f15058ec9a393936b4891485fc84bc1fdf5ae173246de1d8a WHIRLPOOL 62b9677b39c598c21b5fcbfb4b3ba40d1b72b2b8a3bd66b789b7f8af90c5ecab14877888a8285e0e6657c5355845fc9b0436ec217a8bf41f7050d68c0b60a4d0 EBUILD calculate-utilities-3.1.8-r2.ebuild 758 SHA256 6c9a774ddc3966c0a1c07c109eccd718fd11bfc3aea41b1b29035b07f0ec5ece SHA512 72a35fc08d180fb15bcd264c84d16887faa1b724875346b18bb48de598488c6b8eb5d763738690432b1f6184f66ed75fc2554fa4c125f57408153bc00d8d8c36 WHIRLPOOL 537c7dcd309a5a4365d3789992a93857ba0d706ae2448d4cb5abc6fc2173953df88a627595f7a3607c1c13d7401ab82e5d9e652896c957d8cc508ec4e4e153b2 EBUILD calculate-utilities-3.1.8-r3.ebuild 758 SHA256 db3952e343cd4cd87b7e00f08ecb7fc78606599f125dd58f53a5414afff0dfd3 SHA512 fbb985c0b255fa6753c58f313c990e58dc95a4a0dd7d9c66f74d2a3d9f6cbf3a74c37efcbef8e34f050813213dc2db11eb19699984a4b7a6447067196eee5040 WHIRLPOOL 603c4c43325024f593da74918bc09c4eeb03743ebcc37c16dfca63ae8156b9ca4e44e73673f5700edf7ac662685f9173d6c4d0939fc0246eb821c4a9e4143890 EBUILD calculate-utilities-3.1.8-r4.ebuild 758 SHA256 2b54aa30c5a8c59a364009c38382ff404ec93329a1acb1240ff05b4ac177b49b SHA512 81ec2e91290d0385a72bb681ceea15fc70e1813e81fcb53694b447efee193be690fbe7579263c767b15994573012070c49b8eec57af63587a307b61736e5bb76 WHIRLPOOL 37f238a04982487934b4b6372c1e03c70bf55a3106be5992facaffbe5dce6bd8638711631e9acee08346907414e7db8efc0c8e7972301088117644c25cdb3420 diff --git a/sys-apps/calculate-utilities/calculate-utilities-3.1.8-r16.ebuild b/sys-apps/calculate-utilities/calculate-utilities-3.1.8-r16.ebuild new file mode 100644 index 000000000..8351a6cab --- /dev/null +++ b/sys-apps/calculate-utilities/calculate-utilities-3.1.8-r16.ebuild @@ -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="amd64 x86" +IUSE="cl_consolegui cl_client cl_desktop cl_console" + +RDEPEND="${RDEPEND} + =sys-apps/calculate-install-3.1.8-r10 + =sys-apps/calculate-i18n-3.1.8 + =sys-apps/calculate-lib-3.1.8-r4 + =sys-apps/calculate-core-3.1.8-r2 + =sys-apps/calculate-update-3.1.8 + cl_client? ( =sys-apps/calculate-client-3.1.8-r6 ) + cl_desktop? ( =sys-apps/calculate-desktop-3.1.8-r4 ) + cl_consolegui? ( =sys-apps/calculate-console-gui-3.1.8 ) + cl_console? ( =sys-apps/calculate-console-3.1.8 ) +"