pkgsrc/devel/py-expect/patches/patch-af
2002-06-15 06:54:00 +00:00

62 lines
1.6 KiB
Text

$NetBSD: patch-af,v 1.1 2002/06/15 06:54:01 sjg Exp $
--- expvers.py.~1~ Fri Jun 14 13:09:31 2002
+++ expvers.py Fri Jun 14 13:36:32 2002
@@ -2,7 +2,7 @@
import sys
import posix
-import strop
+import string
def exists(path):
try:
@@ -27,12 +27,12 @@ def is_executable(path):
def pathjoin(dir, base):
return '%s/%s' % (dir, base)
def pathsplit(path):
- p = strop.rfind(path, '/')
+ p = string.rfind(path, '/')
if p >= 0:
return (path[:p], path[p+1:])
return ('', path)
def splitext(path):
- p = strop.rfind(path, '.')
+ p = string.rfind(path, '.')
if p >= 0:
return (path[:p], path[p:])
return (path, '')
@@ -64,21 +64,21 @@ def ticks(*cmdargs):
wpid = None
while wpid != pid:
(wpid, wstat) = posix.wait()
- v = strop.join(l)[:-1]
+ v = string.join(l)[:-1]
if wstat:
raise RuntimeError, v
return v
def expect_expr(*args):
global expect_prog
- cmd = 'puts [%s]' % strop.join(map(str, args))
+ cmd = 'puts [%s]' % string.join(map(str, args))
result = ticks(expect_prog, '-c', cmd)
return result
def get_version(prog):
version = expect_expr('exp_version')
- if strop.count(version, '.') > 1:
- p = strop.rfind(version, '.')
+ if string.count(version, '.') > 1:
+ p = string.rfind(version, '.')
return (version[:p], version)
else:
return (version, version)
@@ -115,7 +115,7 @@ else:
elif posix.environ.has_key('EXPECT'):
expect_prog = posix.environ['EXPECT']
else:
- path = strop.split(posix.environ['PATH'], ':')
+ path = string.split(posix.environ['PATH'], ':')
for dir in path:
f = pathjoin(dir, 'expect')
if is_executable(f):