summaryrefslogtreecommitdiffstats
path: root/bin/repoman
diff options
context:
space:
mode:
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)