use run_batch for shelltools.system and fix string formatting

This commit is contained in:
S.Çağlar Onur
2006-01-25 23:37:09 +00:00
parent f3e38db3b3
commit 1de35c6eaf
+3 -12
View File
@@ -29,6 +29,7 @@ import pisi.actionsapi
import pisi.actionsapi.get import pisi.actionsapi.get
from pisi.actionsapi import error from pisi.actionsapi import error
from pisi.util import run_batch
def can_access_file(sourceFile): def can_access_file(sourceFile):
'''test the existence of file''' '''test the existence of file'''
@@ -198,15 +199,5 @@ def dirName(sourceFile):
return os.path.dirname(sourceFile) return os.path.dirname(sourceFile)
def system(command): def system(command):
#FIXME: might be better to merge this with util.run_batch command = command.replace(" ", "")
#FIXME: String formatting run_batch(command)
command = command.replace(" ", " ")
ctx.ui.debug(_('executing %s') % command)
p = os.popen(command)
while 1:
line = p.readline()
if not line:
break
ctx.ui.debug(line[:-1])
return p.close()