From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SP9t6-0001qa-2A for garchives@archives.gentoo.org; Tue, 01 May 2012 10:00:52 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 85E34E075E; Tue, 1 May 2012 10:00:44 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 2DE9CE075E for ; Tue, 1 May 2012 10:00:44 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A98EF1B4014 for ; Tue, 1 May 2012 10:00:41 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id B6B60E5403 for ; Tue, 1 May 2012 10:00:39 +0000 (UTC) From: "Magnus Granberg" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Magnus Granberg" Message-ID: <1335866427.80389dc4205ecc5c50f299ad5b1eff623ac4e30f.zorry@gentoo> Subject: [gentoo-commits] dev/zorry:master commit in: gobs/pym/ X-VCS-Repository: dev/zorry X-VCS-Files: gobs/pym/package.py X-VCS-Directories: gobs/pym/ X-VCS-Committer: zorry X-VCS-Committer-Name: Magnus Granberg X-VCS-Revision: 80389dc4205ecc5c50f299ad5b1eff623ac4e30f X-VCS-Branch: master Date: Tue, 1 May 2012 10:00:39 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: a48173e1-a610-4f82-82e5-e2cd37fb0ecc X-Archives-Hash: 94cb3a13af056e71d80118ee718338d0 commit: 80389dc4205ecc5c50f299ad5b1eff623ac4e30f Author: Magnus Granberg gentoo org> AuthorDate: Tue May 1 10:00:27 2012 +0000 Commit: Magnus Granberg gentoo org> CommitDate: Tue May 1 10:00:27 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Ddev/zorry.git;a=3D= commit;h=3D80389dc4 don't error on emty dirs package.py --- gobs/pym/package.py | 31 +++++++++++++++++++++++++------ 1 files changed, 25 insertions(+), 6 deletions(-) diff --git a/gobs/pym/package.py b/gobs/pym/package.py index 4c571b6..7487494 100644 --- a/gobs/pym/package.py +++ b/gobs/pym/package.py @@ -217,8 +217,14 @@ class gobs_package(object): package_metadataDict =3D self.get_package_metadataDict(pkgdir, packag= e) add_new_package_metadata(conn,package_id, package_metadataDict) # Add the manifest file to db - manifest_checksum_tree =3D portage.checksum.sha256hash(pkgdir + "/Man= ifest")[0] - get_manifest_text =3D get_file_text(pkgdir + "/Manifest") + try: + manifest_checksum_tree =3D portage.checksum.sha256hash(pkgdir + "/Ma= nifest")[0] + except: + manifest_checksum_tree =3D "0" + get_manifest_text =3D "0" + logging.info("QA: Can't checksum the Manifest file. %c/%s", categori= es, package) + else: + get_manifest_text =3D get_file_text(pkgdir + "/Manifest") add_new_manifest_sql(conn,package_id, get_manifest_text, manifest_che= cksum_tree) CM.putConnection(conn) logging.info("C %s/%s ... Done.", categories, package) @@ -226,14 +232,24 @@ class gobs_package(object): def update_package_db(self, categories, package, package_id): conn=3DCM.getConnection() # Update the categories and package with new info + logging.info("C %s/%s", categories, package) # C =3D Checking pkgdir =3D self._mysettings['PORTDIR'] + "/" + categories + "/" + pack= age # Get PORTDIR with cp - # Get the checksum from the file in portage tree - manifest_checksum_tree =3D portage.checksum.sha256hash(pkgdir + "/Mani= fest")[0] + # Get the checksum from the Manifest file. + try: + manifest_checksum_tree =3D portage.checksum.sha256hash(pkgdir + "/Man= ifest")[0] + except: + # We did't fine any Manifest file + manifest_checksum_tree =3D '0' + ebuild_list_tree =3D self._myportdb.cp_list((categories + "/" + packa= ge), use_cache=3D1, mytree=3DNone) + if ebuild_list_tree =3D=3D []: + CM.putConnection(conn) + logging.info("QA: No Manifest file or ebuilds in %s/%s.", categories= , package) + logging.info("C %s/%s ... Done.", categories, package) + return # Get the checksum from the db in package table manifest_checksum_db =3D get_manifest_db(conn,package_id) # if we have the same checksum return else update the package ebuild_list_tree =3D self._myportdb.cp_list((categories + "/" + packag= e), use_cache=3D1, mytree=3DNone) - logging.info("C %s/%s", categories, package) # C =3D Checking if manifest_checksum_tree !=3D manifest_checksum_db: logging.info("U %s/%s", categories, package) # U =3D Update # Get package_metadataDict and update the db with it @@ -269,7 +285,10 @@ class gobs_package(object): metadataDict =3D self.get_metadataDict(packageDict, ebuild_id_list) add_new_metadata(conn,metadataDict) # Get the text in Manifest and update it - get_manifest_text =3D get_file_text(pkgdir + "/Manifest") + try: + get_manifest_text =3D get_file_text(pkgdir + "/Manifest") + except: + get_manifest_text =3D "0" update_manifest_sql(conn,package_id, get_manifest_text, manifest_chec= ksum_tree) # Add any qa and repoman erros to buildlog qa_error =3D []