public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Magnus Granberg" <zorry@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: pym/tbc/
Date: Wed,  5 Aug 2015 01:10:46 +0000 (UTC)	[thread overview]
Message-ID: <1438736991.1cbba36a9ea54c96b751728c98e30e0c23fac006.zorry@gentoo> (raw)

commit:     1cbba36a9ea54c96b751728c98e30e0c23fac006
Author:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  5 01:09:51 2015 +0000
Commit:     Magnus Granberg <zorry <AT> gentoo <DOT> org>
CommitDate: Wed Aug  5 01:09:51 2015 +0000
URL:        https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=1cbba36a

add remove package and fix some repoman stuff

 pym/tbc/build_log.py |  4 ++--
 pym/tbc/package.py   | 38 ++++++++++++++++++++++----------------
 pym/tbc/sqlquerys.py |  5 +++++
 3 files changed, 29 insertions(+), 18 deletions(-)

diff --git a/pym/tbc/build_log.py b/pym/tbc/build_log.py
index 71c14b5..d72ef91 100644
--- a/pym/tbc/build_log.py
+++ b/pym/tbc/build_log.py
@@ -32,7 +32,7 @@ from tbc.sqlquerys import add_logs, get_config_id, get_ebuild_id_db, add_new_bui
 	add_repoman_log
 from sqlalchemy.orm import sessionmaker
 
-def repoman_check_full(session, pkgdir, package_id, config_id):
+def check_repoman_full(session, pkgdir, package_id, config_id):
 	# Check cp with repoman repoman full
 	status = repoman_full(session, pkgdir, config_id)
 	repoman_hash = hashlib.sha256()
@@ -224,7 +224,7 @@ def get_buildlog_info(session, settings, pkg, build_dict):
 	categories = element[0]
 	package = element[1]
 	pkgdir = myportdb.getRepositoryPath(build_dict['repo']) + "/" + categories + "/" + package
-	repoman_error_list = repoman_check_full(session, pkgdir, build_dict['package_id'], config_id)
+	repoman_error_list = check_repoman_full(session, pkgdir, build_dict['package_id'], config_id)
 	build_log_dict = {}
 	build_log_dict['fail'] = False
 	if repoman_error_list:

diff --git a/pym/tbc/package.py b/pym/tbc/package.py
index 657c90d..0bb41eb 100644
--- a/pym/tbc/package.py
+++ b/pym/tbc/package.py
@@ -16,7 +16,7 @@ from tbc.sqlquerys import add_logs, get_package_info, get_config_info, \
 	get_package_metadata_sql, update_package_metadata, update_manifest_sql, \
 	get_package_info_from_package_id, get_config_all_info, add_new_package_sql, \
 	get_ebuild_checksums, get_ebuild_id_db, get_configmetadata_info, get_setup_info, \
-	get_ebuild_info_ebuild_id, get_ebuild_restrictions
+	get_ebuild_info_ebuild_id, get_ebuild_restrictions, add_old_package
 
 class tbc_package(object):
 
@@ -159,6 +159,7 @@ class tbc_package(object):
 						log_msg = "B %s:%s USE: %s Setup: %s" % (k, v['repo'], use_flagsDict, setup_id,)
 						add_logs(self._session, log_msg, "info", self._config_id)
 					i = i +1
+
 	def get_changelog_text(self, pkgdir):
 		changelog_text_dict, max_text_lines = get_log_text_dict(pkgdir + "/ChangeLog")
 		spec = 3
@@ -214,7 +215,7 @@ class tbc_package(object):
 	def add_package(self, packageDict, package_metadataDict, package_id, new_ebuild_id_list, old_ebuild_id_list, manifest_checksum_tree):
 		# Use packageDict to update the db
 		ebuild_id_list = add_new_ebuild_sql(self._session, packageDict)
-		
+
 		# Make old ebuilds unactive
 		for ebuild_id in ebuild_id_list:
 			new_ebuild_id_list.append(ebuild_id)
@@ -286,12 +287,13 @@ class tbc_package(object):
 			return
 
 		package_id = add_new_package_sql(self._session, cp, repo)
