diff -uNr yum-2.4.2_orig/shell.py yum-2.4.2/shell.py
--- yum-2.4.2_orig/shell.py 2006-05-10 06:11:30.000000000 +0100
+++ yum-2.4.2/shell.py 2006-05-10 06:15:08.000000000 +0100
@@ -18,6 +18,7 @@
import cmd
import string
import shlex
+import StringIO
from yum import Errors
from yum.constants import *
@@ -61,7 +62,7 @@
return False
self.base.cmdstring = line
self.base.cmdstring = self.base.cmdstring.replace('\n', '')
- self.base.cmds = shlex.split(self.base.cmdstring)
+ self.base.cmds = self.shlex_split(self.base.cmdstring)
try:
self.base.parseCommands()
except Errors.YumBaseError:
@@ -153,7 +154,7 @@
(cmd, args, line) = self.parseline(line)
# logs
if cmd in ['debuglevel', 'errorlevel']:
- opts = shlex.split(args)
+ opts = self.shlex_split(args)
if not opts:
self.base.log(2, '%s: %s' % (cmd, self.base.conf.getConfigOption(cmd)))
else:
@@ -170,7 +171,7 @@
self.base.errorlog.threshold = val
# bools
elif cmd in ['gpgcheck', 'obsoletes', 'assumeyes']:
- opts = shlex.split(args)
+ opts = self.shlex_split(args)
if not opts:
self.base.log(2, '%s: %s' % (cmd, self.base.conf.getConfigOption(cmd)))
else:
@@ -186,7 +187,7 @@
elif cmd in ['exclude']:
args = args.replace(',', ' ')
- opts = shlex.split(args)
+ opts = self.shlex_split(args)
if not opts:
msg = '%s: ' % cmd
msg = msg + string.join(self.base.conf.getConfigOption(cmd))
@@ -221,7 +222,7 @@
self.base.log(2, '%-20.20s %-40.40s disabled' % (repo, repo.name))
elif cmd == 'enable':
- repos = shlex.split(args)
+ repos = self.shlex_split(args)
for repo in repos:
try:
changed = self.base.repos.enableRepo(repo)
@@ -243,7 +244,7 @@
del self.base.up
elif cmd == 'disable':
- repos = shlex.split(args)
+ repos = self.shlex_split(args)
for repo in repos:
try:
self.base.repos.disableRepo(repo)
@@ -298,3 +299,15 @@
self.base.doTsSetup()
self.base.doRpmDBSetup()
+ def shlex_split(self, s):
+ # hackery to bring a shlex.split sort of function into py2.2
+ s = StringIO.StringIO(s)
+ res = shlex.shlex(s)
+ result=[]
+ while 1:
+ tok = res.get_token()
+ if not tok:
+ break
+ result.append(tok)
+ return result
+