Добавлена пересборка измененных пакетов в calculate-assemble

atratsevskiy
Mike khiretskiy 11 years ago
parent 0ff919d86d
commit 52c49f52e1

@ -3,11 +3,13 @@ AUX calculate-assemble-2.2.31-fix_video_script.patch 805 SHA256 3b18976d9f5af758
AUX calculate-assemble-2.2.31-force_checkout.patch 1793 SHA256 2103992660ed97040ae4ab54ebb7ecee56d4dd7e0791a1cb5deff613474114e4 SHA512 f7f027667f738fb955dd9a11e4f896d4713a1eff321c7cc095b9752a4efb1e31e5a8eaecf51a7c5b08cbbd54ab54dcd6d968b4b5ac338a1ce3952e0712effeea WHIRLPOOL 0217c51dd984001cd49e3972734b87a0aca8cdfc92aea2db212e057459ccd2bee1824e14c0af3fd1512cf9064ac32231a80eb8bbee4b1cc262d708bdb707e892
AUX calculate-assemble-2.2.31-force_option.patch 10779 SHA256 b46a1b7fee8df1d50bb2aa1e7150dfad3c8365cf4402220da933eda58f8424fd SHA512 70788138099f97f4f1c545a742a464ed87bbd99eed311a2d78b1db798211e01ecbb18eb75ed70d071cbed0ac8c3e9b29eb3796acc5e13772d497670d916816e8 WHIRLPOOL d3c60830ea6438e2ae62e08f0c9a06c100e72ebbeadedc64bd9970baf3fad09ccb4ec2531850d1a0dc11e940f9204671c6506b53b24a5f99a5d2e67b25843687
AUX calculate-assemble-2.2.31-module_rebuild.patch 1010 SHA256 1cb20de6e82c29d71f9c2739df0f5955cbc408342c708c45c3dfdb89068c45dd SHA512 465521abc8852f27dd069815aa06e80184020e75bf275db63f35deed8a821cb2a45ead1812d93ee6f5c26199ed8a4c2ebb1e787edcff62229af8bf9669b84b53 WHIRLPOOL e6683c11db200a4ebde039809f1dd76e34fb67ff8c826f867b52126c3d23497cfe328a8b58a450932831d64f04d3359f9ba76c2319765d56551afa53ac941cfc
AUX calculate-assemble-2.2.31-rebuild_changed.patch 7927 SHA256 a524689b7d907fec9eb9399a83176b823a742f27e2e68f7ad330bd279f7b0760 SHA512 863f5cf2962e9daad89301ac10e11bd210dfd3febc38135fee9efa96347e9086b07e54c8b2a8edf6a1a26b62c99879811b3bb6bd02c96d36bfeadac53547e8c6 WHIRLPOOL c19219aa4d4539435e9c0c035e45971a5ce9cbdd9391b47ce8141505cc690344f7de793186f182fb0509622dbf51834216349d487af727df732ae560391ecfb4
AUX calculate-assemble-2.2.31-video_script.patch 1148 SHA256 629fb65eba9bff6f5e47b357cdbca14ca945b9848221caf8d13c2dafe504f53f SHA512 64d4b6ca7b119e1ee5a0b4c75b2cfebb6d738c5616018f9d09de43694ddeea2182a77aab85646b6096d6d92ae24f61d4368a3fac4eb76b6ab4ef02a186d32d96 WHIRLPOOL d1b47d83ea170aebdc1f1b19c8dc85ddb5b6047d5bf057c87c0864bd0836b5bce12fc36eb882d10207b5b92a349f3ec3af93449867607f43e6a24c4041e331ef
AUX calculate-assemble-2.2.31-video_script2.patch 825 SHA256 b44dc9d7fc9e0550ae01857322313e5e0e558a0c050b6393072f5ff1da966194 SHA512 c2657c5afca7887440dc337bdfa94392e39fd90c3aa4d011b44c0ea5427c3a63d98df3f9324f3266777c24228c01fe1623ca6bb24f7c73871674ff16cde482a8 WHIRLPOOL bd18de7a17d33c2434854b4e79c0c579ac2619d6ba9b43f3524403fc7596b351f0e938180742e2db9562305a68c0edb15ba5504835fd463c0dd2f5aa3dc6a639
DIST calculate-assemble-2.2.31.tar.bz2 28977 SHA256 8488de0b12ee9a9c30d0dd8d5f16f8da11b8b135147ffa29856c91a757afaad8 SHA512 50f9c0cd8442630c882a23a41e73b29355758cd91d4f9911f01c27d2dd7bf0c4b5bc90226075d4cb01ee05829652ed134ae80f89e1795beef5089989e142c223 WHIRLPOOL c3317c2843dc82b77abcecdc3120bbc1df7a31b4cb3dd33de623b2cb30ac9ec40e4cf2662f898eccb41d5a3cc2e75a9e3cbe34f4d989cb6463c3f5524aa43df7
EBUILD calculate-assemble-2.2.31-r6.ebuild 1118 SHA256 7c090c0220f152bf5793076f31d8364283a3347bc3eb1f27e76ca27a46ae140b SHA512 f491fce12317c3e9d37d236f35f6de6337543bebf887fb543c56775fc17b4eff9d9ffa96aec7940fd079694364c223cce6335135c164d655d543d930f4296b4c WHIRLPOOL 78fa3217b696ffc01f0aaac918f84bd1c7d166e972270a726facbb4e128a5b1c31d7bc28c501d2dd1d453f097c388040de5a96a180a61e66f456a9017bf1af08
EBUILD calculate-assemble-2.2.31-r7.ebuild 1206 SHA256 91e4915756b5544351de688b1041958a75f84a97bdee56d9923f8fd7bbfb9006 SHA512 885f638f42c909b395a788931df728cf26198eed5b9ab0a87e22c679fca4e9a6e9443305406d36fa1f9956fe42ce358d26401403f09c21ebd5611fa18ce99c79 WHIRLPOOL 4bd4ff116c5c79743b74fa17eb0d079fd61d21da6dc48c38d67f0437ac24696ec46330f669c8749159a4a5b30d37dd4b035e37ce317cfdeeeb47a3e5106c03a2
EBUILD calculate-assemble-2.2.31-r8.ebuild 1300 SHA256 3b15e318604ceb2148f13e2e89480da79c15c1ae26459b89e894d6c73e1e9e10 SHA512 815fc9e2352f17eab0c833c23b4654a5b96f722c2c4e6bc961ba21d13741a07e1261b446464f645221b18e1136225397e5eb33be48982ed89442b737e27e9b9f WHIRLPOOL 7e54a529cba9b9e38b7effc331a811211acf063a1ed998ffd9b34ca44c042d909b75e95ca6398f229fe750a95811c0e12fee13cc29ab02b7e1757c2459df6b94
EBUILD calculate-assemble-2.2.9999.ebuild 572 SHA256 5bc8194c32bc4677cf79eaf6ae5f2112cafa51ae900dc3ebb6e879d9414858ea SHA512 62a111e959134709ef7529bfe87ccdfb20b103efc5305bf497ee9f427b3f956f180cd5c612641e557607606de9dbae3326c7881cc16afd9372b752ef65d63c93 WHIRLPOOL 8340a2b45b9941a61473ec4d66d944524dcf6f973ad9a03b9b92471cf5c92199949b2d707e7f738d86bbc9774eebac561df52891385e57d75aa811f47b4c5821
MISC ChangeLog 16686 SHA256 759d02ea5f6029eab950ac93cf54a1c43dcc007a82be8e42cb82eac38369e979 SHA512 d4927fc6204a0a496248edbf3daf5b9259f0fc519a759c1dc8a6d6c2abab33074e75cd29e1696af3debaaac23548d0dc021e8d28c21d5c38cb8b2f06a973be0d WHIRLPOOL 7bd8bf84215ef77ec4035419f79d3226f3db13d6fb417e2b882bd4899bc240764ccc5a32154d8469153dc1c052936aad886a69916148bbf2bffa8d782b343401
MISC metadata.xml 273 SHA256 4e25d45ba43b2ab7f7ae8ab4cfc05c406566cfb143a87166de77fbd8d9f8a943 SHA512 98b0d7d37e851ea86b498b2c0675bf505c75cb00d13932720475cda8a485db2325e2551954af3c534b2f9ef213f372c563d739d25d04a3da681a661c9ade6e91 WHIRLPOOL 44babe185c821b525b0dc317acb29e01223eacd5862804a64e0884502c25a541f53d322f1e63649c90285e93834b802beb21e4b34bd27be4b8d66ae6ac882c96

@ -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/calculate2/${PN}/${P}.tar.bz2"
DESCRIPTION="The utilities for assembling tasks of Calculate Linux"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 x86"
DEPEND="~sys-apps/calculate-builder-2.2.31"
RDEPEND="${DEPEND}"
src_unpack() {
unpack "${A}"
cd "${S}"
# fix video script
epatch "${FILESDIR}/calculate-assemble-2.2.31-video_script.patch"
epatch "${FILESDIR}/calculate-assemble-2.2.31-video_script2.patch"
# discard clt
epatch "${FILESDIR}/calculate-assemble-2.2.31-discard_clt.patch"
# force checkout branches
epatch "${FILESDIR}/calculate-assemble-2.2.31-force_checkout.patch"
# -F option
epatch "${FILESDIR}/calculate-assemble-2.2.31-force_option.patch"
# newline for world
epatch "${FILESDIR}/calculate-assemble-2.2.31-fix_video_script.patch"
# fix module rebuild
epatch "${FILESDIR}/calculate-assemble-2.2.31-module_rebuild.patch"
# add rebuild changed
epatch "${FILESDIR}/calculate-assemble-2.2.31-rebuild_changed.patch"
}

@ -0,0 +1,223 @@
commit 77950c9102160e20fceef81f486d26bc1d26b39a
Author: Mike khiretskiy <mh@calculate.ru>
Date: Mon Mar 24 13:29:41 2014 +0400
Добавлена пересборка измененных пакетов
Добавлена пересборка пакетов у которых различаются зависимости
в дереве портежей и установленых
diff --git pym/cl_assemble.py pym/cl_assemble.py
index ded1c47..9824d71 100644
--- pym/cl_assemble.py
+++ pym/cl_assemble.py
@@ -1,6 +1,6 @@
#-*- coding: utf-8 -*-
-# Copyright 2010 Calculate Ltd. http://www.calculate-linux.org
+# Copyright 2010-2014 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.
@@ -43,6 +43,9 @@ import random
from shutil import copyfile
import time
from itertools import *
+from tools import SimpleRepositoryMapper, InstalledPackageInfo, EbuildInfo, \
+ EbuildInfoError
+
def DEBUG(msg):
if "DEBUG" in os.environ:
@@ -173,6 +176,10 @@ class cl_assemble(color_print):
# update world
{'command':'emerge -uDN --with-bdeps=y world',
'step':'update'},
+ # rebuild chanaged packages
+ {'command':'rebuildChangedPackages()',
+ 'message':_("Rebuild modified packages"),
+ 'step':'rebuild_chanaged'},
# depclean
{'command':'emerge --depclean',
'step':'depclean'},
@@ -2054,3 +2061,33 @@ class cl_assemble(color_print):
useName):
return True
return False
+
+ def rebuildChangedPackages(self):
+ if not self.assemblePath:
+ self.assemblePath = \
+ self.clVars.Get('cl_assemble_path')
+
+ varDbPath = path.join(self.assemblePath, 'var/db/pkg')
+ InstalledPackageInfo.pkg_dir = varDbPath
+ EbuildInfo.set_repository_mapper(
+ SimpleRepositoryMapper(self.assemblePath))
+
+ def rebuild_generator():
+ for pkg in InstalledPackageInfo.get_install_packages():
+ try:
+ if pkg != EbuildInfo(pkg.atom, pkg['repository']):
+ yield pkg.atom
+ except EbuildInfoError:
+ yield pkg.atom
+ rebuild_list = map(lambda x:"=%s"%x, rebuild_generator())
+ print "Package list:", ",".join(rebuild_list)
+ if rebuild_list:
+ rebuild_packages = " ".join(rebuild_list)
+
+ cmd = self.runChroot("emerge -1 %s" % rebuild_packages,
+ showProcess=True)
+ if cmd.failed():
+ raise AssembleError(
+ _("An error occurred when executing the command")+
+ ":\n %s"%self._getCommand(cmd.command))
+ return True
diff --git pym/tools.py pym/tools.py
new file mode 100644
index 0000000..47e8d09
--- /dev/null
+++ pym/tools.py
@@ -0,0 +1,141 @@
+#-*- coding: utf-8 -*-
+
+# Copyright 2014 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.
+
+from collections import Mapping
+from functools import total_ordering
+
+from os import path
+import bz2
+import re
+try:
+ from calculate.lib.utils.files import readFile, listDirectory, pathJoin
+except ImportError:
+ from cl_utils import readFile, listDirectory, pathJoin
+
+
+class SimpleRepositoryMapper(Mapping):
+ """
+ Определение пути до репозитория
+ """
+ map_repository = {'gentoo': '/usr/portage',
+ 'calculate': '/var/lib/layman/calculate'}
+ layman_path = '/var/lib/layman'
+
+ def __init__(self, prefix='/'):
+ self.prefix = prefix
+
+ def __getitem__(self, item):
+ if item in self.map_repository:
+ return pathJoin(self.prefix, self.map_repository[item])
+ return pathJoin(self.prefix, self.layman_path, item)
+
+ def __iter__(self):
+ return iter(self.map_repository)
+
+ def __len__(self):
+ return len(self.map_repository)
+
+
+class EbuildInfoError(Exception):
+ pass
+
+
+class EbuildInfo(object):
+ """
+ Информация о ebuild (DEPEND) из metadata
+ """
+ map_repository = SimpleRepositoryMapper()
+ meta_suffix_path = 'metadata/md5-cache'
+ support_keys = ('DEPEND', 'RDEPEND', 'PDEPEND')
+
+ def __init__(self, atom, repository):
+ meta_path = path.join(self.map_repository[repository],
+ self.meta_suffix_path)
+ self._meta_info_path = path.join(meta_path, atom)
+ if not path.exists(self._meta_info_path):
+ raise EbuildInfoError("Package is not found")
+ self._info = self._get_info()
+
+ def _get_info(self):
+ with open(self._meta_info_path, 'r') as f:
+ return {k.strip(): v.strip() for k, v in (line.partition('=')[::2]
+ for line in f.readlines())
+ if k in self.support_keys}
+
+ def __getitem__(self, item):
+ if item in self.support_keys:
+ return self._info.get(item,'')
+ raise KeyError(item)
+
+ @classmethod
+ def set_repository_mapper(cls, mapper):
+ cls.map_repository = mapper
+
+ def __eq__(self, other):
+ return all(other[k] == self[k] for k in self.support_keys)
+
+ def __ne__(self, other):
+ return any(other[k] != self[k] for k in self.support_keys)
+
+
+class InstalledPackageInfoError(Exception):
+ pass
+
+
+class InstalledPackageInfo(object):
+ """
+ Информация об установленном пакете (DEPEND) из /var/db/pkg
+ """
+ pkg_dir = '/var/db/pkg'
+ depend_pattern = 'declare (?:-x )?({0})="([^"]+)"'
+ re_depend = re.compile(depend_pattern.format("RDEPEND|PDEPEND|DEPEND"),
+ re.DOTALL)
+ re_multispace = re.compile("\s+", re.DOTALL)
+
+ def __init__(self, atom):
+ self.atom = atom
+ self._pkg_path = path.join(self.pkg_dir, atom)
+ if not path.exists(self._pkg_path):
+ raise InstalledPackageInfoError("Package is not found")
+ self._info = self._get_info()
+
+ def _get_info(self):
+ info = {k: "" for k in ("RDEPEND", "DEPEND", "PDEPEND")}
+ env_path = path.join(self._pkg_path, 'environment.bz2')
+ if path.exists(env_path):
+ with bz2.BZ2File(env_path, 'r') as f:
+ for r in self.re_depend.finditer(f.read()):
+ key, value = r.groups()
+ value = self.re_multispace.sub(" ", value)
+ info[key] = value.strip()
+ rep_path = path.join(self._pkg_path, 'repository')
+ info['repository'] = readFile(rep_path).strip()
+ return info
+
+ def __getitem__(self, item):
+ return self._info[item]
+
+ @classmethod
+ def get_install_packages(cls):
+ for category in listDirectory(cls.pkg_dir):
+ for pkg in listDirectory(path.join(cls.pkg_dir, category)):
+ yield InstalledPackageInfo("%s/%s" % (category, pkg))
+
+ def __str__(self):
+ return self.atom
+
+ def __repr__(self):
+ return "InstalledPackageInfo(%s)" % self.atom

