chiark / gitweb /
Add tools dir. New tool: categorycount
authorDaniel Martí <mvdan@mvdan.cc>
Tue, 17 Sep 2013 22:11:35 +0000 (00:11 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Tue, 17 Sep 2013 22:11:35 +0000 (00:11 +0200)
tools/categorycount [new file with mode: 0755]
tools/commitupdates [moved from commitupdates with 92% similarity]

diff --git a/tools/categorycount b/tools/categorycount
new file mode 100755 (executable)
index 0000000..02e3d60
--- /dev/null
@@ -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
similarity index 92%
rename from commitupdates
rename to tools/commitupdates
index bde57e23f31db1f83488fac35908e24181bd2d83..ad8824d4e365c7f42508e4ee831841271939b164 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+# Commits updates to apps, allowing you to edit the commit messages
+
 commands=()
 
 while read line; do