aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-19 06:04:13 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-19 06:04:13 +0000
commit822740542b938f98444ed2b2a3ce9e36d9204f67 (patch)
treed664f9d30e1d8817db6ec65cb5efaf2f333c8b6d /pym/portage/cvstree.py
parentUse portage.os and _encodings where appropriate. (diff)
downloadportage-822740542b938f98444ed2b2a3ce9e36d9204f67.tar.gz
portage-822740542b938f98444ed2b2a3ce9e36d9204f67.tar.bz2
portage-822740542b938f98444ed2b2a3ce9e36d9204f67.zip
Use portage.os and _encodings where appropriate.
svn path=/main/trunk/; revision=14095
Diffstat (limited to 'pym/portage/cvstree.py')
-rw-r--r--pym/portage/cvstree.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/pym/portage/cvstree.py b/pym/portage/cvstree.py
index d283fb47f..a35c5fcf1 100644
--- a/pym/portage/cvstree.py
+++ b/pym/portage/cvstree.py
@@ -3,9 +3,13 @@
# Distributed under the terms of the GNU General Public License v2
# $Id$
+import codecs
+import re
+import time
-import os,time,sys,re
-from stat import *
+from portage import os
+from portage import _encodings
+from portage import _unicode_encode
# [D]/Name/Version/Date/Flags/Tags
@@ -43,7 +47,10 @@ def isadded(entries, path):
filename=os.path.basename(path)
try:
- myfile=open(basedir+"/CVS/Entries","r")
+ myfile = codecs.open(
+ _unicode_encode(os.path.join(basedir, 'CVS', 'Entries'),
+ encoding=_encodings['fs'], errors='strict'),
+ mode='r', encoding=_encodings['content'], errors='strict')
except IOError:
return 0
mylines=myfile.readlines()
@@ -194,7 +201,9 @@ def getentries(mydir,recursive=0):
if not os.path.exists(mydir):
return entries
try:
- myfile=open(myfn, "r")
+ myfile = codecs.open(_unicode_encode(myfn,
+ encoding=_encodings['fs'], errors='strict'),
+ mode='r', encoding=_encodings['content'], errors='strict')
mylines=myfile.readlines()
myfile.close()
except SystemExit, e:
@@ -269,7 +278,7 @@ def getentries(mydir,recursive=0):
if file=="digest-framerd-2.4.3":
print "stat'ing"
mystat=os.stat(mydir+"/"+file)
- mytime=time.asctime(time.gmtime(mystat[ST_MTIME]))
+ mytime = time.asctime(time.gmtime(long(mystat.st_mtime)))
if "status" not in entries["files"][file]:
if file=="digest-framerd-2.4.3":
print "status not set"