Fix 3.1.1_alpha2

atratsevskiy
parent 6715f46c00
commit 8ba915c8f0

@ -5,6 +5,7 @@ AUX calculate-core-3.1.1_alpha1-r1.patch 1560 SHA256 ffd41e06a66c764210999d3f4aa
AUX calculate-core-3.1.1_alpha1-r2.patch 2898 SHA256 226a6a5051523674c5536d33b68863f368b6de8d3270e0eb123164b4a39244cd SHA512 a5a18c495255de5a8988a22ac94a21816fabca49b9e179d43deb3e62fb565077d7cc248e48b7a7e60d8b5bcebc8f6605f29c2daddcbbd956635b8d078a29ce35 WHIRLPOOL a586d012851df53ce07c2a233dfeb89c864d6cddca03198fc55d75c51da647dfbb18dd7ede6b07dbf9279b18d079274e93b7b9df6c68271b63d8921aee625961
AUX calculate-core-3.1.1_alpha2-r1.patch 575 SHA256 7dc79ca4d51e0c547465359a4a307a62241d8e573b6f18e434a45c5dca280195 SHA512 a2ab6b199f39d494903336a8ee71f0515064aa0aeea18bd66d905faeaed28f3cb34545295d99fe95fa74a91365b0385f2d99247eec6298ea1f1b6f9dc403b0c8 WHIRLPOOL d887a09a7844f9032bf5663f2eaf3ef48044c1ac60f2d2da2c280b558b7b0d36e50ac84e620a6414439871e174e6ef96947adb4ea25178533d9a08687b0c5851
AUX calculate-core-3.1.1_alpha2-r2.patch 1581 SHA256 3f56d350015f82069467e04dc642903e5cb7bc1a02ef44805437a2f100cf7d92 SHA512 84434f1b363ea0ca3ff2dc2ee94845b6d35e112dc3903d67af1eda2a208ccbc671eebc53f7c70b620860ded8300894cbe4dd2352409c350139c1cca65f357b94 WHIRLPOOL b363179a68182a93468e84bdfedaaad8bfab0b7090fdffc0e4d55b68b7484d21c38fd8dcbcba0af85693c4a5a9b9658fc5d1412539cf53db9cf95364b277aa9d
AUX calculate-core-3.1.1_alpha2-r3.patch 2215 SHA256 c9c3e11c4e3136df2d9d0881d7aff992a5a30927fb2338a062c52f2af6698af7 SHA512 e248c1c8f888f116d2c1260ba46fc414efec585f1deba585cc16e9ca2819f3ee8dc53fea687a2f472ed62819c333f3a7ff77fa32482c0d8446befedc2f92d500 WHIRLPOOL 1bda43c7581866f22ab4cdcee6a22de9f353ba53a6227327f6d4443cfd144c9e29f4edbfa0d953829515c02d1275812d3011514c912f9f19e71e909cc8dc9540
DIST calculate-core-3.0.0.tar.bz2 86337 SHA256 ee2df2b93a1bd824e94d7179ef15478ae5b15de7d48f29752eb332f247bfc054 SHA512 60b1fc54ba5ee5b07586b2d2fe900f4e51a0c6966366b0750823185bacd965ed9ee3eebeb2dc7c220aef8fe8271585616acfb22926edb6f779c0829e7bada2ed WHIRLPOOL b3e4413d4bbbbfa1f74887179639fe1291cca0adf2968e2fd5198364e97da7f3ee83a51efa6f22bcd83e55970ab743dcb2d539b5979bb52cadca982af54fa2d2
DIST calculate-core-3.0.1.tar.bz2 86674 SHA256 0e690bd85973831c2aeddcc002f3ed1fe6bd5533f367e48decf512e429cc790a SHA512 24df3e8eaef57748d24156d7b15ba85bcfe1ecb888a052c1b86f71cf25b51330f64df68369dff48040d8779e40d036115eb20c645fee1c5017f3b68b0aa9fc36 WHIRLPOOL b5ce9efbb10e534928c465a6f44065618eeca48c6c024353331993c713c2bf1e124c9b2b1eec01ae36fe5f24700bc43429cf8060ea45b94f54ecfe8da61e0f60
DIST calculate-core-3.0.2.tar.bz2 86741 SHA256 f35bfe8e34df9ad9c07ac7d281b2b6a593acf00faa38a1221229164406587993 SHA512 cd44a055fe17529f7996f8dd26106aed29488db36313b027a2dcd43c57fad999e7d53f24802da1b3f449a0b79fdc19a7d1e245eb9415d8ed2ee02a7e7984ee5c WHIRLPOOL 3992697faa72dd40710b06646e8a9cbf12eea92c4f2c6c609355769ec4a353696231d42b248f211177711bf8bf2109f431c22ce5b92ddd31841d5c1136fbc324
@ -37,6 +38,7 @@ EBUILD calculate-core-3.1.1_alpha1-r2.ebuild 1212 SHA256 4f361ad2d998a786f095bc4
EBUILD calculate-core-3.1.1_alpha1.ebuild 1071 SHA256 0151b7dc4a12f0d1eb2255445efbb0d27fe6341f6a666475e73b99f840b68a28 SHA512 56ba4390629cdf9cf9b38fe57bd68a55135ae83b77f753dc25c42c7cd682475f3994a4f826e681cd5a81a39c5d4152d8f7208586d7ce2f5e64e7cbf171a09cd5 WHIRLPOOL 1f1d1a32950ffe3c06237bf8dc7222e576280ed90cda37ae349177b063df8eba3e00930b2624525daaefda8d53fc6d7170d8fc0349b8a26361e30de5e59fcc44
EBUILD calculate-core-3.1.1_alpha2-r1.ebuild 1212 SHA256 113012d884b7b9eacaaeb8b28636585264ce666183f677b489bd60640f0614f6 SHA512 273542c27c989c65e2ec745ef9b3ff4e5ced7d32cf3178e80e4150ee6a67e6f87788691e0f21f9bc2aa9efe352ea558f1bd4b5163628619bb20677d3b8683ad0 WHIRLPOOL e08309e406ebabadc2ba9ce13707344b9de68b17cb3c4128e1ae75f4ba5059ca0402e4ba4bdf1e11b0c8b3b4f2a7da56406be754972462add8b09bfccd3ba346
EBUILD calculate-core-3.1.1_alpha2-r2.ebuild 1212 SHA256 96b0513d71ecf89528b26857d2111576c22b3f654096676fe7b75c37addbb359 SHA512 a5dbadc5b2af2cc1ef8fb0a31a1d340df748ed0d286332689b09948dda5f3e0f1501e6a87f7d7da9506249fc4c2202ba74d99f2a25d1b93bd0edd181d46c6d62 WHIRLPOOL 68bcd5a5b1f89151b52a15a9ead11f71bbc934a5fd7468e166fd495281d74fc4da52b1d431ef57422dafb2028aa472472d3a6fa65a16b315e0a168857e7f13ed
EBUILD calculate-core-3.1.1_alpha2-r3.ebuild 1212 SHA256 36a57498d6d0c80c1a4503619704e674e0af549fe085730eb5a3013a046c0b90 SHA512 e9500cc022920119237d5c3ffe1453fcd14dbd6972552c5e724ad1100f5f7bb2285be7560715e2c5ed3661834daf5d818b5706839565155d43351f6ebb5e7069 WHIRLPOOL e482e81040dd7a6d541001506eded66c2566a9db3ecac464147d9108d0728148af1708a69930e9e46fbac1eec5c3c21ff53091e8c4b82ce6f8adb69810f206e3
EBUILD calculate-core-3.1.1_alpha2.ebuild 1071 SHA256 2d8f835b81768187442240c6ec1ab426ad1288325e6b20c9eb326060eaa0f171 SHA512 076cc552109b6f1957ce6d398d6f3f135b1f29a5846a6a0d89ef4a7f87a9ea63530711e144eee15a726cd16018810957f12ae1b75efc03a60baa95664fdc3a9a WHIRLPOOL 1226109eeb069833f5ca872ce46f24879c5a8ec6d4d7f3ce82bdb60d0dc2e19529980bb38e9872042ad96da8aa32253e78d6b7630c75450f509d6d473aa7f1c4
EBUILD calculate-core-3.1.9999.ebuild 656 SHA256 475e34d10141354a4c60e029fc1cb74b080c3a1371d9e1e44a5e2936b7130ed4 SHA512 9ba865c5effa56079a3841a96d1a4a89d4bbc27e092042aa4a87d1b4ecde9d3a690c92c73e10b330724258aaf3138d2a58d50d18d2fbea9e657c3c5d2f8395ee WHIRLPOOL 89d3bcc657324d1ffb4265eab3e28e94e3d00fb7530c6654e75b52fe002d70f72998930729cfe3320a3ff571277e6e59c649b0df2fe071bcd9b050f9d42608eb
MISC ChangeLog 382 SHA256 ce74a6d08ec1ea80ee021f5378f705102435abfcd5304d851c3f7932a967065e SHA512 f5531edead30072e8fb8f278cad1d265762b8ecdf146b86cf514704f373f2bd8068b3ed35e68186687f83129814b73c6269024d442fb592515c72a9d0e6d3ca1 WHIRLPOOL 48571b2986c2f8797109a3a3440a43f4f87b601e8e52bd41a470bd077b37eb2b6118e6baf86179df065aa2e4a840d9501b2b2455b990a19dfaa2d4ee7784c922

@ -0,0 +1,49 @@
# 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 WSDL core for Calculate 3"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="3"
KEYWORDS=""
IUSE="minimal"
DEPEND="~sys-apps/calculate-lib-3.1.1_alpha2
>=dev-python/soaplib-1.0
!minimal? ( dev-python/sudsds
net-libs/dslib
dev-python/pyopenssl
dev-libs/openssl
dev-python/m2crypto
dev-python/cherrypy )"
RDEPEND="${DEPEND}"
pkg_preinst() {
dosym /usr/sbin/cl-core /usr/sbin/cl-core-setup
}
pkg_postinst() {
einfo "For autoconfigure calculate-core for adminuser perform:"
einfo " cl-core --bootstrap <username>"
einfo "For run calculate-core perform:"
einfo " /etc/init.d/calculate-core start"
einfo "Add calcualte core to autorun:"
einfo " rc-update add calculate-core boot"
}
src_unpack() {
unpack "${A}"
cd "${S}"
# apply revision changes
epatch "${FILESDIR}/calculate-core-3.1.1_alpha2-r3.patch"
}

@ -0,0 +1,42 @@
diff --git core/server/setup_package.py core/server/setup_package.py
index 2111b8d..022adaa 100644
--- core/server/setup_package.py
+++ core/server/setup_package.py
@@ -184,7 +184,7 @@ class updateUserConfigs(shareUpdateConfigs):
clVars.Set("cl_root_path", '/', True)
clVars.Set("ur_login", userName, True)
clVars.Set("cl_action", "desktop", True)
- clVars.Set("cl_merge_pkg", [nameProgram], True)
+ clVars.Set("cl_merge_pkg", ["%s/%s"%(category,nameProgram)], True)
clTempl = ChainProgressTemplate( self.startTask,
self.endTask,
self.setProgress,
@@ -350,7 +350,7 @@ class updateSystemConfigs(shareUpdateConfigs):
clVars.Set("cl_root_path", configPath, True)
if variables.Get('cl_core_pkg_root_set') == 'on':
clVars.Set("cl_root_path_next", '/', True)
- clVars.Set("cl_merge_pkg", [nameProgram], True)
+ clVars.Set("cl_merge_pkg", ["%s/%s"%(category,nameProgram)], True)
clVars.Set("cl_action", 'merge', True)
configFiles = []
nameProg = clVars.Get("cl_name")
@@ -380,9 +380,8 @@ class updateSystemConfigs(shareUpdateConfigs):
for pkg in clTempl.changedFiles.getPkgs():
category = isPkgInstalled(pkg)
if category:
- category = category[0].rpartition('/')[2]
pkgContents = PkgContents("{CATEGORY}/{PF}".format(
- **isPkgInstalled("%s/%s"%(category,pkg))[0]))
+ **category[0]))
for filename,action in clTempl.changedFiles.getPkgFiles(pkg):
if filename in clTempl.protectedFiles:
pkgContents.removeObject(filename)
@@ -456,7 +455,7 @@ class updateSystemConfigs(shareUpdateConfigs):
self.copyConfigFiles(configPath,variables.Get('cl_config_protect'))
if clTempl and clTempl.getWarning():
for warn in clTempl.getWarning().split("\n"):
- self.SUCCESS(warn)
+ self.WARNING(warn)
return True
class PackageUpdater(updateSystemConfigs,updateUserConfigs):

