summaryrefslogtreecommitdiffstats
path: root/bin/repoman
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-09-20 16:22:08 +0000
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2009-09-20 16:22:08 +0000
commit8243a08d6d2121e4c1e92201c9d4361df42e5d8f (patch)
tree8885f3b3d554054901d15c7a77bad789a8aa12e8 /bin/repoman
parent5ce55d59b6a1e0fabd4e7879aa94f69251d03d69 (diff)
downloadportage-8243a08d6d2121e4c1e92201c9d4361df42e5d8f.tar.gz
portage-8243a08d6d2121e4c1e92201c9d4361df42e5d8f.tar.bz2
portage-8243a08d6d2121e4c1e92201c9d4361df42e5d8f.zip
Update system imports for compatibility with Python 3.
svn path=/main/trunk/; revision=14294
Diffstat (limited to 'bin/repoman')
-rwxr-xr-xbin/repoman17
1 files changed, 8 insertions, 9 deletions
diff --git a/bin/repoman b/bin/repoman
index c849a22f7..613e1ec14 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -10,7 +10,10 @@
from __future__ import print_function
import codecs
-import commands
+try:
+ from subprocess import getstatusoutput as subprocess_getstatusoutput
+except ImportError:
+ from commands import getstatusoutput as subprocess_getstatusoutput
import errno
import formatter
import logging
@@ -23,14 +26,10 @@ import tempfile
import time
import platform
+from io import StringIO
from itertools import chain, izip
from stat import S_ISDIR, ST_CTIME
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
-
if not hasattr(__builtins__, "set"):
from sets import Set as set
@@ -1136,7 +1135,7 @@ for x in scanlist:
(checkdir, y, m.group(0)))
if desktop_file_validate and desktop_pattern.match(y):
- status, cmd_output = commands.getstatusoutput(
+ status, cmd_output = subprocess_getstatusoutput(
"'%s' '%s'" % (desktop_file_validate, full_path))
if os.WIFEXITED(status) and os.WEXITSTATUS(status) != os.EX_OK:
# Note: in the future we may want to grab the
@@ -1186,7 +1185,7 @@ for x in scanlist:
if xmllint_capable and not metadata_bad:
# xmlint can produce garbage output even on success, so only dump
# the ouput when it fails.
- st, out = commands.getstatusoutput(
+ st, out = subprocess_getstatusoutput(
"xmllint --nonet --noout --dtdvalid '%s' '%s'" % \
(metadata_dtd, os.path.join(checkdir, "metadata.xml")))
if st != os.EX_OK:
@@ -1983,7 +1982,7 @@ else:
if myfile not in expansion:
continue
- myout = commands.getstatusoutput("egrep -q "+headerstring+" "+myfile)
+ myout = subprocess_getstatusoutput("egrep -q "+headerstring+" "+myfile)
if myout[0] == 0:
myheaders.append(myfile)