Imported Upstream version 1.3.3 upstream upstream/1.3.3
authorJean-Philippe Orsini <jeanfi@gmail.com>
Sat, 12 Sep 2015 11:58:07 +0000 (13:58 +0200)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Sat, 12 Sep 2015 11:58:07 +0000 (13:58 +0200)
31 files changed:
NEWS
configure
configure.ac
po/fr.gmo
po/fr.po
po/ppastats.pot
src/cache.h
src/fcache.h
src/html.c
src/html.h
src/http.c
src/http.h
src/list.c
src/list.h
src/lp.h
src/lp_json.h
src/lp_ws.c
src/lp_ws.h
src/main.c
src/pio.c
src/pio.h
src/plog.h
src/ppastats.1
src/ppastats.h
src/pstr.c
src/pstr.h
src/ptime.c
src/ptime.h
themes/default/js/ppastats.js
themes/default/templates/footer.tpl
themes/default/templates/pkg.tpl

diff --git a/NEWS b/NEWS
index 6bc4688..3315032 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+v1.3.3
+------
+
+* added total number of downloads in the package html pages.
+* sort the list of version in decrease order in the package html
+  pages.
+
 v1.3.2
 ------
 
index 9a69925..63f84e0 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for ppastats 1.3.2.
+# Generated by GNU Autoconf 2.69 for ppastats 1.3.3.
 #
 # Report bugs to <jeanfi@gmail.com>.
 #
@@ -580,8 +580,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='ppastats'
 PACKAGE_TARNAME='ppastats'
-PACKAGE_VERSION='1.3.2'
-PACKAGE_STRING='ppastats 1.3.2'
+PACKAGE_VERSION='1.3.3'
+PACKAGE_STRING='ppastats 1.3.3'
 PACKAGE_BUGREPORT='jeanfi@gmail.com'
 PACKAGE_URL='http://wpitchoune.net/ppastats'
 
