From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 78C651384C3 for ; Sun, 6 Sep 2015 20:29:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4E6351421B; Sun, 6 Sep 2015 20:29:33 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BE91A1421B for ; Sun, 6 Sep 2015 20:29:32 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2E6C0340AB0 for ; Sun, 6 Sep 2015 20:29:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E2F53155 for ; Sun, 6 Sep 2015 20:29:26 +0000 (UTC) From: "Magnus Granberg" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Magnus Granberg" Message-ID: <1441571318.988511359bd3f58aa91f8cd94179b8f44779719a.zorry@gentoo> Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: pym/tbc/ X-VCS-Repository: proj/tinderbox-cluster X-VCS-Files: pym/tbc/package.py X-VCS-Directories: pym/tbc/ X-VCS-Committer: zorry X-VCS-Committer-Name: Magnus Granberg X-VCS-Revision: 988511359bd3f58aa91f8cd94179b8f44779719a X-VCS-Branch: master Date: Sun, 6 Sep 2015 20:29:26 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 510f49d1-d8ac-4d46-ab77-df335fcc336e X-Archives-Hash: 20580fb72bcea3dcff4b23d46257c2bb commit: 988511359bd3f58aa91f8cd94179b8f44779719a Author: Magnus Granberg gentoo org> AuthorDate: Sun Sep 6 20:28:38 2015 +0000 Commit: Magnus Granberg gentoo org> CommitDate: Sun Sep 6 20:28:38 2015 +0000 URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=98851135 add git log file commit ID pym/tbc/package.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pym/tbc/package.py b/pym/tbc/package.py index 6224846..ef9b453 100644 --- a/pym/tbc/package.py +++ b/pym/tbc/package.py @@ -82,6 +82,13 @@ class tbc_package(object): if ebuild_auxdb_list[i] == '': ebuild_auxdb_list[i] = '' return ebuild_auxdb_list + def get_git_log_ebuild(self, repodir, ebuild_file): + git_log_ebuild = '' + g = git.Git(repodir) + for line in g.log('-n 1', ebuild_file).splitlines(): + if re.search('^commit', line): + git_log_ebuild = re.sub('commit', '', line) + return git_log_ebuild def get_packageDict(self, pkgdir, cpv, repo): @@ -90,10 +97,10 @@ class tbc_package(object): element = portage.versions.cpv_getkey(cpv).split('/') categories = element[0] package = element[1] - + ebuild_file = pkgdir + "/" + package + "-" + ebuild_version_tree + ".ebuild" # Make a checksum of the ebuild try: - ebuild_version_checksum_tree = portage.checksum.sha256hash(pkgdir + "/" + package + "-" + ebuild_version_tree + ".ebuild")[0] + ebuild_version_checksum_tree = portage.checksum.sha256hash(ebuild_file)[0] except: ebuild_version_checksum_tree = "0" log_msg = "QA: Can't checksum the ebuild file. %s on repo %s" % (cpv, repo,) @@ -102,8 +109,7 @@ class tbc_package(object): add_logs(self._session, log_msg, "info", self._config_id) git_commit = '0' else: - git_commit = '0' - #FIXME The git commit need to be fixed or when $ID get fixed + git_commit = self.get_git_log_ebuild(repodir, ebuild_file): # Get the ebuild metadata ebuild_version_metadata_tree = self.get_ebuild_metadata(cpv, repo) @@ -177,14 +183,13 @@ class tbc_package(object): package_metadataDict = {} md_email_list = [] herd = None + attDict['metadata_xml_email'] = False try: pkg_md = MetaDataXML(pkgdir + "/metadata.xml", herd) except: log_msg = "Metadata file %s is missing or has errors" % (pkgdir + "/metadata.xml") add_logs(self._session, log_msg, "qa", self._config_id) - attDict['metadata_xml_email'] = False else: - attDict['git_log_pkg_text'] = self.get_git_log_pkg_text(repodir, cp) tmp_herds = pkg_md.herds() if tmp_herds != (): attDict['metadata_xml_herds'] = tmp_herds[0] @@ -196,7 +201,7 @@ class tbc_package(object): else: log_msg = "Metadata file %s missing Email" % (pkgdir + "/metadata.xml") add_logs(self._session, log_msg, "qa", self._config_id) - attDict['metadata_xml_email'] = False + attDict['git_log_pkg_text'] = self.get_git_log_pkg_text(repodir, cp) attDict['metadata_xml_descriptions'] = '' package_metadataDict[package_id] = attDict return package_metadataDict