Commit 0aae580c authored by Julien Lepiller's avatar Julien Lepiller

Remove duplicates in generated manifest

parent f2f49fe1
......@@ -25,19 +25,19 @@ FDROIDDATA=$(shell ls fdroiddata/metadata/*.txt fdroiddata/metadata/*.yml)
TRANSMON=/root/.config/guix/current/bin/guix environment -L modules --ad-hoc \
python transmon nss-certs -- transmon
FDROIDDATADIR=fdroiddata
QUIET=@
FDROIDDATA=fdroiddata
all: $(DAY_IMAGES)
$(MAKE) public/i18n.css public/i18n.html public/i18n-data.js
fdroid-update:
@if [ ! -d $(FDROIDDATA) ]; then \
echo [GIT CLONE] $(FDROIDDATA); \
git clone https://gitlab.com/fdroid/fdroiddata.git $(FDROIDDATA); \
@if [ ! -d $(FDROIDDATADIR) ]; then \
echo [GIT CLONE] $(FDROIDDATADIR); \
git clone https://gitlab.com/fdroid/fdroiddata.git $(FDROIDDATADIR); \
fi
@echo [GIT PULL] $(FDROIDDATA)
$(QUIET)cd $(FDROIDDATA); git pull
@echo [GIT PULL] $(FDROIDDATADIR)
$(QUIET)cd $(FDROIDDATADIR); git pull
cache/i18n-data-languages.js: $(shell ls public/images/evo-*)
@if [ ! -d cache ]; then mkdir cache; fi
......@@ -80,7 +80,7 @@ evo: $(JSON_RESULTS)
@if [ ! -d public/images ]; then mkdir -p public/images; fi
@echo [EXEC] one-lang.scm
$(QUIET)/root/.config/guix/current/bin/guix environment --ad-hoc guile guile-json \
gnuplot -- guile -L modules one-lang.scm $(RESULTS)
gnuplot -- guile -L modules one-lang.scm $(JSON_RESULTS)
public/data/results.$(MYDATE).json: fdroid.manifest
@if [ ! -d public/data ]; then mkdir -p public/data; fi
......
......@@ -15,7 +15,7 @@
;;; You should have received a copy of the GNU General Public License
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
(use-modules (json) (ice-9 match) (ice-9 rdelim))
(use-modules (json) (ice-9 match) (ice-9 rdelim) (srfi srfi-1))
(define fdroid-files (cdr (command-line)))
......@@ -30,6 +30,17 @@
("tags" . ,(list->array 1 '("android" "fdroid")))
("home-page" . ,(assoc-ref data "home"))))
(define (uniq-url lst)
(define (urls lst)
(map (lambda (data) (assoc-ref data "url")) lst))
(fold
(lambda (elem res)
(if (member (assoc-ref elem "url") (urls res))
res
(cons elem res)))
'()
lst))
(define (getstring line from)
(string-trim-both (substring line from)))
......@@ -85,8 +96,9 @@
(list->array 1
(map
generate-data
(filter (lambda (a)
(and (assoc-ref a "url") (assoc-ref a "type")
(assoc-ref a "home") (assoc-ref a "name")))
(map parse-txt fdroid-files))))))
(uniq-url
(filter (lambda (a)
(and (assoc-ref a "url") (assoc-ref a "type")
(assoc-ref a "home") (assoc-ref a "name")))
(map parse-txt fdroid-files)))))))
(newline)
......@@ -77,10 +77,8 @@
<p>
This graph represents the evolution of a specified language, in number of
apps in a specific state. Note that on 2019-07-03 I fixed a bug in transmon
that allows it to analyse even more applications. It seems that the bug prevented
it to analyze popular applications, so there is a sudden increase in the
number of translated apps (almost ×2). You can select your language on the
list below:
that allows it to analyse even more applications. You can select your
language on the list below:
</p>
<form id="evo-form">
<select id="evo-select"></select>
......@@ -88,6 +86,12 @@
<p style="overflow: auto;">
<img src="/images/evo-fr.png" id="evo-img" />
</p>
<p>
It seems that the bug prevented it to analyze popular applications, so there
is a sudden increase in the number of translated apps (almost ×2) on 2019.07.02.
Then I found there were duplicates in the analysis, so the number of
translated apps decreases a little on 2019.07.11.
</p>
</div>
</section>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment