cas | 10 ++++++----
lib/cas/core.py | 9 ++++++---
version | 2 +-
3 files changed, 13 insertions(+), 8 deletions(-)
New commits:
commit cfd5c56822c396c8a72ff7acfadc435bef90e8ce
Author: Adam Stokes <adam(a)conans.battleaxe>
Date: Mon Dec 15 19:37:05 2008 -0500
- hopefully fixed the problem where cores weren't detected
from extracted archives/compressed files.
diff --git a/cas b/cas
index 7674104..89cfc1e 100755
--- a/cas
+++ b/cas
@@ -66,12 +66,14 @@ class CoreHandler(object):
self.filename = os.path.join(self.dst, self.filename)
return self.filename
try:
- self.casLog.info("Detected a compressed core, extracting")
- corepath = self.tool.extractCore(self.filename, self.dst)
+ self.casLog.info("Detected a compressed core, extracting.. please wait
as " \
+ "this process can take a long time.")
+ corepath = self.tool.extractCore(self.filename)
# corefile extracted now move it to work directory, pull basename
# from corepath since we auto-detect the core file from extraction
- shutil.move(corepath,os.path.join(self.dst, os.path.basename(corepath)))
- self.filename = os.path.join(self.dst, os.path.basename(corepath))
+ coreBasename = os.path.basename(corepath)
+ shutil.move(corepath,os.path.join(self.dst, coreBasename))
+ self.filename = os.path.join(self.dst, coreBasename)
return self.filename
except CoreException, err:
self.casLog.debug(err)
diff --git a/lib/cas/core.py b/lib/cas/core.py
index 37f175f..d3cd0db 100644
--- a/lib/cas/core.py
+++ b/lib/cas/core.py
@@ -51,10 +51,12 @@ class CoreBase(object):
return suffix_map["bz2"]
return False
- def extractCore(self, filepath, dst):
+ def extractCore(self, filepath):
""" utility to extract archive and pull out core
"""
- self.dst = dst
+ # Making an assumption that if we are extracting a file then
+ # the contents of that file are placed wherever cas is run from
+ self.dst = os.path.realpath(os.curdir)
self.filepath = filepath
fd = open(self.filepath, 'rb')
data = os.read(fd.fileno(), 1000)
@@ -66,7 +68,8 @@ class CoreBase(object):
# TODO: figure out someway to print some status to the screen
# during extraction
# FIXME: failing to determine corefile after extraction, running
- # on extracted core works.
+ # on extracted core works. possible problem being looking in the wrong
+ # directory
p = Popen(format, stdout=PIPE, stderr=PIPE)
err = p.stderr.read()
out = p.stdout.read()
diff --git a/version b/version
index 50c8612..a0881bd 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-0.13 102
+0.13 103
Show replies by date