public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:prefix commit in: pym/portage/dbapi/
@ 2013-09-18 18:34 Fabian Groffen
  0 siblings, 0 replies; 7+ messages in thread
From: Fabian Groffen @ 2013-09-18 18:34 UTC (permalink / raw
  To: gentoo-commits

commit:     c29e71f1210dfcaf743fe0df4af780532f0cef85
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 17 23:32:17 2013 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Wed Sep 18 18:33:37 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c29e71f1

Handle newline in symlink target for bug #485226.

---
 pym/portage/dbapi/vartree.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index aa11bbd..2159028 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -3776,6 +3776,13 @@ class dblink(object):
 						# to an infinite recursion loop.
 						mylinklist.append(relative_path)
 
+						myto = _unicode_decode(
+							_os.readlink(_unicode_encode(fpath,
+							encoding=_encodings['merge'], errors='strict')),
+							encoding=_encodings['merge'], errors='replace')
+						if line_ending_re.search(myto) is not None:
+							paths_with_newlines.append(relative_path)
+
 				if unicode_error:
 					break
 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/portage:prefix commit in: pym/portage/dbapi/
@ 2015-06-09 18:30 Fabian Groffen
  0 siblings, 0 replies; 7+ messages in thread
From: Fabian Groffen @ 2015-06-09 18:30 UTC (permalink / raw
  To: gentoo-commits

commit:     2dc0b8e587949b60182bcb27b47e98572f226b67
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  9 18:27:38 2015 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Tue Jun  9 18:27:38 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=2dc0b8e5

dblink: fix syntax

 pym/portage/dbapi/vartree.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index f5527b6..d9fae64 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -2874,7 +2874,7 @@ class dblink(object):
 			if self._contents_basenames is None:
 
 				try:
-					for x in pkgfiles):
+					for x in pkgfiles:
 						_unicode_encode(x,
 							encoding=_encodings['merge'],
 							errors='strict')


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/portage:prefix commit in: pym/portage/dbapi/
@ 2015-06-09 20:07 Fabian Groffen
  0 siblings, 0 replies; 7+ messages in thread
From: Fabian Groffen @ 2015-06-09 20:07 UTC (permalink / raw
  To: gentoo-commits

commit:     c9d654bec1d539514a8c05f2bd9b52d76e4bc3f8
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  9 20:07:35 2015 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Tue Jun  9 20:07:35 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c9d654be

vardbapi: fix typo

 pym/portage/dbapi/vartree.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index d9fae64..f4c7cdc 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -108,7 +108,6 @@ if sys.hexversion >= 0x3000000:
 else:
 	_unicode = unicode
 
-
 class vardbapi(dbapi):
 
 	_excluded_dirs = ["CVS", "lost+found"]
@@ -1117,7 +1116,7 @@ class vardbapi(dbapi):
 				path = x[eroot_len:]
 				if "case-insensitive-fs" in self._vardb.settings.features:
 					path = path.lower()
-				self._add_path(patch, pkg_hash)
+				self._add_path(path, pkg_hash)
 
 			self._vardb._aux_cache["modified"].add(cpv)
 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/portage:prefix commit in: pym/portage/dbapi/
@ 2017-03-24 19:09 Fabian Groffen
  0 siblings, 0 replies; 7+ messages in thread
From: Fabian Groffen @ 2017-03-24 19:09 UTC (permalink / raw
  To: gentoo-commits

commit:     82ca805538e526e1e338c6bfae1a5b17a40f7b5e
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 24 16:35:32 2017 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Mar 24 16:35:32 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=82ca8055

vartree.py: use _contents.unmap_key when returning pkg

 pym/portage/dbapi/vartree.py | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 83fe5d3e1..9df69860f 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -2954,10 +2954,8 @@ class dblink(object):
 
 		if pkgfiles and destfile in pkgfiles:
 			if preserve_case is not None:
-				return preserve_case[destfile]
-			return destfile
-		#if self._contents.contains(destfile):
-		#	return self._contents.unmap_key(destfile)
+				return self._contents.contains(preserve_case[destfile])
+			return self._contents.unmap_key(destfile)
 		if pkgfiles:
 			basename = os_filename_arg.path.basename(destfile)
 			if self._contents_basenames is None:
@@ -3050,10 +3048,8 @@ class dblink(object):
 					x = os_filename_arg.path.join(p_path, basename)
 					if x in pkgfiles:
 						if preserve_case is not None:
-							return preserve_case[x]
-						return x
-					#if self._contents.contains(x):
-					#	return self._contents.unmap_key(x)
+							return self._contents.unmap_key(preserve_case[x])
+						return self._contents.unmap_key(x)
 
 		return False
 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/portage:prefix commit in: pym/portage/dbapi/
@ 2017-03-24 19:09 Fabian Groffen
  0 siblings, 0 replies; 7+ messages in thread
From: Fabian Groffen @ 2017-03-24 19:09 UTC (permalink / raw
  To: gentoo-commits

commit:     65b336275435fabceacd8829e042eb8b745ecf4f
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 24 19:09:34 2017 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Mar 24 19:09:34 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=65b33627

vartree: simplify case-insensitivity matching a bit

 pym/portage/dbapi/vartree.py | 29 ++++++++++++-----------------
 1 file changed, 12 insertions(+), 17 deletions(-)

diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 9df69860f..232697f72 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -2944,24 +2944,21 @@ class dblink(object):
 			os_filename_arg.path.join(destroot,
 			filename.lstrip(os_filename_arg.path.sep)))
 
-		pkgfiles = self.getcontents()
-
+		dstfile = destfile
+		pkgfiles = dict((k, k) for k in self.getcontents())
 		preserve_case = None
 		if "case-insensitive-fs" in self.settings.features:
-			destfile = destfile.lower()
-			preserve_case = dict((k.lower(), k) for k in pkgfiles)
+			dstfile = destfile.lower()
 			pkgfiles = dict((k.lower(), v) for k, v in pkgfiles.items())
 
-		if pkgfiles and destfile in pkgfiles:
-			if preserve_case is not None:
-				return self._contents.contains(preserve_case[destfile])
+		if dstfile in pkgfiles:
 			return self._contents.unmap_key(destfile)
 		if pkgfiles:
-			basename = os_filename_arg.path.basename(destfile)
+			basename = os_filename_arg.path.basename(dstfile)
 			if self._contents_basenames is None:
 
 				try:
-					for x in pkgfiles:
+					for _, x in pkgfiles.items():
 						_unicode_encode(x,
 							encoding=_encodings['merge'],
 							errors='strict')
@@ -2970,7 +2967,7 @@ class dblink(object):
 					# different value of sys.getfilesystemencoding(),
 					# so fall back to utf_8 if appropriate.
 					try:
-						for x in pkgfiles:
+						for _, x in pkgfiles.items():
 							_unicode_encode(x,
 								encoding=_encodings['fs'],
 								errors='strict')
@@ -3001,7 +2998,7 @@ class dblink(object):
 
 				if os is _os_merge:
 					try:
-						for x in pkgfiles:
+						for _, x in pkgfiles.items():
 							_unicode_encode(x,
 								encoding=_encodings['merge'],
 								errors='strict')
@@ -3010,7 +3007,7 @@ class dblink(object):
 						# different value of sys.getfilesystemencoding(),
 						# so fall back to utf_8 if appropriate.
 						try:
-							for x in pkgfiles:
+							for _, x in pkgfiles.items():
 								_unicode_encode(x,
 									encoding=_encodings['fs'],
 									errors='strict')
@@ -3021,13 +3018,13 @@ class dblink(object):
 
 				self._contents_inodes = {}
 				parent_paths = set()
-				for x in pkgfiles:
+				for x, r in pkgfiles.items():
 					p_path = os.path.dirname(x)
 					if p_path in parent_paths:
 						continue
 					parent_paths.add(p_path)
 					try:
-						s = os.stat(p_path)
+						s = os.stat(os.path.dirname(r))
 					except OSError:
 						pass
 					else:
@@ -3047,9 +3044,7 @@ class dblink(object):
 				for p_path in p_path_list:
 					x = os_filename_arg.path.join(p_path, basename)
 					if x in pkgfiles:
-						if preserve_case is not None:
-							return self._contents.unmap_key(preserve_case[x])
-						return self._contents.unmap_key(x)
+						return self._contents.unmap_key(pkgfiles[x])
 
 		return False
 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/portage:prefix commit in: pym/portage/dbapi/
@ 2017-03-24 19:38 Fabian Groffen
  0 siblings, 0 replies; 7+ messages in thread
From: Fabian Groffen @ 2017-03-24 19:38 UTC (permalink / raw
  To: gentoo-commits

commit:     d2c650f4d43916a217ffda1d0706d8d489d14cdc
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 24 19:20:49 2017 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Mar 24 19:20:49 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=d2c650f4

vartree: drop case-insensitivity code

ContentsCaseSensitivityManager already handles this, so we don't have to

 pym/portage/dbapi/vartree.py | 40 +++++++++++++++-------------------------
 1 file changed, 15 insertions(+), 25 deletions(-)

diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 232697f72..d6ffa8110 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -1149,10 +1149,7 @@ class vardbapi(dbapi):
 				self._add_path("", pkg_hash)
 
 			for x in db._contents.keys():
-				path = x[eroot_len:]
-				if "case-insensitive-fs" in self._vardb.settings.features:
-					path = path.lower()
-				self._add_path(path, pkg_hash)
+				self._add_path(x[eroot_len:], pkg_hash)
 
 			self._vardb._aux_cache["modified"].add(cpv)
 
@@ -1334,8 +1331,6 @@ class vardbapi(dbapi):
 
 							if is_basename:
 								for p in dblink(cpv)._contents.keys():
-									if case_insensitive:
-										p = p.lower()
 									if os.path.basename(p) == name:
 										owners.append((cpv, dblink(cpv).
 										_contents.unmap_key(
@@ -1393,8 +1388,6 @@ class vardbapi(dbapi):
 				for path, name, is_basename in path_info_list:
 					if is_basename:
 						for p in dblnk._contents.keys():
-							if case_insensitive:
-								p = p.lower()
 							if os.path.basename(p) == name:
 								search_pkg.results.append((dblnk,
 									dblnk._contents.unmap_key(
@@ -2944,21 +2937,18 @@ class dblink(object):
 			os_filename_arg.path.join(destroot,
 			filename.lstrip(os_filename_arg.path.sep)))
 
-		dstfile = destfile
-		pkgfiles = dict((k, k) for k in self.getcontents())
-		preserve_case = None
 		if "case-insensitive-fs" in self.settings.features:
-			dstfile = destfile.lower()
-			pkgfiles = dict((k.lower(), v) for k, v in pkgfiles.items())
+			destfile = destfile.lower()
 
-		if dstfile in pkgfiles:
+		if self._contents.contains(destfile):
 			return self._contents.unmap_key(destfile)
-		if pkgfiles:
-			basename = os_filename_arg.path.basename(dstfile)
+
+		if self.getcontents():
+			basename = os_filename_arg.path.basename(destfile)
 			if self._contents_basenames is None:
 
 				try:
-					for _, x in pkgfiles.items():
+					for x in self._contents.keys():
 						_unicode_encode(x,
 							encoding=_encodings['merge'],
 							errors='strict')
@@ -2967,7 +2957,7 @@ class dblink(object):
 					# different value of sys.getfilesystemencoding(),
 					# so fall back to utf_8 if appropriate.
 					try:
-						for _, x in pkgfiles.items():
+						for x in self._contents.keys():
 							_unicode_encode(x,
 								encoding=_encodings['fs'],
 								errors='strict')
@@ -2977,7 +2967,7 @@ class dblink(object):
 						os = portage.os
 
 				self._contents_basenames = set(
-					os.path.basename(x) for x in pkgfiles)
+					os.path.basename(x) for x in self._contents.keys())
 			if basename not in self._contents_basenames:
 				# This is a shortcut that, in most cases, allows us to
 				# eliminate this package as an owner without the need
@@ -2998,7 +2988,7 @@ class dblink(object):
 
 				if os is _os_merge:
 					try:
-						for _, x in pkgfiles.items():
+						for x in self._contents.keys():
 							_unicode_encode(x,
 								encoding=_encodings['merge'],
 								errors='strict')
@@ -3007,7 +2997,7 @@ class dblink(object):
 						# different value of sys.getfilesystemencoding(),
 						# so fall back to utf_8 if appropriate.
 						try:
-							for _, x in pkgfiles.items():
+							for x in self._contents.keys():
 								_unicode_encode(x,
 									encoding=_encodings['fs'],
 									errors='strict')
@@ -3018,13 +3008,13 @@ class dblink(object):
 
 				self._contents_inodes = {}
 				parent_paths = set()
-				for x, r in pkgfiles.items():
+				for x in self._contents.keys():
 					p_path = os.path.dirname(x)
 					if p_path in parent_paths:
 						continue
 					parent_paths.add(p_path)
 					try:
-						s = os.stat(os.path.dirname(r))
+						s = os.stat(p_path)
 					except OSError:
 						pass
 					else:
@@ -3043,8 +3033,8 @@ class dblink(object):
 			if p_path_list:
 				for p_path in p_path_list:
 					x = os_filename_arg.path.join(p_path, basename)
-					if x in pkgfiles:
-						return self._contents.unmap_key(pkgfiles[x])
+					if self._contents.contains(x):
+						return self._contents.unmap_key(x)
 
 		return False
 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-commits] proj/portage:prefix commit in: pym/portage/dbapi/
@ 2017-03-25  9:12 Fabian Groffen
  0 siblings, 0 replies; 7+ messages in thread
From: Fabian Groffen @ 2017-03-25  9:12 UTC (permalink / raw
  To: gentoo-commits

commit:     018619bde3768010580c25d48b7f179d429ca8d2
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 24 20:28:45 2017 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Mar 24 20:28:45 2017 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=018619bd

vartree: drop unused imports

 pym/portage/dbapi/vartree.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index d6ffa8110..f5ad109a9 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -52,7 +52,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
 )
 
 from portage.const import CACHE_PATH, CONFIG_MEMORY_FILE, \
-	MERGING_IDENTIFIER, PORTAGE_PACKAGE_ATOM, PRIVATE_PATH, VDB_PATH, EPREFIX, EPREFIX_LSTRIP, BASH_BINARY
+	MERGING_IDENTIFIER, PORTAGE_PACKAGE_ATOM, PRIVATE_PATH, VDB_PATH, EPREFIX
 from portage.dbapi import dbapi
 from portage.exception import CommandNotFound, \
 	InvalidData, InvalidLocation, InvalidPackageName, \


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-03-25  9:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-25  9:12 [gentoo-commits] proj/portage:prefix commit in: pym/portage/dbapi/ Fabian Groffen
  -- strict thread matches above, loose matches on Subject: below --
2017-03-24 19:38 Fabian Groffen
2017-03-24 19:09 Fabian Groffen
2017-03-24 19:09 Fabian Groffen
2015-06-09 20:07 Fabian Groffen
2015-06-09 18:30 Fabian Groffen
2013-09-18 18:34 Fabian Groffen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox