Исправления для утилит 3.1.8

atratsevskiy
Mike khiretskiy 11 years ago
parent 4bb9f75f33
commit 0322435bde

@ -5,6 +5,7 @@ AUX calculate-install-3.1.8-r3.patch 6265 SHA256 4786199915488125e4081350ac096c2
AUX calculate-install-3.1.8-r4.patch 8350 SHA256 7e239492df59b943367954a735348753811e20f0e00bbf58c9dd4c9e175ea55d SHA512 6a68a10cd5c3827f5bab9ef83a3a60c3ff37cececb726918bc9b75d68d853204d3aaa3e66768f48b77a5d2ae2a9073de87a4c33b1626ab2e4da7ee50cc519efc WHIRLPOOL 1b0949d3c19f4a227722ef86108fb12394ff42707d70bf707a44687ce07b7da1a369210c6232730ebf02139501f53cfcb235968e4620d4272e10f037c5952f5b
AUX calculate-install-3.1.8-r5.patch 21296 SHA256 f6f07f0c227011e0a660bd2f535ccb5e5006ef6f80513388e63461d659a39437 SHA512 fd7a65819d0a0da77f6112a37be6bc748f4dfb50409b9da2d338723a5e7efde1af0980ec2cbaec1ee9e392a44983cde67d43872c914210916e4c000132d800e1 WHIRLPOOL b892f13cc14455611dabc2c887b25f77d09a54c6f1d3845a93eff2d32336da47aac2d436b26fa7a377e6d3a6cc6f2cc8c6e43f4e047391b3ef7c728a1a8a8edc
AUX calculate-install-3.1.8-r6.patch 27557 SHA256 5865e8daa201d6fedb533f61bb782e8f0d71d340424c236afde50a8be7a047ec SHA512 0d8369dc3c69c3c16b71b0e625b09732b300f905fb4e12bbb2dc6ec3fbc00effb187fc600b78b9f07341bbe46535830e8ebbf598c3506ba0125a7b920a686b03 WHIRLPOOL 473fab0e26d22222a6c7ee3a08fb45fd83f92c3ffa16d37d215e560b5d69220f03e427ccdde3d90e03ecc453554fe8cec8eb459150ff96178d610549afdb2028
AUX calculate-install-3.1.8-r7.patch 28369 SHA256 6b941343dd30d16cc3244dacbffdbea5be2851af391f358684a3488f3a96c91d SHA512 4b5b268d0f6904c3f2ed96abfefce3d7bfe42d1f31e2693f4d77e70d714893262114819edb0566c088efd36889ec24c19c83a3b754b841d9490def84c9575cb4 WHIRLPOOL f28d5d864b77435f3a0616991faf8ca21a797a1c67ae402609cd2ecaad4a8bfe611bc5899210d037ee26c3d1304e0ed5c6d0e127785f97725611c07dd180e395
DIST calculate-install-3.1.6.tar.bz2 77530 SHA256 799a353e4ca01318508183d5e8a1eb205eba071dc60da00788dfc20449fdffbc SHA512 cd824bf699c63aeec3527fb51fa01737d44d5b41d50126b5553ed6d175a2ce8d46fedbbaf0b69a973f951bee559cce38c974c803c171493f0a9a4c76cd174ed4 WHIRLPOOL db65b051b7c354c35484d957d1c5f25ec04dd8be8246d6ee8551bc8c3fee8cfab98cacb8ca3ac653641d81318d17895edfc155aa45b522460be5f538bb357062
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
@ -14,6 +15,7 @@ EBUILD calculate-install-3.1.8-r3.ebuild 1043 SHA256 547c7cf9961711b2d21d414119f
EBUILD calculate-install-3.1.8-r4.ebuild 1043 SHA256 326a2601f0789b9c22538910bf65b08b7a9fe2837a6c20bfadf032936b30b6d5 SHA512 2a51ccf307c7d826a9227b5f39ad7e9468ff80ed5c3bb199805680b2f5f7cb60583633081d7d37e9349c4fa2d08e60796f925bdc673c868b3348d2abb80fced0 WHIRLPOOL 98d128f9f26a4e4af7b06f08bae94c53a120101c3adf3f467b73a6bac8367e10518afbc0ba8238aaa4f489972b332915f58f4b3b5ad9c3a5597e0002ef0f1fdb
EBUILD calculate-install-3.1.8-r5.ebuild 1043 SHA256 3be5ec764174eea9048b03a223ed93c188f0b288b79d7eda31d195b748f6f5db SHA512 10c1fef447e644c7036324178f9aaa10a4c08cafe2aa98c4be7b92b16297f1aceb90a6ace273fd08c4c29c96f43da291f2b76816c98119941a1b92231c7c4914 WHIRLPOOL 4423d0f34309026ac87e73fab5efc576883140c47f5798b45912ab5ca3fb585cb45cedfc7e5c3b875a7f7f0acb3a5cbaf4b950c7bcf6fefbecb2bf97b4b5a7f1
EBUILD calculate-install-3.1.8-r6.ebuild 1043 SHA256 fa2a857ccf5122c3615c7799b902c526287a4d3339fe31409e8d73efd2cf2b6e SHA512 9f8f8c1e4f789c570c7100bf808e81bc5fd10b7473740b1d6122acc5cb90b5ea4eeea341b74753629bfbe50be3aee5a4ac75a9b99a5c35a673ad7a680825a890 WHIRLPOOL b596c0f6a0b655ef26e440df34d25790e2ce4a550a1177d3df419a573fa43b62a9392cc71b229bc05c3276815a018d58338ad5c70cd730a5b2f2d66635130a46
EBUILD calculate-install-3.1.8-r7.ebuild 1043 SHA256 0050ea815894533f52463b7b7c2c8d90ac287439487a86af0517da93c5b1ac6c SHA512 e235b5c1db4ce00f4a25d1f1cfd7cc4d0c6b6f16eda7142b170180e712feedf0146ed6bc46096b551fa7ee5719d7d43477752431e9d07412d19f40e1321c2df8 WHIRLPOOL eb8b06f934b741f75e9f254075804708a396d64873918f25affed0f795b5dc46fae769b9d0d643512ce8ae55476a64b6272c7d772ef3e3ae1fac09f89393d38d
EBUILD calculate-install-3.1.9999.ebuild 683 SHA256 e97dd6f046d54a16eee281fa35790c92507b150bc940f3c2b36117e6f44f0a8d SHA512 c1179c500dcaa48506f6334e9e2ccc3cc70d712b2899d7e1d9265bc202f088ab71baa1aaea462deee56fdd5244bee4ab9b9a9da72f25ec511d4f2fa0c3c35f43 WHIRLPOOL 010d35b929fce496b5f16228688e23a95c9c87ebed0d290eeb454e5c1432b55b3b276dfb5786a27222543446a1090ce2f133d80373649fe72341b508d1e16a78
MISC ChangeLog 33978 SHA256 a1cc544f9763b08b3647d90fac1ec53748016bb23260181315896c8c02431443 SHA512 11a09ba60fbc727bd47b57653b4bb0937d98774eb9ca95680a5b55997c7e22db3976cbd0878d908fa0200e04b6cc9eb0ae9ac6f1623235490e2e46e54cc1f7f4 WHIRLPOOL 50352c2950f301cbb5116b8c9972e592767dcb03bd71d081c75de5e69b2a920331abec4756658faf64e291bf6f4f41df67b8d62946683629a2c99b48274eb2f3
MISC metadata.xml 464 SHA256 0e3ea52c58e77580b778f7efb9f476811c168febe02e656961c71a455e4f4d7d SHA512 dd79935fabf9b629ee0913eae0cec88b0d6e46fc58e9b430e07e2a60f2e0ce66e8c257a3da33e17663a778d2a18b3a12f96f18cbc6e009f071788ed9353e4a29 WHIRLPOOL 8f72663b95c36637d15d40e0c56e5fd9e7e06e073993d202d788df1704bb979e794cde966428675f158786e273ba5677151d15d8e40a4715f769172a8ebf3e1e

