get version for cdrdao too.
Add debug commands: rip debug version cdrdao/cdparanoia
This commit is contained in:
@@ -550,25 +550,12 @@ _VERSION_RE = re.compile(
|
||||
|
||||
|
||||
def getCdParanoiaVersion():
|
||||
version = "(Unknown)"
|
||||
getter = common.VersionGetter('cdparanoia',
|
||||
["cdparanoia", "-V"],
|
||||
_VERSION_RE,
|
||||
"%(version)s %(release)s")
|
||||
|
||||
try:
|
||||
p = asyncsub.Popen(["cdparanoia", "-V"],
|
||||
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE, close_fds=True)
|
||||
version = asyncsub.recv_some(p, e=0, stderr=1)
|
||||
vre = _VERSION_RE.search(version)
|
||||
if vre and len(vre.groups()) == 2:
|
||||
version = "%s %s" % (
|
||||
vre.groupdict().get('version'),
|
||||
vre.groupdict().get('release'))
|
||||
except OSError, e:
|
||||
import errno
|
||||
if e.errno == errno.ENOENT:
|
||||
raise common.MissingDependencyException('cdparanoia')
|
||||
raise
|
||||
|
||||
return version
|
||||
return getter.get()
|
||||
|
||||
|
||||
_OK_RE = re.compile(r'Drive tests OK with Paranoia.')
|
||||
|
||||
@@ -507,3 +507,16 @@ class ProgramFailedException(Exception):
|
||||
def __init__(self, code):
|
||||
self.code = code
|
||||
self.args = (code, )
|
||||
|
||||
|
||||
_VERSION_RE = re.compile(
|
||||
"^Cdrdao version (?P<version>.+) -")
|
||||
|
||||
|
||||
def getCDRDAOVersion():
|
||||
getter = common.VersionGetter('cdrdao',
|
||||
["cdrdao"],
|
||||
_VERSION_RE,
|
||||
"%(version)s")
|
||||
|
||||
return getter.get()
|
||||
|
||||
Reference in New Issue
Block a user