abrt/retrace server integration
by Jiri Moskovcak
I noticed one ugly thing in the gui (which I think we discussed earlier,
but I forgot what we decided to do about it ;))
- repeated lines in abrt status window:
<snip>
Certificate is signed by an untrusted issuer:
'E=mtoman(a)redhat.com,CN=retrace01.fedoraproject.org,OU=BaseOS,O=Red
Hat,L=Brno,C=CZ'.
PENDING
Certificate is signed by an untrusted issuer:
'E=mtoman(a)redhat.com,CN=retrace01.fedoraproject.org,OU=BaseOS,O=Red
Hat,L=Brno,C=CZ'.
PENDING
Certificate is signed by an untrusted issuer:
'E=mtoman(a)redhat.com,CN=retrace01.fedoraproject.org,OU=BaseOS,O=Red
Hat,L=Brno,C=CZ'.
PENDING
Certificate is signed by an untrusted issuer:
'E=mtoman(a)redhat.com,CN=retrace01.fedoraproject.org,OU=BaseOS,O=Red
Hat,L=Brno,C=CZ'.
PENDING
</snip>
- should we suppress those in gui (in general don't show the line if
it's the same as the last one)
- should those be suppressed in the retrace-client?
- or both?
Thanks Jirka
13 years, 3 months
parse_options: handle options without short variant
by Karel Klic
The parse_opts function in src/lib/parse_options.c cannot handle
options with the "short" field set to 0.
Example:
struct options options[] = {
OPT__VERBOSE(&g_verbose),
OPT_BOOL(0, "test1", NULL, _("option without single char variant")),
OPT_BOOL(0, "test2", NULL, _("option without single char variant")),
OPT_END()
};
printf("%u", parse_opts(argc, argv, options, "usage"));
It prints "6" for both `./a.out --test1` and `./a.out --test2`.
I am going to commit the following fix:
diff --git a/src/lib/parse_options.c b/src/lib/parse_options.c
index 4f2b2a2..d9ce8a2 100644
--- a/src/lib/parse_options.c
+++ b/src/lib/parse_options.c
@@ -89,6 +89,7 @@ unsigned parse_opts(int argc, char **argv, const struct options *opt,
{
int help = 0;
int size = parse_opt_size(opt);
+ const int LONGOPT_OFFSET = 256;
struct strbuf *shortopts = strbuf_new();
@@ -99,7 +100,10 @@ unsigned parse_opts(int argc, char **argv, const struct options *opt,
{
curopt->name = opt[ii].long_name;
/*curopt->flag = 0; - xzalloc did it */
- curopt->val = opt[ii].short_name;
+ if (opt[ii].short_name)
+ curopt->val = opt[ii].short_name;
+ else
+ curopt->val = LONGOPT_OFFSET + ii;
switch (opt[ii].type)
{
@@ -168,7 +172,7 @@ unsigned parse_opts(int argc, char **argv, const struct options *opt,
for (ii = 0; ii < size; ++ii)
{
- if (opt[ii].short_name == c)
+ if (opt[ii].short_name == c || LONGOPT_OFFSET + ii == c)
{
if (ii < sizeof(retval)*8)
retval |= (1 << ii);
13 years, 3 months
Retrace branch merge
by Karel Klic
Hi,
I am going to merge the retrace branch to our git master, so we can
integrate the retrace client into ABRT, develop retrace server in more
visible way, and eventually make a release.
The merge should go smoothly -- see the attached patch showing the
differences between the branches.
Feel free to review the code. I know that the abrt-retrace-client.c
needs some de-duplication work.
Karel
13 years, 4 months