-		
+
 		# Check cp with repoman full
 		status = check_repoman_full(self._session, pkgdir, package_id, self._config_id)
 		if status:
-					log_msg = "Repoman %s:%s ... Fail." % (cpv, repo)
-					add_logs(self._session, log_msg, "error", self._config_id)
+			log_msg = "Repoman %s::%s ... Fail." % (cp, repo)
+			add_logs(self._session, log_msg, "error", self._config_id)
+
 		package_metadataDict = self.get_package_metadataDict(pkgdir, package_id)
 		# Get the ebuild list for cp
 		ebuild_list_tree = self._myportdb.cp_list(cp, use_cache=1, mytree=mytree)
@@ -308,7 +310,7 @@ class tbc_package(object):
 		old_ebuild_id_list = []
 		for cpv in sorted(ebuild_list_tree):
 			packageDict[cpv] = self.get_packageDict(pkgdir, cpv, repo)
-			
+
 			# take package descriptions from the ebuilds
 			if package_metadataDict[package_id]['metadata_xml_descriptions'] != packageDict[cpv]['ebuild_version_descriptions_tree']:
 				package_metadataDict[package_id]['metadata_xml_descriptions'] = packageDict[cpv]['ebuild_version_descriptions_tree']
@@ -329,6 +331,7 @@ class tbc_package(object):
 		pkgdir = repodir + "/" + cp # Get RepoDIR + cp
 		mytree = []
 		mytree.append(repodir)
+
 		manifest_checksum_tree = self.get_manifest_checksum_tree(pkgdir, cp, repo, mytree)
 		if manifest_checksum_tree is None:
 			return
@@ -340,17 +343,11 @@ class tbc_package(object):
 			log_msg = "U %s:%s" % (cp, repo)
 			add_logs(self._session, log_msg, "info", self._config_id)
 
-			# Check cp with repoman full
-			status = check_repoman_full(self._session, pkgdir, package_id, self._config_id)
-			if status:
-					log_msg = "Repoman %s:%s ... Fail." % (cpv, repo)
-					add_logs(self._session, log_msg, "error", self._config_id)
-
 			# Get the ebuild list for cp
 			old_ebuild_id_list = []
 			ebuild_list_tree = self._myportdb.cp_list(cp, use_cache=1, mytree=mytree)
 			if ebuild_list_tree == []:
-				if manifest_checksum_tree != "0":
+				if manifest_checksum_tree == "0":
 					old_ebuild_id_list = get_ebuild_id_list(self._session, package_id)
 					for ebuild_id in old_ebuild_id_list:
 						EbuildInfo = get_ebuild_info_ebuild_id(self._session, ebuild_id)
@@ -358,15 +355,24 @@ class tbc_package(object):
 						# R =  remove ebuild
 						log_msg = "R %s:%s" % (cpv, repo,)
 						add_logs(self._session, log_msg, "info", self._config_id)
+						if not os.path.isdir(pkgdir):
+							add_old_package(self._session, package_id)
 					add_old_ebuild(self._session, old_ebuild_id_list)
 					log_msg = "C %s:%s ... Done." % (cp, repo)
 					add_logs(self._session, log_msg, "info", self._config_id)
+
 				else:
 					log_msg = "QA: Can't get the ebuilds list. %s:%s" % (cp, repo,)
 					add_logs(self._session, log_msg, "info", self._config_id)
 					log_msg = "C %s:%s ... Fail." % (cp, repo)
 					add_logs(self._session, log_msg, "info", self._config_id)
 				return
+
+			# Check cp with repoman full
+			status = check_repoman_full(self._session, pkgdir, package_id, self._config_id)
+			if status:
+				log_msg = "Repoman %s::%s ... Fail." % (cp, repo)
+				add_logs(self._session, log_msg, "error", self._config_id)
 			package_metadataDict = self.get_package_metadataDict(pkgdir, package_id)
 			packageDict ={}
 			new_ebuild_id_list = []
@@ -374,14 +380,14 @@ class tbc_package(object):
 
 				# split out ebuild version
 				ebuild_version_tree = portage.versions.cpv_getversion(cpv)
