+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
------
#! /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>.
#
# 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'
# 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]...
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
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.
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 $@
# Define the identity of the package.
PACKAGE='ppastats'
- VERSION='1.3.2'
+ VERSION='1.3.3'
cat >>confdefs.h <<_ACEOF
# 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
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\\"
# 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])
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"
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 ""
#, 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"
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 ""
/*
- * 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
/*
- * 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
/*
- * 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
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();
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) {
/*
- * 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
/*
- * 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
/*
- * 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
/*
- 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
/*
- * 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
/*
- * 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
/*
- * 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
/*
- * 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
/*
- * 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
/*
- * 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
"<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()
/*
- * 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
/*
- 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
/*
- 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
-.\" 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
.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
/*
- * 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
/*
- 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
/*
- 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
/*
- 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
/*
- * 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
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;
$.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"]);
});
});
}
-
<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>
<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>