@ -20,6 +20,7 @@ AUX calculate-lib-3.1.1_alpha1-r1.patch 686 SHA256 e7972851fa90b0715ea6c39a82933
AUX calculate-lib-3.1.1_alpha1-r2.patch 20456 SHA256 124535f503cf4ace75fd6715285a9a65a66e49286af64e11d3e06672335ec301 SHA512 0e62bd4c09ad92245fc0b20c919c21889063d30d59794666e68d86430935c70f2a692993d980332028381e5ad8f6819830dad7be72a50e8be1189d5b5394b9ad WHIRLPOOL 749994e5ef1bc2abbcba09ac6b53ea38ba03011d2828e0a6dc3851bd30709949f520b22e6e8782faeac069ab53b0a01d50e48fd8e939129d20a5cc38b5f10466
AUX calculate-lib-3.1.1_alpha2-r1.patch 1801 SHA256 e0fa0a7db2cd8d8fe290d04cbd60062d9fc1eba227fc31ab29f685913297e885 SHA512 0633f1428b8dea596748685ea2eda3f1d3c0dfbd1b358d83bf57b4d13660429d7ebb23f0db5bc4041f972559d09d7e162fa0bdd2f78708888d65214bb9cf7ba4 WHIRLPOOL 7fc2dc36d793f1db3468826f5f0b4e8c36d8f4a94d9fefbabcfca346d02b061ffdbcf36ed8b24d7c8844ff1bf4e2572a5e1d328752912458e2099beec8db4b57
AUX calculate-lib-3.1.1_alpha2-r10.patch 20562 SHA256 d2674a24eb94a14e8cbe87aad5c13e78e0264ed271a543b983675335449615fe SHA512 08106ee48571f9418e95ffa12c82660c0d90238e7f7ba146557839571571a7cfe88ed036b2695994823b762fac5fa7a5b155beea0646535211d884b679b7bd9f WHIRLPOOL ceb6809d46ff6edeae637e2ba44834201aac3f9ce2d91a92b46e94d54e7fddd8761f00f9cf604a0db166bb7af6a0a4e6c5d9d0cf80eb0c4f5cefdd6c88f36c63
AUX calculate-lib-3.1.1_alpha2-r11.patch 21269 SHA256 c09feb8e381fcb50b3a808c63eaa2394cad7c42fd7278485ed4b82e8767e120f SHA512 78763010024f732eb337947c398a648ea3d6d9be3520f3bdc3cf14b0410734c0612c9dc358e76342e3cdd1a09fd8eb40858f32fc1aa0721b8cedfe9418757919 WHIRLPOOL 02ad3f9e26da7f23999943a2ac9f469162f2865636f3a657733684980bb6842d1b67bed72767058831f3bacf5bc3e7fc2d2cd55f8728a201792f13a5ea318755
AUX calculate-lib-3.1.1_alpha2-r2.patch 2386 SHA256 2e4616804916e9054fe51e799ecd4a355d8b3ce404c91328b45c4ee2a53be561 SHA512 0c0b49e7c43de8655e6df49805e4cf8e4ee621f6b7f134cc42dc5ac4be4a753f16036c0d7db4763a81ff620a9d3145b892b2c3b47f5863929c0ddf0e8db585e5 WHIRLPOOL 5d6017a88a0a4a12ca4d85a572452ba8ca6dd80292dc009ff3768d4dfbdc39b32b3c293f7df9ffbc3a83cfdb5b412a579b1e80064b2e8ab5163834dacad6304f
AUX calculate-lib-3.1.1_alpha2-r3.patch 4920 SHA256 3d3490321e45744947d70ac1668ae939b1a62fd7644fd2e7a4a9de1b4395bc44 SHA512 9cd94862a5cedb624e5d1e4787464bebfadbef638bd9f678fd24f16d3905d46c1c36f419e5ec63946830058ba74d0d04eeaa69fc62e2aaa59ab4639a134ab5c3 WHIRLPOOL b762a30632f3753c38c8d870d56dc65b7679e3f3308e854259d03f2b977c9d07398f9f730ebe0eefa1f7c8580b5c3e394411edb4488b16e210f4532990e8df41
AUX calculate-lib-3.1.1_alpha2-r4.patch 6797 SHA256 6067424bac12b0dd2c113e98038db7157705d48669c8574e93dc4308bf217e18 SHA512 bb4f49192ea410be808867e6f3124a6b859c4818a8262f486af03b93fa18cbb1d7b8d705595fd1c441fbd40a47d8919164b2bbb0cdb8677303fcaf0f8b1caab1 WHIRLPOOL d378bba2b0831fd776fbea8fae2597268c2c863597178eab31148b87e91032f2501e932244e596ad24146beb68843fd95cf12cd2c438380ce58903aae1866966
@ -82,6 +83,7 @@ EBUILD calculate-lib-3.1.1_alpha1-r2.ebuild 821 SHA256 f4a95b57d23ebdeba3974c141
EBUILD calculate-lib-3.1.1_alpha1.ebuild 681 SHA256 6a6332013e5a56db775c6490b63b60f959528660b0982e6a414f1614c0b0ffa5 SHA512 19a71823543fe843a05a548207509ee4dcffa784c61e23c56cf17d2c651effbfc63914beb03f0977b804c5cc647407eecdcbdaed4d7478783bec46eee72a50fb WHIRLPOOL 5ffd414c804671057fe2a7a2176999eee0a75574a5043332d3c01f08b93635773800e6b5d9901993e4fbf7f95d175659d621be9231d08f8bdada2654e45f8e1d
EBUILD calculate-lib-3.1.1_alpha2-r1.ebuild 821 SHA256 1189d428581e6cde80b3a0877a2d9d7d3523fdefc12f9773a478f7d61356e740 SHA512 2f581be467423fe4f91d41113e61404c4deb9aab5471a55820df6ffc45466f28a1b499c92ca321762219ca4abf11b48ee132b0597206ffe6f060455b8cd8daba WHIRLPOOL ca708e8742d835c3a86f442588217997f20340982817ce3e7ca4e10f9621ba0cebe1d369e8413a763a12e4932e2970f127cd8cb4903a03a12eaeeae79d02590d
EBUILD calculate-lib-3.1.1_alpha2-r10.ebuild 822 SHA256 27a01f7e3f9b8bb0db6fb9db11620201427c93b44b52dd702f148d2f4b0216e8 SHA512 3ddf1897f1baa4fc7de1f1c01bf00b7a25e8815489aee47279f656355c36a3b8455efabdf1fb6e2b6bc5a79e49c05a8b333c9e5b0c638879ed2ac2fae252625d WHIRLPOOL 2d827fb0312bea5e6682a76dc0d62203bbac8677ca956eb3a2655cc96534c7ce0c48513777eeac1bf4160e6be24ed55f4056261bc487863a1dc344bfc686ebd9
EBUILD calculate-lib-3.1.1_alpha2-r11.ebuild 822 SHA256 52ef776e73f6537cc597f7db6fd08c37c61a44a8de3c356ce616f38a5b2dfa49 SHA512 e74e42f8b945462b0ebf88b63b0c302c2932c4a2eda2bbf806d48feab4e8489e92fb82bc8ed0dc701f078532a017c814fa78031bb78f54b3fc88e7187ea3cc4a WHIRLPOOL a13fefc33ab6dae778f9d7eb0d2a7b2084e2eb199af4357dcbb1405db735a73ef4e2731595ad413d98baf0b58acc34f7afef8cadb44847b0c38fc24eb9d3b293
EBUILD calculate-lib-3.1.1_alpha2-r2.ebuild 821 SHA256 cd223474f7f4cd3c87f1cf6d75f7fda61fd6d33461e27f3a753710b7217840a7 SHA512 48a12926e36b8513b9feb1444f95f3b9ed80fac69329e9f0f17c97e42cab4cb11f44f1d678a6690e4a68268c07d8dad48b5cd05b04f7ac0034ce82e748dfe24c WHIRLPOOL 0d14e28c63383bfaeabf59d87d891d3a32ca4b9fd4e88af0743d27af24e1198781a2b435ab62be7c609f3debbad3b57fed8cde0a58d5a8890bbbed0a19bbdb80
EBUILD calculate-lib-3.1.1_alpha2-r3.ebuild 821 SHA256 c417d3904830c64de5978e26ef11f3b40b16d05c8fade33b299c3ff6e38c6bd1 SHA512 be152bf60027668ab3e49cdd15ff4e06f7599956db497f883d7c6c018dbfbb3a723b5c0b6b25de1eb1661474179a26f8ae5fd8d9e1a13eaf8bc8dae7c2024b9c WHIRLPOOL 93f32e6461d387fccb814b2332411c006c9a58e9280c8d96fb02ba4a5712c2e41203480512486fd11800faf8fce80546c27cdeb5c09f5e58d895e5dd11bcd5f9
EBUILD calculate-lib-3.1.1_alpha2-r4.ebuild 821 SHA256 c562f85ff455b300a04674f3b5e8d88efd85e3a09a28d1f62e18138b32326ff5 SHA512 442d202a23d9f6db5d3c18ebf367821ddb3c28b6a70c194403f5e7df250e2477b415a518b8117e0dfc3d927057ee9bc79958259b19581fbdfc9954bf31f29c87 WHIRLPOOL cd3cf784d4cf68cdf6d0be541377b9fb43342e60cdc7e6b41beb153fc2c2b1d2141468bd43534758265cf4349f83fc4b79360388ca955c9490481e8af68a8f57

