From 42285e560a39b36198a8613a1190d10c78b4f66a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Wed, 18 Sep 2013 00:11:35 +0200 Subject: [PATCH] Add tools dir. New tool: categorycount --- tools/categorycount | 30 ++++++++++++++++++++++++++++ commitupdates => tools/commitupdates | 2 ++ 2 files changed, 32 insertions(+) create mode 100755 tools/categorycount rename commitupdates => tools/commitupdates (92%) diff --git a/tools/categorycount b/tools/categorycount new file mode 100755 index 00000000..02e3d60a --- /dev/null +++ b/tools/categorycount @@ -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 diff --git a/commitupdates b/tools/commitupdates similarity index 92% rename from commitupdates rename to tools/commitupdates index bde57e23..ad8824d4 100755 --- a/commitupdates +++ b/tools/commitupdates @@ -1,5 +1,7 @@ #!/bin/bash +# Commits updates to apps, allowing you to edit the commit messages + commands=() while read line; do