@ -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
!<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.1.8-r7.patch"
}

@ -0,0 +1,730 @@
diff --git install/distr.py install/distr.py
index 545168b..398ff79 100644
--- install/distr.py
+++ install/distr.py
@@ -610,6 +610,7 @@ class PartitionDistributive(Distributive):
'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/install.py install/install.py
index 3ae3eb9..982a80d 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
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..3085bf4 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):
@@ -365,11 +386,17 @@ 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')
@@ -377,6 +404,9 @@ class VariableClAutopartitionSwapSize(Variable):
size = Sizes.G
return str(size)
+ def humanReadable(self):
+ return humanreadableSize(self.Get())
+
class VariableClAutopartitionDevice(AutopartitionHelper,Variable):
"""
Device for autopartition
@@ -538,7 +568,7 @@ class VariableClAutopartitionScheme(AutopartitionHelper,Variable,AutoPartition):
_("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 +590,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 +598,9 @@ class VariableClAutopartitionRootSize(AutopartitionHelper,Variable):
_("The root partition should be at least {size}").format(
size="7 Gb"))
+ def humanReadable(self):
+ return humanreadableSize(self.Get())
+
class VariableClAutopartitionTable(AutopartitionHelper,Variable):
"""
Partition table for autopartition
diff --git install/variables/net.py install/variables/net.py
index fa3e28b..20eb7da 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):
"""
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',

@ -9,5 +9,6 @@ EBUILD calculate-utilities-3.1.8-r5.ebuild 758 SHA256 38ad513576bfc7aded7d7ded24
EBUILD calculate-utilities-3.1.8-r6.ebuild 758 SHA256 db19c5bfbf1c3d6f4acb447cd3c9245b6ecfd82a92d384d4ffcab04011debd0c SHA512 9e26ebf9d4d2a137451d1d4e6a3da8a487af7fcf7d03d1bea75873f96929880673093a7de81a74b92036d543b3bab9d489741a237bfcb437b03c0d865936a7af WHIRLPOOL e9cdf7d4a0641c82dc0f3e6be56d58a47b999cfc4bad58ada7e7520e6144d5c640752ee2f3738f4ed6d4ecb31cbd5931b03b594a0543405d5bbfbf95d55f48a3
EBUILD calculate-utilities-3.1.8-r7.ebuild 758 SHA256 a96ec3c4eb94288998ec1e11b683fa3ac0dee569d550eb7d5465700f066e2363 SHA512 7708e724663850831b42a824dcfc1a238ddfd7ea07a02930654f21bc01b50f87f987af5427d680d785b9aeee4df71fa66a091159be6164c2a85931e4751bcd9e WHIRLPOOL 2b797866bb74d4b04ad90e384aea7861cee7d394b356216ad407a00f60231c7bca5522ccf0d3b7aaf2a6293841533f76eaafd3f1d9426bf7a1476495724e4e7a
EBUILD calculate-utilities-3.1.8-r8.ebuild 761 SHA256 49c332f3b672e0719fd28187e1d66cbe98cebc18325e074c2f839cfe746b5330 SHA512 6eace4644658a253316a3dad73956c746137ec26d360585a6949b25be7bbbbce922244972129a8e2afa38886414198f9e1f1ae68b181f59b95b12e0fbd90c7e7 WHIRLPOOL 4415266c67c3eed9dd9e3f978081ddfc0ec90bc9c104f13a8f45ffe42d447c47fd985fea6085189107944010c80da71fa794efce4621a86daec3dab4308dbf31
EBUILD calculate-utilities-3.1.8-r9.ebuild 761 SHA256 83704ff8464e94cfd31967655dd14bb6e38428ae89d5ae87d51126897ee35768 SHA512 bec768fa8ba8dd5453de2ca4623e0e9328a841fb5e9471bf8863b0370f420b1f8914e0f65f3bc7c12749d91954a990ed328c3a1046ffb4aea31d5a8c3ec10fcd WHIRLPOOL 5765e900601a2c2f201e2457f344d7aa742269ac791cf0fa5167f84b7d1b162c3230eefd131c47204e31113c6aa5a8d134efd786007a65c60f1c4bea31d5018e
EBUILD calculate-utilities-3.1.9999.ebuild 800 SHA256 9de4807341cb552ef8d4f702e9c4a0ca10c52c9d532cc2eb741cea29b92f09b5 SHA512 b35ed4d49c4943a5ad375e646bece419271900c50301153408b30dede0fe834e098baaa42a21c130730c0bc32ba09decc588277da6782d2010c18c9d8df679ae WHIRLPOOL 78e2c5ee8ef8356c4fc0275f920177778925278cad78585ed37c08048241f775030e59a0ced0696fba6379741fe865dc339d190c46b5f2173097328a73c64a24
MISC ChangeLog 38731 SHA256 7e70a0bc1f3b34c0011f3874773a698a4bb96eb6d3dad10903575156bb8578bc SHA512 2de466ea990b9eac702b81fd097c3f5d06d1f4db1a4bd1d1b7380b45e551f6fd62c16564ecfc810246157d3ef1113ae373041580e70981d44752e50ed6134bc0 WHIRLPOOL 5ca0cee1ad0e9419f91ec11a9629b9a29db9fcbed4f5ae0aef1f8a2170ff58112c8580d61884c56ee410a0abc201fa8f4419cea35077fc8bb84e733f6fa6f4db

@ -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-r7
=sys-apps/calculate-i18n-3.1.8
=sys-apps/calculate-lib-3.1.8-r2
=sys-apps/calculate-core-3.1.8-r2
=sys-apps/calculate-update-3.1.8
cl_client? ( =sys-apps/calculate-client-3.1.8 )
cl_desktop? ( =sys-apps/calculate-desktop-3.1.8-r1 )
cl_consolegui? ( =sys-apps/calculate-console-gui-3.1.8 )
cl_console? ( =sys-apps/calculate-console-3.1.8 )
"
Loading…
Cancel
Save