diff options
author | Michal Toman <mtoman@redhat.com> | 2011-03-07 11:45:35 +0100 |
---|---|---|
committer | Michal Toman <mtoman@redhat.com> | 2011-03-07 11:45:35 +0100 |
commit | 1e2ccb9242a76abeb27ce98aa44c08b3449cccfb (patch) | |
tree | 29e07c1e57ab2b3f83cef15cd3da95eb5def3382 /src/retrace/retrace.py | |
parent | 89e25718030bc713314e996ef386f8f295fe9b0f (diff) | |
download | abrt-1e2ccb9242a76abeb27ce98aa44c08b3449cccfb.tar.gz abrt-1e2ccb9242a76abeb27ce98aa44c08b3449cccfb.tar.xz abrt-1e2ccb9242a76abeb27ce98aa44c08b3449cccfb.zip |
retrace server: do not require 'architecture' file
Diffstat (limited to 'src/retrace/retrace.py')
-rw-r--r-- | src/retrace/retrace.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/retrace/retrace.py b/src/retrace/retrace.py index 08acfb89..46adb740 100644 --- a/src/retrace/retrace.py +++ b/src/retrace/retrace.py @@ -8,7 +8,7 @@ import sqlite3 from webob import Request from subprocess import * -REQUIRED_FILES = ["architecture", "coredump", "executable", "package"] +REQUIRED_FILES = ["coredump", "executable", "package"] DF_BIN = "/bin/df" DU_BIN = "/usr/bin/du" @@ -96,6 +96,19 @@ def unpacked_size(archive): pipe.close() return None +def guess_arch(coredump_path): + pipe = Popen(["file", coredump_path], stdout=PIPE).stdout + output = pipe.read() + pipe.close() + + if "x86-64" in output: + return "x86_64" + + if "80386" in output: + return "i386" + + return None + def gen_task_password(taskdir): generator = random.SystemRandom() taskpass = "" |