@ -0,0 +1,35 @@
# 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=""
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.1_alpha2-r11.patch"
}

@ -0,0 +1,464 @@
diff --git calculate/lib/cl_template.py calculate/lib/cl_template.py
index 24ad307..75bf541 100644
--- calculate/lib/cl_template.py
+++ calculate/lib/cl_template.py
@@ -39,8 +39,9 @@ from utils.common import _error, _warning
from utils.text import _toUNICODE, convertStrListDict
from utils.portage import isPkgInstalled
from utils.content import PkgContents
-from utils.files import (getModeFile, removeDir, typeFile, scanDirectory,
- pathJoin,process,STDOUT)
+from utils.files import (getModeFile, listDirectory,removeDir, typeFile,
+ scanDirectory,
+ pathJoin,readFile,readLinesFile,process,STDOUT)
from datavars import DataVarsError
from calculate.lib.cl_lang import setLocalTranslate
@@ -2181,6 +2182,10 @@ class _file(_error):
F_CONF = open (nameFileConfig, "r+")
except:
try:
+ if os.path.isdir(nameFileConfig):
+ self.setWarning(_("unable to open the directory as file:")
+ + nameFileConfig)
+ return False
F_CONF = open(nameFileConfig, "w+")
except:
self.setError(_("unable to open the file:")
@@ -2482,6 +2487,9 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
# директория установленных программ
basePkgDir = "/var/db/pkg"
+ # кэш для проверки наличия пакета в портежах
+ cachePortdir = {}
+
# стек глобальных переменных
stackGlobalVars = []
@@ -2498,6 +2506,11 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
# Текст функции шаблона
functText = ""
+ # regular for discard sort number and version
+ reData = re.compile(r"^(?:\d+-)?(.+?)(?:-(?:|always|\d+|\d(?:\d|\.|pre|_"
+ "|-always|alpha|beta|pre|rc|[a-z][^a-z])*[a-z]?)(?:"
+ "-r\d+)?)?$",re.S)
+
currentBelong = ""
def __init__(self, objVar):
@@ -2756,7 +2769,8 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
"""
for pkgname,category,ver,slot in pkgs:
fullname = "%s/%s"%(category,pkgname)
- if not fullname in self.installProg:
+ if not fullname in self.installProg or \
+ type(self.installProg[fullname]) != dict:
self.installProg[fullname] = self.installProg[pkgname] = {}
if force or not slot in self.installProg[fullname]:
self.installProg[fullname][slot] = ver
@@ -2799,10 +2813,47 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
else:
return ""
+ def funcWorld(self, funArgv, resS, localVars, textTemplateTmp, nameTemp):
+ """
+ Function for world generation
+ """
+ # source file
+ fileName = funArgv.replace(" ","")
+ source = readFile(fileName)
+ replace = []
+
+ for line in filter(None,
+ filter(lambda x:not x.startswith('#'),
+ map(lambda x:x.strip(),
+ source.split('\n')))):
+ category, spl, nameProg = line.partition("/")
+ nameProg, spl, slot = nameProg.partition(":")
+ if not category in self.installCategory:
+ self.getInstallPkgGentoo(category=category)
+ self.installCategory.append(category)
+ if self.pkg(nameProg, slot=slot or None):
+ replace.append(line)
+
+ textTemplateTmp = textTemplateTmp[:resS.start()] + "\n".join(replace) +\
+ textTemplateTmp[resS.end():]
+ return textTemplateTmp
+
def funcPkg(self, funArgv, resS, localVars, textTemplateTmp, nameTemp):
"""Функция шаблона pkg(), выдает номер версии программы"""
# Название программы
nameProg = funArgv.replace(" ","")
+ if not nameProg:
+ fileName = os.path.split(self.nameTemplate)[1]
+ if fileName == '.calculate_directory':
+ parentDir = os.path.dirname(self.nameTemplate)
+ parentDir, pkgName = os.path.split(parentDir)
+ else:
+ parentDir, pkgName = os.path.split(self.nameTemplate)
+ category = os.path.split(parentDir)[1]
+ # reg for discard version and sort number
+ pkgName = self.reData.search(pkgName).group(1)
+ category = self.reData.search(category).group(1)
+ nameProg = "%s/%s"%(category,pkgName)
# Замена функции в тексте шаблона
replace = ""
if "/" in nameProg:
@@ -2810,6 +2861,7 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
nameProg, spl, slot = nameProg.partition(":")
if not category in self.installCategory:
self.getInstallPkgGentoo(category=category)
+ self.installCategory.append(category)
replace = self.pkg(nameProg, slot=slot or None)
else:
if not self.flagAllPkgScan:
@@ -2894,6 +2946,31 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
textTemplateTmp[resS.end():]
return textTemplateTmp
+ def funcIn(self, funArgv, resS, localVars, textTemplateTmp, nameTemp):
+ """
+ Function in for check value in variable
+ """
+ terms = funArgv.replace(" ","").split(",")
+ # Название локальной переменной
+ nameLocVar = terms[0]
+ flagFoundVar = False
+ try:
+ value = self.objVar.Get(nameLocVar)
+ flagFoundVar = True
+ except:
+ pass
+ if flagFoundVar:
+ if value in terms[1:]:
+ replace = "1"
+ else:
+ replace = ""
+ else:
+ self.raiseErrTemplate(_("error: variable %s does not exist")\
+ %str(nameLocVar))
+ textTemplateTmp = textTemplateTmp[:resS.start()] + replace +\
+ textTemplateTmp[resS.end():]
+ return textTemplateTmp
+
def funcPush(self, funArgv, resS, localVars, textTemplateTmp, nameTemp):
"""локальная функция записывает значение переменной
@@ -3215,12 +3292,63 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
return textTemplateTmp
def funcBelong(self, funArgv, resS, localVars, textTemplateTmp, nameTemp):
- #self.setWarning(
- # _("Function '{funcname}' used by {template} is depricated"
- # " and will be removed at the future").format(
- # funcname="belong",template=nameTemp))
- return self.funcMerge(funArgv, resS, localVars,
- textTemplateTmp, nameTemp)
+ self.setWarning(
+ _("Function '{funcname}' used by {template} is depricated"
+ " and will be removed at the future").format(
+ funcname="belong",template=nameTemp))
+ replace = ""
+ return textTemplateTmp[:resS.start()] + replace +\
+ textTemplateTmp[resS.end():]
+
+ def checkCorrectPkgName(self,package):
+ """
+ Check pkg name (in /var/db/pkg,/usr/portage,/var/lib/layman/calculate
+ and other overlays)
+ """
+ category,spl,pkgname = package.partition('/')
+ pkgname, spl, slot = pkgname.partition(":")
+ # check installed package in system
+ if not category in self.installCategory:
+ self.getInstallPkgGentoo(category=category)
+ self.installCategory.append(category)
+ if self.pkg("%s/%s"%(category,pkgname), slot=slot or None):
+ return True
+ # check package in portage and calculate,overlay
+ def queuePortdir():
+ yield "/usr/portage"
+ calculate = "/var/lib/layman/calculate"
+ yield calculate
+ for portdir in filter(lambda x:x!=calculate,
+ self.objVar.Get('cl_portdir_overlay')):
+ yield portdir
+
+ for portdir in queuePortdir():
+ if not portdir in self.cachePortdir:
+ lPortdir = len(portdir)+1
+ self.cachePortdir[portdir] = \
+ list(set(
+ map(lambda x:x[lPortdir:].rpartition('/')[0],
+ glob.glob("%s/*/*/*.ebuild"%portdir))))
+ if package in self.cachePortdir[portdir]:
+ return True
+ else:
+ if portdir == "/usr/portage" and \
+ not self.cachePortdir[portdir]:
+ #raise TemplatesError(_("Ebuild files are not found in portage"))
+ return True
+ if not "portage/update" in self.cachePortdir:
+ updateFiles = sorted(listDirectory('/usr/portage/profiles/updates'),
+ key=lambda x:tuple(reversed(x.split('Q-'))),reverse=True)
+ if updateFiles:
+ self.cachePortdir["portage/update"] = \
+ map(lambda x:x.split(' ')[1],
+ filter(lambda x:x.startswith('move '),
+ readLinesFile(os.path.join('/usr/portage/profiles/updates',
+ updateFiles[0]))))
+ if package in self.cachePortdir:
+ self.printWARNING(_("Package {frompkg} was renamed").format(frompkg=package))
+ return True
+ return False
def funcMerge(self, funArgv, resS, localVars, textTemplateTmp, nameTemp):
"""
@@ -3234,11 +3362,27 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction):
self.raiseErrTemplate()
funcPkg = terms[0]
if not funcPkg:
- funcPkg = os.path.split(self.nameTemplate)[1]
- if funcPkg == '.calculate_directory':
- funcPkg = os.path.split(os.path.dirname(self.nameTemplate))[1]
- if not funcPkg:
- self.raiseErrTemplate(_("incorrect template path"))
+ fileName = os.path.split(self.nameTemplate)[1]
+ if fileName == '.calculate_directory':
+ parentDir = os.path.dirname(self.nameTemplate)
+ parentDir, pkgName = os.path.split(parentDir)
+ else:
+ parentDir, pkgName = os.path.split(self.nameTemplate)
+ category = os.path.split(parentDir)[1]
+ # reg for discard version and sort number
+ pkgName = self.reData.search(pkgName).group(1)
+ category = self.reData.search(category).group(1)
+ funcPkg = "%s/%s"%(category,pkgName)
+ try:
+ if not self.checkCorrectPkgName(funcPkg):
+ self.printWARNING(
+ _("Package {pkgName} specified in the merge() into "
+ "{templName} template is not found").format(
+ pkgName=funcPkg,templName=self.nameTemplate))
+ return textTemplateTmp[:resS.start()] + \
+ textTemplateTmp[resS.end():]
+ except TemplatesError as e:
+ self.printWARNING(str(e))
self.currentBelong = funcPkg
pkg = self.objVar.Get("cl_merge_pkg")
replace = ""
@@ -3601,6 +3745,9 @@ re.M|re.S)
self.allTemplates = 0
# Объект функций шаблона
self.functObj = templateFunction(self.objVar)
+ self.functObj.printSUCCESS = self.printSUCCESS
+ self.functObj.printWARNING = self.printWARNING
+ self.functObj.printERROR = self.printERROR
# Метод применения функций к шаблонам
self.applyFuncTemplate = self.functObj.applyFuncTemplate
# Объект для определения типа файла шаблона
@@ -3658,7 +3805,8 @@ re.M|re.S)
def executeTemplate(self, code, execPath):
"""Execute template"""
- p = process(execPath,lang=self.objVar.Get('os_locale_locale'))
+ p = process(execPath,lang=self.objVar.Get('os_locale_locale'),
+ envdict=os.environ)
if "/bin/bash" in code.partition('\n')[0]:
p.write("""function translate() {
gettext -d cl_template "$*"
@@ -4131,9 +4279,8 @@ gettext -d cl_template "$*"
for pkg in self.objVar.Get('cl_merge_pkg'):
category = isPkgInstalled(pkg)
if category:
- category = category[0].rpartition('/')[2]
pkgContents = PkgContents("{CATEGORY}/{PF}".format(
- **isPkgInstalled("%s/%s"%(category,pkg))[0]))
+ **category[0]))
for filename in pkgContents.content.keys():
if not filename in self.cltObj.filterApplyTemplates:
self.cltObj.filterApplyTemplates[filename] = []
@@ -4281,6 +4428,11 @@ gettext -d cl_template "$*"
self.getApplyHeadDir(newDir, dirInfoFile, opt)
if createdDirs:
self.createdDirs += createdDirs
+ if os.path.isfile(pathDir):
+ self.setWarning(_("{dirpath} is file").format(dirpath=pathDir))
+ self.setWarning(_("templates in {tempath} is skipped"
+ ).format(tempath=path))
+ return None
if objHeadDir:
return pathDir, objHeadDir
else:
@@ -4392,11 +4544,11 @@ gettext -d cl_template "$*"
# add packeges for reconfigure
if "merge" in objHead.params:
mergePkgs = objHead.params['merge'].split(',')
- reRight = re.compile(r'^(\w+-\w+/)?[\w+-]+$')
- for wrongPkg in (x for x in mergePkgs if not reRight.match(x)):
- self.setError(_("Wrong value '%s' for 'merge' in the template")%
+ for wrongPkg in (x for x in mergePkgs \
+ if not self.functObj.checkCorrectPkgName(x)):
+ self.printWARNING(
+ _("Wrong package '%s' for 'merge' in the template")%
wrongPkg + ": " + nameFileTemplate)
- return ([], False)
for pkg in mergePkgs:
if not pkg in self.objVar.Get('cl_merge_pkg_new') and \
not pkg in self.objVar.Get('cl_merge_pkg_pass'):
@@ -4679,11 +4831,11 @@ gettext -d cl_template "$*"
# add packeges for reconfigure
if "merge" in objHeadNew.params:
mergePkgs = objHeadNew.params['merge'].split(',')
- reRight = re.compile(r'^(\w+-\w+/)?[\w+-]+$')
- for wrongPkg in (x for x in mergePkgs if not reRight.match(x)):
- self.setError(_("Wrong value '%s' for 'merge' in the template")%
+ for wrongPkg in (x for x in mergePkgs \
+ if not self.functObj.checkCorrectPkgName(x)):
+ self.printWARNING(
+ _("Wrong package '%s' for 'merge' in the template")%
wrongPkg + ": " + nameFileTemplate)
- return ([], False)
for pkg in mergePkgs:
if not pkg in self.objVar.Get('cl_merge_pkg_new') and \
not pkg in self.objVar.Get('cl_merge_pkg_pass'):
@@ -5052,7 +5204,7 @@ gettext -d cl_template "$*"
def fileIsUtf(self, fileName):
"""Проверяет файл на кодировку UTF-8"""
- if os.path.exists(fileName):
+ if os.path.isfile(fileName):
FD = open(os.path.abspath(fileName))
newTemplate = FD.read()
FD.close()
@@ -5060,7 +5212,8 @@ gettext -d cl_template "$*"
newTemplate.decode("UTF-8")
except:
return False
- return True
+ return True
+ return False
def joinTemplate(self, nameFileTemplate, nameFileConfig, optFile={}):
"""Объединения шаблона и конф. файла
@@ -5110,6 +5263,8 @@ gettext -d cl_template "$*"
optFile)
if not objHeadNew:
return filesApply
+ if templateFileType != "bin":
+ pass
# Настоящее имя конфигурационного файла
nameFileConfig = filesApply[0]
# Флаг - кодировка с бинарными примесями у файла шаблона включаем при
diff --git calculate/lib/datavars.py calculate/lib/datavars.py
index 02b1d4a..1791281 100644
--- calculate/lib/datavars.py
+++ calculate/lib/datavars.py
@@ -33,9 +33,9 @@ from types import StringTypes
def addStdConfig(fileLst,prefix='/'):
stdPath = path.join(prefix,
- "/var/lib/layman/calculate/profiles/calculate.env")
+ "var/lib/layman/calculate/profiles/calculate.env")
if not stdPath in map(os.path.abspath,fileLst):
- return fileLst + [stdPath]
+ return [stdPath] + fileLst
return fileLst
def itemgetter(*args,**kwargs):
@@ -757,9 +757,10 @@ class SimpleDataVars:
searchProfile(iniFile,'calculate.env'),prefix=self.systemRoot),""))
else:
config = cl_template.iniParser(iniFile)
+ importVars = config.getAreaVars("main")
for varname in self.allVars.keys():
if not varname in self.cache:
- val = self.unserialize("string",config.getVar('main',varname))
+ val = self.unserialize("string",importVars.get(varname,''))
if val:
self.cache[varname] = val.encode('utf-8')
diff --git calculate/lib/format/world.py calculate/lib/format/world.py
index 69bfc4f..7d93488 100644
--- calculate/lib/format/world.py
+++ calculate/lib/format/world.py
@@ -22,7 +22,7 @@ class world(objShare):
"""Класс для обработки конфигурационного файла типа procmail
"""
- _comment = ""
+ _comment = "#"
configName = "world"
configVersion = "0.1"
sepFields = "\n"
@@ -66,15 +66,15 @@ class world(objShare):
for k in txtLines:
textLine = k + endtxtLines[z]
z += 1
- #findComment = self.reComment.search(textLine)
+ findComment = self.reComment.search(textLine)
if not textLine.strip():
field.br = textLine
fields.append(field)
field = fieldData()
- #elif findComment:
- # field.comment = textLine
- # fields.append(field)
- # field = fieldData()
+ elif findComment:
+ field.comment = textLine
+ fields.append(field)
+ field = fieldData()
else:
pars = textLine.strip()
field.name = pars
diff --git calculate/lib/variables/env.py calculate/lib/variables/env.py
index 44da0c3..af1a6a3 100644
--- calculate/lib/variables/env.py
+++ calculate/lib/variables/env.py
@@ -252,3 +252,28 @@ class VariableClEbuildPhase(ReadonlyVariable):
"""
def get(self):
return os.environ.get("EBUILD_PHASE","")
+
+class VariableClEmergeInfo(ReadonlyVariable):
+ """
+ Emerge --info cache
+ """
+ type = "list"
+
+ def get(self):
+ return filter(lambda x:x.startswith('PORTDIR_OVERLAY=') or \
+ x.startswith('PORTDIR='),
+ process("emerge","--info",envdict=os.environ).read().split('\n'))
+
+class VariableClPortdirOverlay(ReadonlyVariable):
+ """
+ Overlays path
+ """
+ type = "list"
+
+ def get(self):
+ emergeInfo = self.Get('cl_emerge_info')
+ for line in filter(lambda x:x.startswith("PORTDIR_OVERLAY="),
+ emergeInfo):
+ return filter(None,
+ line.partition("=")[2].strip('\n"\'').split(' '))
+ return []
diff --git calculate/lib/variables/linux.py calculate/lib/variables/linux.py
index be3bbb2..e3e6bdd 100644
--- calculate/lib/variables/linux.py
+++ calculate/lib/variables/linux.py
@@ -240,8 +240,9 @@ class LinuxDataVars(SimpleDataVars):
VariableOsLinuxBuild(systemRoot=systemRoot))
makeprofile = path.join(systemRoot,'etc/make.profile')
if os.path.exists(makeprofile):
- inifile = path.join('/etc',os.readlink('/etc/make.profile'))
- self.flIniFileFrom(makeprofile)
+ inifile = path.join(systemRoot,'etc',
+ os.readlink(path.join(systemRoot,'etc/make.profile')))
+ self.flIniFileFrom(inifile)
inifile = "etc/calculate/calculate.env"
self.flIniFileFrom(path.join(systemRoot,inifile))
iniFile = "etc/calculate/calculate3.env"

@ -81,6 +81,7 @@ EBUILD calculate-utilities-3.1.1_alpha2-r10.ebuild 818 SHA256 7c0c4a9334b4412cf8
EBUILD calculate-utilities-3.1.1_alpha2-r11.ebuild 821 SHA256 8a6f34be87d378197c55112dc06c1f58a10f069730288b7d97cc348addd91389 SHA512 efcc2a72fe35866650edfdf7b4774ac3f25d8f38a46f7e2dbfe8dc53cb5f3505f675dbaa4cea95b61f6f6b09650531c1181bd60f5ff8d96defa52e1b6739f6d6 WHIRLPOOL fd51b9d56bff8f3a7825d08013fd06fd74ddc80b37820e4677a31f88018921c811208b670ffe21b180d1372e46a31a67520d1d1ee108a2ba73178626e5424cdf
EBUILD calculate-utilities-3.1.1_alpha2-r12.ebuild 821 SHA256 b1b65bade04ce6e16dd4ad08181bfbc08b91038bf31f34a229982d772d4a3118 SHA512 5d56e188b9038f76fa9f8e9917994dba0cfc3f029a3af89c406873193270782f4a212482e681183afe83ff8f202370a6e98a7418ae8a0024e7f3aa81dc13cfdf WHIRLPOOL 01fb617f43b5ffeed4c4e1b7c141f2d0ebd301de871a5a3b7ef10d07b6149cf58b32ee2f7fabecd16919e802951dc3772f83eea1da0c76109f542e38946d6b84
EBUILD calculate-utilities-3.1.1_alpha2-r13.ebuild 822 SHA256 98ec5be356e5dff45316f9297c6f19f000b59e8ed4f662593fc2da4e5c8dd9dd SHA512 cb1e49279028266beac5889940fa9dc0c569c44b2fde0127a862fdf739aa2d8accad01809ff327b08ec6359c267dec3e2f21141db0ab8d0b1036ce81a53d4824 WHIRLPOOL 7a1bc5dd3776aa52c887ae76af272ad3317f6bebb86f5adbf248fe30dd8d4f898b553d0a78a4c2bb175b698c2a2b58f5a8ae2364eb05801048cb57aa27d99066
EBUILD calculate-utilities-3.1.1_alpha2-r14.ebuild 822 SHA256 531dffa5dcbfe59ea58c47f66ea396bc6a2c6144c0a5f66f92da4d4b0e9a894d SHA512 960798703eb3230187f4e44b2678b6f6bcb610b224b41eb7fa6d0eb681473b85f3d61b054f609f4269deed2758a5bcf26b49bed7f0c92a8d1c128661f67d1d5e WHIRLPOOL 3d7758e9792ca0e9a0e975d56a0175c5864c8bf540d50d020ee96f604d87956f0a1f92b73466fd32fa6949b4b83c9db06280e0b822644baea8db45e7c12e7c0b
EBUILD calculate-utilities-3.1.1_alpha2-r2.ebuild 812 SHA256 a3f7e50a7d5e7ee612a797b144bb99deb8c4a6a5d52e53fe9db026f834e46bae SHA512 14aa168f9a77d5a1fe099e5fbe04c48287b5524bf099180f7d62739f9ce113358ed092ae50d2cd019dbd9cf6ccc643491accf6fcbf3963355ec8e3976ec230d7 WHIRLPOOL a7c7a8c12436ac1fc0847872c8ed2bfe4be49aec8d896ca7b52cfc08d8f0ca1625d0ad7485932b219f01cb3332d949991c713c090fba14dd42e95354620d996c
EBUILD calculate-utilities-3.1.1_alpha2-r3.ebuild 812 SHA256 0487e98bdecdd898deb5226b0d65aef9b34f5c0338865484718fece5afb2e59f SHA512 22d698366844041accad94a7464f9f9bdfaf137328ae628e7e37ecf080293f2b472fabceca1098ad5a09254430e01b44fb01ae2e20dd5c6f53abfe1cb97f4722 WHIRLPOOL faddda116dca5eaa52c6b9d505923cae96382f7f39d1921d1c84816af484f08b7e9da856b9514e8133cd8f8daa74782930223a14a3f90222a76cbf691bd159ba
EBUILD calculate-utilities-3.1.1_alpha2-r4.ebuild 815 SHA256 12c8d2ca9c3813aaa2ac0f831ea5b362c99adc09b3018070c143f681ede69c70 SHA512 42d207ebffddf00d5863bde87ca4ddf247df4032ade14cdb488ea78aa47a45fd2f4933fe8dd1d8bf1e8ce590feaeba032643c65cd5fbb309b6f33ba3e503a5cb WHIRLPOOL 1d41a910d291f246fec99376c3be44abf51829cab9ff2067ff2f5e1a15bfe16691f9013ba5aeee5a0d549ef880249de0b472538df8acc6798f276358e0da911f

@ -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=""
IUSE="cl_consolegui cl_client cl_desktop cl_console"
RDEPEND="${RDEPEND}
=sys-apps/calculate-install-3.1.1_alpha2-r4
=sys-apps/calculate-i18n-3.1.1_alpha2-r1
=sys-apps/calculate-lib-3.1.1_alpha2-r11
=sys-apps/calculate-core-3.1.1_alpha2-r3
=sys-apps/calculate-update-3.1.1_alpha2-r2
cl_client? ( =sys-apps/calculate-client-3.1.1_alpha2 )
cl_desktop? ( =sys-apps/calculate-desktop-3.1.1_alpha2-r2 )
cl_consolegui? ( =sys-apps/calculate-console-gui-3.1.1_alpha2 )
cl_console? ( =sys-apps/calculate-console-3.1.1_alpha2 )
"
Loading…
Cancel
Save