summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2011-04-26 17:12:58 +0200
committerJiri Moskovcak <jmoskovc@redhat.com>2011-04-26 17:12:58 +0200
commit6234b1bca8a8abcfff764e41fc157fe8ffa19dd6 (patch)
tree7e18fa0946f10f7fa7a96bfc7cec5d267a4e469b
parenta3482c4a87c968281c65f17175be2cf14a55dc4f (diff)
downloadabrt-6234b1bca8a8abcfff764e41fc157fe8ffa19dd6.tar.gz
abrt-6234b1bca8a8abcfff764e41fc157fe8ffa19dd6.tar.xz
abrt-6234b1bca8a8abcfff764e41fc157fe8ffa19dd6.zip
fixed trac#223: regression: abrt-action-install-debuginfo.py --help display is wrong
-rw-r--r--src/plugins/abrt-action-install-debuginfo.c2
-rwxr-xr-xsrc/plugins/abrt-action-install-debuginfo.py24
2 files changed, 13 insertions, 13 deletions
diff --git a/src/plugins/abrt-action-install-debuginfo.c b/src/plugins/abrt-action-install-debuginfo.c
index cd5cb9df..91171301 100644
--- a/src/plugins/abrt-action-install-debuginfo.c
+++ b/src/plugins/abrt-action-install-debuginfo.c
@@ -56,6 +56,8 @@ int main(int argc, char **argv)
error_msg_and_die("bad option", arg);
if (strncmp(arg, "--tmpdir", 8) == 0)
error_msg_and_die("bad option", arg);
+ if (strncmp(arg, "-i", 2) == 0)
+ error_msg_and_die("bad option", arg);
}
/* We use full path, and execv instead of execvp in order to
diff --git a/src/plugins/abrt-action-install-debuginfo.py b/src/plugins/abrt-action-install-debuginfo.py
index 23b9d5ea..e723f706 100755
--- a/src/plugins/abrt-action-install-debuginfo.py
+++ b/src/plugins/abrt-action-install-debuginfo.py
@@ -374,7 +374,7 @@ if __name__ == "__main__":
signal.signal(signal.SIGTERM, sigterm_handler)
# ctrl-c
signal.signal(signal.SIGINT, sigint_handler)
- core = "build_ids"
+ fbuild_ids = "build_ids"
cachedir = None
tmpdir = None
keeprpms = False
@@ -392,13 +392,11 @@ if __name__ == "__main__":
pass
progname = os.path.basename(sys.argv[0])
- help_text = _("Usage: %s --core=COREFILE "
- "--tmpdir=TMPDIR "
- "--cache=CACHEDIR") % progname
+ help_text = _("Usage: %s [-i <build_ids_file>] [--tmpdir=TMPDIR] "
+ "[--cache=CACHEDIR]") % progname
try:
- opts, args = getopt.getopt(sys.argv[1:], "vyhc:", ["help", "core=",
- "cache=", "tmpdir=",
- "keeprpms"])
+ opts, args = getopt.getopt(sys.argv[1:], "vyhi:", ["help", "cache=",
+ "tmpdir=","keeprpms"])
except getopt.GetoptError, err:
print str(err) # prints something like "option -a not recognized"
exit(RETURN_FAILURE)
@@ -412,7 +410,7 @@ if __name__ == "__main__":
elif opt == "-y":
noninteractive = True
elif opt == "-i":
- core = arg
+ fbuild_ids = arg
elif opt in ("--cache"):
cachedir = arg
elif opt in ("--tmpdir"):
@@ -420,10 +418,6 @@ if __name__ == "__main__":
elif opt in ("--keeprpms"):
keeprpms = True
- if not core:
- print _("You have to specify the path to coredump.")
- print help_text
- exit(RETURN_FAILURE)
if not cachedir:
cachedir = "/var/cache/abrt-di"
if not tmpdir:
@@ -431,7 +425,11 @@ if __name__ == "__main__":
# for now, we use /tmp...
tmpdir = "/tmp/abrt-tmp-debuginfo-%s.%u" % (time.strftime("%Y-%m-%d-%H:%M:%S"), os.getpid())
- fin = open(core)
+ try:
+ fin = open(fbuild_ids, "r")
+ except IOError, ex:
+ print _("Can't open %s: %s" % (fbuild_ids, ex))
+ exit(RETURN_FAILURE)
for line in fin.readlines():
b_ids.append(line.strip('\n'))