projects
/
ppastats.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added --debug option
[ppastats.git]
/
src
/
main.c
diff --git
a/src/main.c
b/src/main.c
index
0df293d
..
02861ea
100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-22,10
+22,13
@@
#include <stdio.h>
#include <string.h>
#include <stdio.h>
#include <string.h>
+#include "cache.h"
#include "html.h"
#include "lp_ws.h"
#include "config.h"
#include "html.h"
#include "lp_ws.h"
#include "config.h"
+#include "ppastats.h"
+int debug;
static const char *program_name;
static void display_published_binaries(const char *owner, const char *ppa)
static const char *program_name;
static void display_published_binaries(const char *owner, const char *ppa)
@@
-44,15
+47,18
@@
static void display_published_binaries(const char *owner, const char *ppa)
e_cur = list;
while (*e_cur) {
struct binary_package_publishing_history *binary;
e_cur = list;
while (*e_cur) {
struct binary_package_publishing_history *binary;
- struct distro_arch_series *dist;
+ const struct distro_arch_series *arch;
+ const struct distro_series *distro;
binary = *e_cur;
binary = *e_cur;
- dist = get_distro_arch_series(binary->distro_arch_series_link);
+ arch = get_distro_arch_series(binary->distro_arch_series_link);
+ distro = get_distro_series(arch->distroseries_link);
- printf("%s %s %s %d\n",
- dist->display_name,
+ printf("%s %s %s(%s): %d\n",
binary->binary_package_name,
binary->binary_package_version,
binary->binary_package_name,
binary->binary_package_version,
+ distro->name,
+ arch->architecture_tag,
get_download_count(binary->self_link));
e_cur++;
}
get_download_count(binary->self_link));
e_cur++;
}
@@
-64,6
+70,7
@@
static struct option long_options[] = {
{"version", no_argument, 0, 'v'},
{"help", no_argument, 0, 'h'},
{"html", no_argument, 0, 't'},
{"version", no_argument, 0, 'v'},
{"help", no_argument, 0, 'h'},
{"html", no_argument, 0, 't'},
+ {"debug", no_argument, 0, 'd'},
{0, 0, 0, 0}
};
{0, 0, 0, 0}
};
@@
-117,12
+124,15
@@
int main(int argc, char **argv)
program_name = argv[0];
program_name = argv[0];
- while ((optc = getopt_long(argc, argv, "vht", long_options,
+ while ((optc = getopt_long(argc, argv, "vht
d
", long_options,
NULL)) != -1) {
switch (optc) {
case 't':
output_html = 1;
break;
NULL)) != -1) {
switch (optc) {
case 't':
output_html = 1;
break;
+ case 'd':
+ debug = 1;
+ break;
case 'h':
print_help();
exit(EXIT_SUCCESS);
case 'h':
print_help();
exit(EXIT_SUCCESS);
@@
-149,5
+159,9
@@
int main(int argc, char **argv)
else
display_published_binaries(owner, ppa);
else
display_published_binaries(owner, ppa);
+ /* for valgrind.... */
+ lp_ws_cleanup();
+ cache_cleanup();
+
exit(EXIT_SUCCESS);
}
exit(EXIT_SUCCESS);
}