mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-08-16 03:10:09 +02:00
Add tools dir. New tool: categorycount
This commit is contained in:
parent
eb7d2dceab
commit
42285e560a
30
tools/categorycount
Executable file
30
tools/categorycount
Executable file
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Sorts categories by number of apps in them, discards disabled apps
|
||||||
|
|
||||||
|
declare -A count
|
||||||
|
|
||||||
|
for file in metadata/*.txt
|
||||||
|
do
|
||||||
|
while read line
|
||||||
|
do
|
||||||
|
[[ "$line" == "Disabled:"* ]] && break
|
||||||
|
if [[ "$line" == "Category:"* ]]
|
||||||
|
then
|
||||||
|
while IFS=';' read -ra categ
|
||||||
|
do
|
||||||
|
count[$categ]=$(( ${count[$categ]} + 1 )) || count[$categ]=1
|
||||||
|
done <<< "${line:9}"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done < $file
|
||||||
|
done
|
||||||
|
|
||||||
|
output=""
|
||||||
|
|
||||||
|
for category in "${!count[@]}"
|
||||||
|
do
|
||||||
|
output+="${count[$category]}_$category\n"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo -en "$output" | column -t -s '_' | sort -n
|
@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Commits updates to apps, allowing you to edit the commit messages
|
||||||
|
|
||||||
commands=()
|
commands=()
|
||||||
|
|
||||||
while read line; do
|
while read line; do
|
Loading…
Reference in New Issue
Block a user