@@ -1321,7 +1321,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures ppastats 1.3.2 to adapt to many kinds of systems.
+\`configure' configures ppastats 1.3.3 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1395,7 +1395,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of ppastats 1.3.2:";;
+     short | recursive ) echo "Configuration of ppastats 1.3.3:";;
    esac
   cat <<\_ACEOF
 
@@ -1509,7 +1509,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-ppastats configure 1.3.2
+ppastats configure 1.3.3
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1865,7 +1865,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by ppastats $as_me 1.3.2, which was
+It was created by ppastats $as_me 1.3.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2730,7 +2730,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='ppastats'
- VERSION='1.3.2'
+ VERSION='1.3.3'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -7694,7 +7694,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by ppastats $as_me 1.3.2, which was
+This file was extended by ppastats $as_me 1.3.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -7761,7 +7761,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-ppastats config.status 1.3.2
+ppastats config.status 1.3.3
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
index 0a898e9..e6ca635 100644 (file)
@@ -2,7 +2,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ([2.64])
-AC_INIT([ppastats], [1.3.2],[jeanfi@gmail.com],[ppastats],[http://wpitchoune.net/ppastats])
+AC_INIT([ppastats], [1.3.3],[jeanfi@gmail.com],[ppastats],[http://wpitchoune.net/ppastats])
 
 AM_INIT_AUTOMAKE([-Wall gnu])
 
index fcf9830..13c9fb1 100644 (file)
Binary files a/po/fr.gmo and b/po/fr.gmo differ
index 2066abc..210926f 100644 (file)
--- a/po/fr.po
+++ b/po/fr.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: ppastats 0.0.x\n"
 "Report-Msgid-Bugs-To: jeanfi@gmail.com\n"
-"POT-Creation-Date: 2014-11-02 10:22+0100\n"
+"POT-Creation-Date: 2015-09-12 12:35+0200\n"
 "PO-Revision-Date: 2012-05-05 23:45+0200\n"
 "Last-Translator:  <jeanfi@gmail.com>\n"
 "Language-Team: French\n"
@@ -31,21 +31,21 @@ msgstr ""
 msgid "exceed cache capacity"
 msgstr ""
 
-#: src/html.c:375
+#: src/html.c:408
 msgid "Failed to get the header template"
 msgstr ""
 
-#: src/html.c:382
+#: src/html.c:415
 #, c-format
 msgid "Failed to open: %s"
 msgstr ""
 
-#: src/html.c:428
+#: src/html.c:461
 #, c-format
 msgid "generating %s"
 msgstr ""
 
-#: src/html.c:495 src/html.c:508
+#: src/html.c:528 src/html.c:541
 #, c-format
 msgid "Generating %s"
 msgstr ""
index 95ef14a..a7b2917 100644 (file)
@@ -6,9 +6,9 @@
 #, fuzzy
 msgid ""
 msgstr ""
-"Project-Id-Version: ppastats 1.3.2\n"
+"Project-Id-Version: ppastats 1.3.3\n"
 "Report-Msgid-Bugs-To: jeanfi@gmail.com\n"
-"POT-Creation-Date: 2014-11-02 10:22+0100\n"
+"POT-Creation-Date: 2015-09-12 12:35+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -31,21 +31,21 @@ msgstr ""
 msgid "exceed cache capacity"
 msgstr ""
 
-#: src/html.c:375
+#: src/html.c:408
 msgid "Failed to get the header template"
 msgstr ""
 
-#: src/html.c:382
+#: src/html.c:415
 #, c-format
 msgid "Failed to open: %s"
 msgstr ""
 
-#: src/html.c:428
+#: src/html.c:461
 #, c-format
 msgid "generating %s"
 msgstr ""
 
-#: src/html.c:495 src/html.c:508
+#: src/html.c:528 src/html.c:541
 #, c-format
 msgid "Generating %s"
 msgstr ""
index 6302e81..2cd8405 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2014 jeanfi@gmail.com
+ * Copyright (C) 2011-2015 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
index de50b88..d67f787 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2014 jeanfi@gmail.com
+ * Copyright (C) 2011-2015 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
index 83c6fb6..6cca344 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2014 jeanfi@gmail.com
+ * Copyright (C) 2011-2015 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -199,11 +199,42 @@ static json_object *distro_to_json(struct distro_stats *d)
        return json;
 }
 
+static int version_cmp(const void *o1, const void *o2)
+{
+       struct version_stats **v1, **v2;
+
+       v1 = (struct version_stats **)o1;
+       v2 = (struct version_stats **)o2;
+
+       return (*v1)->date_created <= (*v2)->date_created;
+}
+
+static struct version_stats **sort_versions(struct version_stats **vers)
+{
+       size_t n;
+       struct version_stats **tmp, **result;
+
+       tmp = vers;
+       n = 0;
+       while (*tmp) {
+               n++;
+               tmp++;
+       }
+
+       result = malloc((n + 1) * sizeof(struct version_stats *));
+       memcpy(result, vers, n * sizeof(struct version_stats *));
+       result[n] = NULL;
+
+       qsort(result, n, sizeof(struct version_stats *), version_cmp);
+
+       return result;
+}
+
 static json_object *
 pkg_to_json(struct ppa_stats *ppa, struct package_stats *pkg)
 {
        json_object *json, *json_versions, *json_distros, *json_distro;
-       struct version_stats **versions;
+       struct version_stats **versions, **tmp;
        struct distro_stats **distros, *d;
 
        json = json_object_new_object();
@@ -219,14 +250,16 @@ pkg_to_json(struct ppa_stats *ppa, struct package_stats *pkg)
 
        json_versions = json_object_new_array();
        json_object_object_add(json, "versions", json_versions);
-       versions = pkg->versions;
-       while (*versions) {
+       versions = sort_versions(pkg->versions);
+       tmp = versions;
+       while (*tmp) {
                json_object_array_add
                        (json_versions,
-                        json_object_new_string((*versions)->version));
+                        json_object_new_string((*tmp)->version));
 
-               versions++;
+               tmp++;
        }
+       free(versions);
 
        distros = pkg->distros;
        if (distros) {
index 8dca53d..7c97d05 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2014 jeanfi@gmail.com
+ * Copyright (C) 2011-2015 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
index dd99249..f6c48bb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2014 jeanfi@gmail.com
+ * Copyright (C) 2011-2015 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
index c3129dd..e6e9da8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2014 jeanfi@gmail.com
+ * Copyright (C) 2011-2015 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
index 0d5b02e..29241fb 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2011-2014 jeanfi@gmail.com
+  Copyright (C) 2011-2015 jeanfi@gmail.com
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
index ac259c6..22c7921 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2014 jeanfi@gmail.com
+ * Copyright (C) 2011-2015 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
index 1428229..4c30021 100644 (file)
--- a/src/lp.h
+++ b/src/lp.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2014 jeanfi@gmail.com
+ * Copyright (C) 2011-2015 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
index 8ffcbaf..5c33ba3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2014 jeanfi@gmail.com
+ * Copyright (C) 2011-2015 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
index fe93e39..523f185 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2014 jeanfi@gmail.com
+ * Copyright (C) 2011-2015 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
index 83fb2f6..519afdb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2014 jeanfi@gmail.com
+ * Copyright (C) 2011-2015 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
index 4c84444..6c3b508 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2014 jeanfi@gmail.com
+ * Copyright (C) 2011-2015 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -110,7 +110,7 @@ static void print_version()
 "<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>\n"
 "This is free software: you are free to change and redistribute it.\n"
 "There is NO WARRANTY, to the extent permitted by law.\n"),
-              "2011-2014");
+              "2011-2015");
 }
 
 static void print_help()
index 2f806b8..ba2c82c 100644 (file)
--- a/src/pio.c
+++ b/src/pio.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2014 jeanfi@gmail.com
+ * Copyright (C) 2010-2015 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
index 385ad33..359edc9 100644 (file)
--- a/src/pio.h
+++ b/src/pio.h
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2010-2014 jeanfi@gmail.com
+    Copyright (C) 2010-2015 jeanfi@gmail.com
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
index 29880e9..cee773b 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2010-2014 jeanfi@gmail.com
+  Copyright (C) 2010-2015 jeanfi@gmail.com
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
index 782ec64..b79357b 100644 (file)
@@ -1,5 +1,5 @@
-.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.46.2.
-.TH PPASTATS "1" "November 2014" "ppastats 1.3.2" "User Commands"
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.46.5.
+.TH PPASTATS "1" "September 2015" "ppastats 1.3.3" "User Commands"
 .SH NAME
 ppastats \- PPA Statistics command line tool
 .SH SYNOPSIS
@@ -40,7 +40,7 @@ Report bugs to: jeanfi@gmail.com
 .PP
 ppastats home page: <http://wpitchoune.net/ppastats>
 .SH COPYRIGHT
-Copyright \(co 2011\-2014 jeanfi@gmail.com
+Copyright \(co 2011\-2015 jeanfi@gmail.com
 License GPLv2: GNU GPL version 2 or later
 <http://www.gnu.org/licenses/old\-licenses/gpl\-2.0.html>
 .br
index 8a13348..3c63a01 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2014 jeanfi@gmail.com
+ * Copyright (C) 2011-2015 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
index 3a868ee..12d12a8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- Copyright (C) 2011-2014 jeanfi@gmail.com
+ Copyright (C) 2011-2015 jeanfi@gmail.com
 
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License as
index d9598d2..23ec20d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- Copyright (C) 2011-2014 jeanfi@gmail.com
+ Copyright (C) 2011-2015 jeanfi@gmail.com
 
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License as
index 2c06c7c..93e0bfd 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2010-2014 jeanfi@gmail.com
+  Copyright (C) 2010-2015 jeanfi@gmail.com
 
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
index eac7342..96247e0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2014 jeanfi@gmail.com
+ * Copyright (C) 2010-2015 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
index 8217d55..fd4320d 100644 (file)
 function ppastats_chart(ddts) {
-    var data_chart = [];
-    var max_date = null;
-    var min_date = null;
-    
-    $.each(ddts, function(i, item) {
-        var tm = item["time"];
-        var d = new Date(tm[0], tm[1]-1, tm[2]);
-        var entry = [d, item["value"]];
-        data_chart.push(entry);
-       
-        if (max_date == null || max_date < d) {
-           max_date = d;
-        }
-       
-        if (min_date == null || min_date > d) { 
-           min_date = d;
-        }
-    });
-    
-    var plot1 = $.jqplot ('chart', [data_chart], {
-       title: 'Daily Download Count',
-        axes: {
-           xaxis: {
-                renderer:$.jqplot.DateAxisRenderer,
-                tickOptions:{formatString:'%Y/%m/%d'},
-                min: min_date,
-                max: max_date
-           },
-           yaxis: {
-                min: 0
-           }
-        },
-        series: [{lineWidth:1,showMarker:false}]
-    });
+       var data_chart = [];
+       var max_date = null;
+       var min_date = null;
+
+       $.each(ddts, function(i, item) {
+               var tm = item["time"];
+               var d = new Date(tm[0], tm[1]-1, tm[2]);
+               var entry = [d, item["value"]];
+               data_chart.push(entry);
+
+               if (max_date == null || max_date < d) {
+                       max_date = d;
+               }
+
+               if (min_date == null || min_date > d) {
+                       min_date = d;
+               }
+       });
+
+       var plot1 = $.jqplot ('chart', [data_chart], {
+               title: 'Daily Download Count',
+               axes: {
+                       xaxis: {
+                               renderer:$.jqplot.DateAxisRenderer,
+                               tickOptions:{formatString:'%Y/%m/%d'},
+                               min: min_date,
+                               max: max_date
+                       },
+                       yaxis: {
+                               min: 0
+                       }
+               },
+               series: [{lineWidth:1,showMarker:false}]
+       });
 }
 
 function ppastats_distros(distros) {
-    var data_chart = [];
-    var max_date = null;
-    var min_date = null;
-    var series_opt = [];
-    
-    $.each(distros, function(i, distro) {
-       var arr = [];
-
-       $.each(distro["ddts"], function(j, item) {
-            var tm = item["time"];
-            var d = new Date(tm[0], tm[1]-1, tm[2]);
-            var entry = [d, item["value"]];
-            arr.push(entry);
-           
-            if (max_date == null || max_date < d) {
-               max_date = d;
-            }
-           
-            if (min_date == null || min_date > d) { 
-               min_date = d;
-            }
+       var data_chart = [];
+       var max_date = null;
+       var min_date = null;
+       var series_opt = [];
+
+       $.each(distros, function(i, distro) {
+               var arr = [];
+
+               $.each(distro["ddts"], function(j, item) {
+                       var tm = item["time"];
+                       var d = new Date(tm[0], tm[1]-1, tm[2]);
+                       var entry = [d, item["value"]];
+                       arr.push(entry);
+
+                       if (max_date == null || max_date < d) {
+                               max_date = d;
+                       }
+
+                       if (min_date == null || min_date > d) {
+                               min_date = d;
+                       }
+               });
+               data_chart[i] = arr;
+               series_opt[i] = {label: distro["name"]};
        });
-       data_chart[i] = arr;
-       series_opt[i] = {label: distro["name"]};
-    });
-    
-    var plot1 = $.jqplot ('chart_distro', data_chart, {
-       title: 'Daily Download Count by Ubuntu Distribution',
-        axes: {
-           xaxis: {
-                renderer:$.jqplot.DateAxisRenderer,
-                tickOptions:{formatString:'%Y/%m/%d'},
-                min: min_date,
-                max: max_date
-           },
-           yaxis: {
-                min: 0
-           }
-        },
-        seriesDefaults: {
-           lineWidth:1,
-           showMarker:false
-       },
-       legend: {
-           show: true
-       },
-       series: series_opt
-    });
-}
 
+       var plot1 = $.jqplot ('chart_distro', data_chart, {
+               title: 'Daily Download Count by Ubuntu Distribution',
+               axes: {
+                       xaxis: {
+                               renderer:$.jqplot.DateAxisRenderer,
+                               tickOptions:{formatString:'%Y/%m/%d'},
+                               min: min_date,
+                               max: max_date
+                       },
+                       yaxis: {
+                               min: 0
+                       }
+               },
+               seriesDefaults: {
+                       lineWidth:1,
+                       showMarker:false
+               },
+               legend: {
+                       show: true
+               },
+               series: series_opt
+       });
+}
 
 function ppastats_pkg(json_url) {
-    $(document).ready(function() {
-       $.getJSON(json_url, function(data) {
-           $("#ppa_owner").html(data["ppa_owner"]);
-           $("#ppa_name").html(data["ppa_name"]);
-           $("#pkg_name").html(data["name"]);
-           
-           $("#versions").append("<ul>");
-           $.each(data["versions"], function(i, v) {
-               var v_url = data["name"]+"_"+v+".html";
-               
-               $("#versions ul").append("<li><a href='"+v_url+"'>"+v+"</a></li>");
-           });
-           
-           $("#distros").append("<ul>");
-           $.each(data["distros"], function(i, d) {
-               $("#distros ul").append("<li>"+d["name"]+": "+d["count"]+"</li>");
-           });
-           
-           
-           ppastats_chart(data["ddts"]);
-           ppastats_distros(data["distros"]);
+       $(document).ready(function() {
+               $.getJSON(json_url, function(data) {
+                       var downloads = 0;
+
+                       $("#ppa_owner").html(data["ppa_owner"]);
+                       $("#ppa_name").html(data["ppa_name"]);
+                       $("#pkg_name").html(data["name"]);
+
+                       $("#versions").append("<ul>");
+                       $.each(data["versions"], function(i, v) {
+                               var v_url = data["name"]+"_"+v+".html";
+
+                               $("#versions ul").append("<li><a href='"+v_url+"'>"+v+"</a></li>");
+                       });
+
+                       $("#distros").append("<ul>");
+                       $.each(data["distros"], function(i, d) {
+                               $("#distros ul").append("<li>"+d["name"]+": "+d["count"]+"</li>");
+                               downloads += d["count"];
+                       });
+
+                       $("#pkg_downloads").html("" + downloads);
+
+                       ppastats_chart(data["ddts"]);
+                       ppastats_distros(data["distros"]);
+               });
        });
-    });
 }
 
 function ppastats_ver() {
-    $(document).ready(function() {
-       var pkg_url = data["pkg_name"]+".html";
-       
-       $("#ppa_owner").html(data["ppa_owner"]);
-       $("#ppa_name").html(data["ppa_name"]);
-       $("#pkg_name").html("<a href='"+pkg_url+"'>"+data["pkg_name"]+"</a>");
-       $("#version").append(" "+data["name"]);
-       
-       $("#distros").append("<ul>");
-       $.each(data["distros"], function(i, distro) {
-           $.each(distro["archs"], function(i, arch) {
-               $("#distros ul").append("<li>"+distro["name"]+"_"+arch["name"]+": "+arch["count"]+"</li");
-           });
-       });
+       $(document).ready(function() {
+               var pkg_url = data["pkg_name"]+".html";
 
-       ppastats_chart(data["ddts"]);
+               $("#ppa_owner").html(data["ppa_owner"]);
+               $("#ppa_name").html(data["ppa_name"]);
+               $("#pkg_name").html("<a href='"+pkg_url+"'>"+data["pkg_name"]+"</a>");
+               $("#version").append(" "+data["name"]);
 
-       $("#date_created").append(data["date_created"]);
-    });
+               $("#distros").append("<ul>");
+               $.each(data["distros"], function(i, distro) {
+                       $.each(distro["archs"], function(i, arch) {
+                               $("#distros ul").append("<li>"+distro["name"]+"_"+arch["name"]+": "+arch["count"]+"</li");
+                       });
+               });
+
+               ppastats_chart(data["ddts"]);
+
+               $("#date_created").append(data["date_created"]);
+       });
 }
-                     
+
 function ppastats_ppa() {
     $(document).ready(function() {
        var max_date = null;
@@ -143,16 +146,15 @@ function ppastats_ppa() {
 
        $.getJSON("index.json", function(data) {
            pkg_url = data["pkg_name"]+".html";
-           
+
            $("#ppa_name").html(data["ppa_owner"]+"/"+data["ppa_name"]);
-           
+
            $.each(data["packages"], function(i, item) {
                var url = item["name"]+".html";
                $("#pkgs").append("<li><a href='"+url+"'>"+item["name"]+"</a>: "+item["count"]+"</li>");
            });
-           
+
            ppastats_chart(data["ddts"]);
        });
     });
 }
-
index ea91747..23a1d0c 100644 (file)
@@ -1,5 +1,5 @@
     <div id="footer">
-      Generated by <a href='http://wpitchoune.net/ppastats'>ppastats</a> v1.3.2
+      Generated by <a href='http://wpitchoune.net/ppastats'>ppastats</a> v1.3.3
     </div>
     </div>
   </body>
index 59dff60..c9db8f7 100644 (file)
   <div>
     <em>Package</em>: <span id="pkg_name">N/A</span>
   </div>
+
+  <div>
+    <em>Downloads</em>: <span id="pkg_downloads">N/A</span>
+  </div>
     
   <div id="distros">
     <em>Distributions:</em>