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 366C81387FD for ; Mon, 31 Mar 2014 01:25:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 536D4E0B57; Mon, 31 Mar 2014 01:25:09 +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 A76D1E0B28 for ; Mon, 31 Mar 2014 01:25:08 +0000 (UTC) Received: from localhost.localdomain (c-67-170-82-28.hsd1.wa.comcast.net [67.170.82.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: nullishzero@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 8444F33FC71; Mon, 31 Mar 2014 01:25:07 +0000 (UTC) From: Pavel Kazakov To: gentoo-portage-dev@lists.gentoo.org Cc: Pavel Kazakov Subject: [gentoo-portage-dev] [PATCH v2 1/2] Move -MERGING- string to a constant. Date: Sun, 30 Mar 2014 18:24:22 -0700 Message-Id: <1396229063-354-1-git-send-email-nullishzero@gentoo.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1394691047-14156-1-git-send-email-nullishzero@gentoo.org> References: <1394691047-14156-1-git-send-email-nullishzero@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org X-Archives-Salt: c09e8568-a224-49db-87ed-75f2ad56e83b X-Archives-Hash: de4e3fb4519dd699ce84dfec9c465227 Remove extra whitespace. --- pym/portage/const.py | 1 + pym/portage/dbapi/__init__.py | 4 +++- pym/portage/dbapi/vartree.py | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pym/portage/const.py b/pym/portage/const.py index 1785bff..50f0719 100644 --- a/pym/portage/const.py +++ b/pym/portage/const.py @@ -74,6 +74,7 @@ MOVE_BINARY = "/bin/mv" PRELINK_BINARY = "/usr/sbin/prelink" INVALID_ENV_FILE = "/etc/spork/is/not/valid/profile.env" +MERGING_IDENTIFIER = "-MERGING-" REPO_NAME_FILE = "repo_name" REPO_NAME_LOC = "profiles" + "/" + REPO_NAME_FILE diff --git a/pym/portage/dbapi/__init__.py b/pym/portage/dbapi/__init__.py index a20a1e8..6638352 100644 --- a/pym/portage/dbapi/__init__.py +++ b/pym/portage/dbapi/__init__.py @@ -16,6 +16,8 @@ portage.proxy.lazyimport.lazyimport(globals(), 'portage.versions:catsplit,catpkgsplit,vercmp,_pkg_str', ) +from portage.const import MERGING_IDENTIFIER + from portage import os from portage import auxdbkeys from portage.eapi import _get_eapi_attrs @@ -278,7 +280,7 @@ class dbapi(object): return True def invalidentry(self, mypath): - if '/-MERGING-' in mypath: + if MERGING_IDENTIFIER in mypath: if os.path.exists(mypath): writemsg(colorize("BAD", _("INCOMPLETE MERGE:"))+" %s\n" % mypath, noiselevel=-1) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 6417a56..5f5f5ce 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -45,7 +45,7 @@ portage.proxy.lazyimport.lazyimport(globals(), ) from portage.const import CACHE_PATH, CONFIG_MEMORY_FILE, \ - PORTAGE_PACKAGE_ATOM, PRIVATE_PATH, VDB_PATH + MERGING_IDENTIFIER, PORTAGE_PACKAGE_ATOM, PRIVATE_PATH, VDB_PATH from portage.dbapi import dbapi from portage.exception import CommandNotFound, \ InvalidData, InvalidLocation, InvalidPackageName, \ @@ -104,7 +104,7 @@ class vardbapi(dbapi): _excluded_dirs = ["CVS", "lost+found"] _excluded_dirs = [re.escape(x) for x in _excluded_dirs] - _excluded_dirs = re.compile(r'^(\..*|-MERGING-.*|' + \ + _excluded_dirs = re.compile(r'^(\..*|' + MERGING_IDENTIFIER + '.*|' + \ "|".join(_excluded_dirs) + r')$') _aux_cache_version = "1" @@ -446,7 +446,7 @@ class vardbapi(dbapi): if self._excluded_dirs.match(y) is not None: continue subpath = x + "/" + y - # -MERGING- should never be a cpv, nor should files. + # MERGING_IDENTIFIER should never be a cpv, nor should files. try: if catpkgsplit(subpath) is None: self.invalidentry(self.getpath(subpath)) @@ -1504,7 +1504,7 @@ class dblink(object): self.dbroot = normalize_path(os.path.join(self._eroot, VDB_PATH)) self.dbcatdir = self.dbroot+"/"+cat self.dbpkgdir = self.dbcatdir+"/"+pkg - self.dbtmpdir = self.dbcatdir+"/-MERGING-"+pkg + self.dbtmpdir = self.dbcatdir+MERGING_IDENTIFIER+pkg self.dbdir = self.dbpkgdir self.settings = mysettings self._verbose = self.settings.get("PORTAGE_VERBOSE") == "1" -- 1.8.3.2