@ -4,6 +4,7 @@ EBUILD calculate-utilities-2.2.31-r24.ebuild 676 SHA256 05e2c68538b3739912571fb6
EBUILD calculate-utilities-2.2.31-r25.ebuild 676 SHA256 3d869a4ec7ca07a0afebb7a4c6da399fb202305b9089108e6823c08903cd30cd SHA512 91143edcb8969950e77ced767758488c619bcf8ed0e58bc81dfd06c1f98e85808325344ea7b814e6b7222addac855122882d6dbef705eb7f63208e94fe873d52 WHIRLPOOL ccfb9eb1f0208c71a3f28bb6e34e4ea5f9a053e6d5ea4af08f31355f1496568bd0856f8ad78e64baaa2ed793ac10ca969c8a87f29eaab517e10fcdd3ae89ec2d
EBUILD calculate-utilities-2.2.31-r26.ebuild 676 SHA256 f27fff785fd7c5f7d1af3417ed07dfa69320f1faa57840263e75218a70d45793 SHA512 8939378234f3b5ac1253df35ac5b69d154c00d01213589301867a81501b494b416fc23814a3ab2ed7889c27fb69970a30bcecc73e13df52d000bf86e6eb379bb WHIRLPOOL c26dd9e522180a6c886421e66ae245afe28b5345f6ae91f7e70b047fac4b6c8c28b017b25630b803104704a22866c8df8c8def5a21f3569d0d18e2f50a9cb471
EBUILD calculate-utilities-2.2.31-r27.ebuild 676 SHA256 36a923a987117677a1abaab400e085614d9d7a145d0bf021e7fa2dee364aac11 SHA512 f46b2e1f0fdb9b5a4053081c514b17e5b31025f808add40c48ea26841cc22f948418b82d647db98a5e255762938d6e316c7152c7697a5686a006b41c966c5526 WHIRLPOOL ae45c0e31f2e08d07290ccc01dee8df42ec2998f5e64445a04f2a2bd83635ae5bad215406a88b045c38532f82f0bd4a0c6660b61200027e0c72b0dc8bb9800a3
EBUILD calculate-utilities-2.2.31-r28.ebuild 676 SHA256 5ac3364907cbf8123af1ba160af2c7fde1cb4a0958a2436181b15276786817b6 SHA512 836cabb714f3bef93e1b38e25c36d6134cbdec2373f603ff3dd8eb9bdd4ad086c7689ea3a38224451fbf494bf4654f5de60f4349f6c41199579ea0a9da4c6739 WHIRLPOOL 4b780d5492c073132cacc19de7c1e6e093267f8d79c469fffa6a48e416bffddd8b9871f4eb853bb6c78ebb300aea5ccde240e21ac023c7318b2ef51841aeadeb
EBUILD calculate-utilities-2.2.9999.ebuild 842 SHA256 56d97b7d2ce11d23b25d9036b4e2ee196b547ce1d11b0cc349a8205515b66bf1 SHA512 fc7802b92ade52210fa7381b55c48638da6d9adee6d2f03f18d6bdd0050756089b3ca8de944f4e865517554523b40737abe9f22587ecae74079eec563f80868b WHIRLPOOL f1382f0629a8dae37aaecf40cb8cbc3682bde3b43e92c9c6a84cda75897dc5d5de043233fb7a3f929749520b05fe3af94187c7a3ccdae4e252e83699d871f225
EBUILD calculate-utilities-3.1.6-r12.ebuild 770 SHA256 620f29f93e0d5ff2d8b426946fb45b892bc5316904dc4bdc1b7a4e0750236f04 SHA512 7608d4391302e420abef7fd8236010692ea0d3aba29fadd5b8d3e3c31ef34dee29b0ee83e96c091f502c26e798975ec1c6fbc4ed51c5417b72589b64f4cc2a88 WHIRLPOOL 485e1eb97d02c22b10959aec1c2897f5c76c739fc13dda1b876c5bc47e3d52443e68067848bb894921dae1dc0e121b58e583c548ed45304033b93596d17f269a
EBUILD calculate-utilities-3.1.8-r1.ebuild 755 SHA256 3bec5752d8439e0bb64c921fe5bd708e2f942b7555229f7a2c2cc6415e58cd63 SHA512 8f40e2fccf74a54471ad0b15c06d2e1ab5a3857c62d00d9d805aba12b016944982eceff2eb2ab3b75e6488ec85d40de75257cd23d12fc5eaccd31c841b2759ec WHIRLPOOL c93eca9734e7c9112aa5453433c77e5c37b4b0a3094e473fe39189657427ab5efdfb17c157944ea48b7438c268eedcb116a8de2ef6fbefa1947c21187075d53d

@ -0,0 +1,30 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=3
DESCRIPTION="Calculate Utilities meta package"
HOMEPAGE="http://www.calculate-linux.org/main/en/calculate2"
SRC_URI=""
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="
cl_assemble
cl_builder
cl_server
"
RDEPEND="${RDEPEND}
!sys-apps/calculate-templates
!<sys-apps/calculate-install-3.0.0_alpha1
=sys-apps/calculate-lib-2.2.31-r4
=sys-apps/calculate-i18n-2.2.31
cl_assemble? ( =sys-apps/calculate-assemble-2.2.31-r8 )
cl_builder? ( =sys-apps/calculate-builder-2.2.31-r15 )
cl_server? ( =sys-apps/calculate-server-2.1.16-r12 )
"
Loading…
Cancel
Save