public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/cache/
Date: Tue, 25 Sep 2012 03:44:46 +0000 (UTC)	[thread overview]
Message-ID: <1348544668.558ada1185e9d44627298aeff1b2a699c509897d.zmedico@gentoo> (raw)

commit:     558ada1185e9d44627298aeff1b2a699c509897d
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 25 03:44:28 2012 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep 25 03:44:28 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=558ada11

Remove obsolete cache/flat_list.py

This module has been obsolete and useless for many years, which is
especially obvious since it was missing INHERITED from its
auxdbkey_order and it did not write any eclass metadata.

---
 pym/portage/cache/flat_list.py |  135 ----------------------------------------
 1 files changed, 0 insertions(+), 135 deletions(-)

diff --git a/pym/portage/cache/flat_list.py b/pym/portage/cache/flat_list.py
deleted file mode 100644
index c88a004..0000000
--- a/pym/portage/cache/flat_list.py
+++ /dev/null
@@ -1,135 +0,0 @@
-# Copyright 2005-2011 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-from portage.cache import fs_template
-from portage.cache import cache_errors
-from portage import os
-from portage import _encodings
-from portage import _unicode_decode
-from portage import _unicode_encode
-import errno
-import io
-import stat
-import sys
-
-if sys.hexversion >= 0x3000000:
-	long = int
-
-# Coerce to unicode, in order to prevent TypeError when writing
-# raw bytes to TextIOWrapper with python2.
-_setitem_fmt = _unicode_decode("%s\n")
-
-# store the current key order *here*.
-class database(fs_template.FsBased):
-
-	autocommits = True
-
-	# do not screw with this ordering. _eclasses_ needs to be last
-	auxdbkey_order=('DEPEND', 'RDEPEND', 'SLOT', 'SRC_URI',
-		'RESTRICT',  'HOMEPAGE',  'LICENSE', 'DESCRIPTION',
-		'KEYWORDS',  'IUSE', 'REQUIRED_USE',
-		'PDEPEND',   'PROVIDE', 'EAPI', 'PROPERTIES',
-		'DEFINED_PHASES', 'HDEPEND')
-
-	def __init__(self, *args, **config):
-		super(database,self).__init__(*args, **config)
-		self.location = os.path.join(self.location, 
-			self.label.lstrip(os.path.sep).rstrip(os.path.sep))
-
-		if len(self._known_keys) > len(self.auxdbkey_order) + 2:
-			raise Exception("less ordered keys then auxdbkeys")
-		if not os.path.exists(self.location):
-			self._ensure_dirs()
-
-
-	def _getitem(self, cpv):
-		d = {}
-		try:
-			myf = io.open(_unicode_encode(os.path.join(self.location, cpv),
-				encoding=_encodings['fs'], errors='strict'),
-				mode='r', encoding=_encodings['repo.content'],
-				errors='replace')
-			for k,v in zip(self.auxdbkey_order, myf):
-				d[k] = v.rstrip("\n")
-		except (OSError, IOError) as e:
-			if errno.ENOENT == e.errno:
-				raise KeyError(cpv)
-			raise cache_errors.CacheCorruption(cpv, e)
-
-		try:
-			d["_mtime_"] = os.fstat(myf.fileno())[stat.ST_MTIME]
-		except OSError as e:	
-			myf.close()
-			raise cache_errors.CacheCorruption(cpv, e)
-		myf.close()
-		return d
-
-
-	def _setitem(self, cpv, values):
-		s = cpv.rfind("/")
-		fp=os.path.join(self.location,cpv[:s],".update.%i.%s" % (os.getpid(), cpv[s+1:]))
-		try:
-			myf = io.open(_unicode_encode(fp,
-				encoding=_encodings['fs'], errors='strict'),
-				mode='w', encoding=_encodings['repo.content'],
-				errors='backslashreplace')
-		except (OSError, IOError) as e:
-			if errno.ENOENT == e.errno:
-				try:
-					self._ensure_dirs(cpv)
-					myf = io.open(_unicode_encode(fp,
-						encoding=_encodings['fs'], errors='strict'),
-						mode='w', encoding=_encodings['repo.content'],
-						errors='backslashreplace')
-				except (OSError, IOError) as e:
-					raise cache_errors.CacheCorruption(cpv, e)
-			else:
-				raise cache_errors.CacheCorruption(cpv, e)
-		
-
-		for x in self.auxdbkey_order:
-			myf.write(_setitem_fmt % (values.get(x, ""),))
-
-		myf.close()
-		self._ensure_access(fp, mtime=values["_mtime_"])
-		#update written.  now we move it.
-		new_fp = os.path.join(self.location,cpv)
-		try:
-			os.rename(fp, new_fp)
-		except (OSError, IOError) as e:
-			os.remove(fp)
-			raise cache_errors.CacheCorruption(cpv, e)
-
-
-	def _delitem(self, cpv):
-		try:
-			os.remove(os.path.join(self.location,cpv))
-		except OSError as e:
-			if errno.ENOENT == e.errno:
-				raise KeyError(cpv)
-			else:
-				raise cache_errors.CacheCorruption(cpv, e)
-
-
-	def __contains__(self, cpv):
-		return os.path.exists(os.path.join(self.location, cpv))
-
-
-	def __iter__(self):
-		"""generator for walking the dir struct"""
-		dirs = [self.location]
-		len_base = len(self.location)
-		while len(dirs):
-			for l in os.listdir(dirs[0]):
-				if l.endswith(".cpickle"):
-					continue
-				p = os.path.join(dirs[0],l)
-				st = os.lstat(p)
-				if stat.S_ISDIR(st.st_mode):
-					dirs.append(p)
-					continue
-				yield p[len_base+1:]
-			dirs.pop(0)
-
-
-	def commit(self):	pass


             reply	other threads:[~2012-09-25  3:45 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-25  3:44 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-09-19 16:57 [gentoo-commits] proj/portage:master commit in: pym/portage/cache/ Zac Medico
2016-07-24 23:22 Zac Medico
2016-07-13 11:32 Zac Medico
2015-12-29 16:42 Zac Medico
2015-12-29 16:42 Zac Medico
2015-12-29 16:42 Zac Medico
2014-11-14 17:33 Zac Medico
2013-07-26  8:23 Arfrever Frehtes Taifersar Arahesis
2013-07-26  7:57 Zac Medico
2013-01-18 17:12 Zac Medico
2013-01-18 16:37 Zac Medico
2013-01-18 15:32 Zac Medico
2012-11-21  4:38 Zac Medico
2012-10-02 20:30 Zac Medico
2012-09-25  1:54 Zac Medico
2012-09-25  1:42 Zac Medico
2012-09-18 19:02 Zac Medico
2012-06-10  8:35 Zac Medico
2012-06-10  8:28 Zac Medico
2012-06-10  8:25 Zac Medico
2012-05-24 19:06 Zac Medico
2012-05-23 19:00 Zac Medico
2011-10-29 23:10 Zac Medico
2011-10-18  5:26 Zac Medico
2011-10-14 15:30 Zac Medico
2011-09-07 15:56 Zac Medico
2011-05-12 19:05 Zac Medico
2011-05-12 19:02 Zac Medico
2011-05-12 19:02 Zac Medico
2011-02-08  6:37 Zac Medico
2011-02-07  0:14 Zac Medico

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=1348544668.558ada1185e9d44627298aeff1b2a699c509897d.zmedico@gentoo \
    --to=zmedico@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