<a href=\"index.html\">\n\
<span id=\"ppa_owner\">N/A</span>/<span id=\"ppa_name\">N/A</span>\n\
</a></p>\n\
- <div id=\"chart\"></div>\n\
+ <div id=\"charts\">\n\
+ <div id=\"chart\"></div>\n\
+ </div>\n\
<div id=\"details\">\n\
<div class=\"distros\">\n\
<em>Distros</em>:\n\
<ul id=\"pkgs\"></ul>\n\
</div>\n\
</div>\n\
- <div id=\"chart\"></div>\n\
+ <div id=\"charts\">\n\
+ <div id=\"chart\"></div>\n\
+ </div>\n\
%s"
#define FCOPY_BUF_SZ 4096
return ret;
}
-static char *get_path(const char *dir, const char *file)
+static char *path_new(const char *dir, const char *file, const char *suffixe)
{
char *path = malloc(strlen(dir)+1+
strlen(file)+
strlen(".html")+
+ (suffixe ? strlen(suffixe) : 0) +
1);
strcpy(path, dir);
FILE *f;
char *json;
- path = get_path(dir, pkg->name);
+ path = path_new(dir, pkg->name, ".html");
f = fopen(path, "w");
if (!f) {
f_name = malloc(strlen(pkg->name)+1+strlen(version->version)+1);
sprintf(f_name, "%s_%s", pkg->name, version->version);
- path = get_path(dir, f_name);
+ path = path_new(dir, f_name, ".html");
f = fopen(path, "w");
if (!f) {
char *path;
FILE *f;
- path = get_path(dir, "index");
+ path = path_new(dir, "index", ".html");
f = fopen(path, "w");
if (!f) {
ppastats = create_ppa_stats(owner, ppa, package_status);
totals = ppastats->daily_download_totals;
- path = get_path(output_dir, "ppa");
+ path = path_new(output_dir, "ppa", ".html");
packages_to_html(ppastats, ppastats->packages, output_dir);