-				
+
 				# Get packageDict for cpv
 				packageDict[cpv] = self.get_packageDict(pkgdir, cpv, repo)
-				
+
 				# take package descriptions from the ebuilds
 				if package_metadataDict[package_id]['metadata_xml_descriptions'] != packageDict[cpv]['ebuild_version_descriptions_tree']:
 					package_metadataDict[package_id]['metadata_xml_descriptions'] = packageDict[cpv]['ebuild_version_descriptions_tree']
-					
+
 				# Get the checksum of the ebuild in tree and db
 				ebuild_version_checksum_tree = packageDict[cpv]['checksum']
 				checksums_db, fail = get_ebuild_checksums(self._session, package_id, ebuild_version_tree)

diff --git a/pym/tbc/sqlquerys.py b/pym/tbc/sqlquerys.py
index 4d2a5e5..7791e6e 100644
--- a/pym/tbc/sqlquerys.py
+++ b/pym/tbc/sqlquerys.py
@@ -453,6 +453,11 @@ def add_old_ebuild(session, old_ebuild_list):
 			for build_job in build_job_id_list:
 				del_old_build_jobs(session, build_job.BuildJobId)
 
+def add_old_package(session, package_id):
+	PackagesInfo = session.query(Packages).filter_by(PackageId = package_id).one()
+	PackagesInfo.Active = False
+	session.commit()
+
 def add_new_package_sql(session, cp, repo):
 	element = cp.split('/')
 	categories = element[0]


             reply	other threads:[~2015-08-05  1:10 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-05  1:10 Magnus Granberg [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-09-03 21:03 [gentoo-commits] proj/tinderbox-cluster:master commit in: pym/tbc/ Magnus Granberg
2015-09-06 20:29 Magnus Granberg
2015-10-06 19:31 Magnus Granberg
2015-12-20  0:12 Magnus Granberg
2015-12-21 22:54 Magnus Granberg
2016-01-07  7:33 Magnus Granberg
2016-01-10 12:53 Magnus Granberg
2016-01-18 20:26 Magnus Granberg
2016-01-25 22:48 Magnus Granberg
2016-01-26 20:29 Magnus Granberg
2016-01-26 23:16 Magnus Granberg
2016-01-27  5:21 Magnus Granberg
2016-01-31 13:39 Magnus Granberg
2016-02-02 23:13 Magnus Granberg
2016-02-10 20:24 Magnus Granberg
2016-02-20 12:12 Magnus Granberg
2016-02-22 17:08 Magnus Granberg
2016-02-22 18:11 Magnus Granberg
2016-02-22 18:33 Magnus Granberg
2016-02-29 23:01 Magnus Granberg
2016-03-02 20:50 Magnus Granberg
2016-03-03 15:26 Magnus Granberg
2016-03-06 17:47 Magnus Granberg
2016-11-15 21:58 Magnus Granberg
2016-11-20 15:37 Magnus Granberg
2016-12-05 21:11 Magnus Granberg
2016-12-10 16:17 Magnus Granberg
2016-12-20 20:25 Magnus Granberg
2016-12-20 20:25 Magnus Granberg
2016-12-20 20:25 Magnus Granberg
2016-12-20 21:16 Magnus Granberg
2016-12-20 21:21 Magnus Granberg
2016-12-20 22:13 Magnus Granberg
2016-12-22 10:11 Magnus Granberg
2016-12-22 10:11 Magnus Granberg
2016-12-22 10:15 Magnus Granberg
2016-12-22 11:29 Magnus Granberg
2016-12-22 11:29 Magnus Granberg
2016-12-22 11:29 Magnus Granberg
2016-12-22 18:31 Magnus Granberg
2017-01-08 15:33 Magnus Granberg
2017-01-08 15:33 Magnus Granberg
2017-01-15 19:57 Magnus Granberg
2018-02-05  2:52 Magnus Granberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438736991.1cbba36a9ea54c96b751728c98e30e0c23fac006.zorry@gentoo \
    --to=zorry@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox