aboutsummaryrefslogtreecommitdiffstats
path: root/find-unlisted-icons
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-07-02 08:05:45 +0200
committerMattias Andrée <maandree@kth.se>2023-07-02 08:05:45 +0200
commit9aba11f7b6a291fa70e95cd9ed20488ca5a369ec (patch)
tree4e690ddc2bac3eb58740c44a2f0a758017d25966 /find-unlisted-icons
parentFix icon listing and make Makefile portable (diff)
downloadsimple-icon-theme-9aba11f7b6a291fa70e95cd9ed20488ca5a369ec.tar.gz
simple-icon-theme-9aba11f7b6a291fa70e95cd9ed20488ca5a369ec.tar.bz2
simple-icon-theme-9aba11f7b6a291fa70e95cd9ed20488ca5a369ec.tar.xz
Add check for unlisted icons for and correct accordingly
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'find-unlisted-icons')
-rwxr-xr-xfind-unlisted-icons18
1 files changed, 18 insertions, 0 deletions
diff --git a/find-unlisted-icons b/find-unlisted-icons
new file mode 100755
index 0000000..f493178
--- /dev/null
+++ b/find-unlisted-icons
@@ -0,0 +1,18 @@
+#!/bin/sh
+set -e
+
+for f in scalable/*/*.svg; do
+ if test -e "$f"; then
+ printf '%s\n' "$f"
+ fi
+done | sed 's/^scalable\/\(.*\)\.svg$/\1/' | sort > "/tmp/pid-$$-a"
+
+sed 's/\\$//' < icons.mk | sed '/^\s*\(#.*\|\)$/d' | sed 1d | tr -d '\t' | sort > "/tmp/pid-$$-b"
+
+unlisted="$(comm -23 "/tmp/pid-$$-a" "/tmp/pid-$$-b")"
+rm "/tmp/pid-$$-a" "/tmp/pid-$$-b"
+
+if test -n "$unlisted"; then
+ printf '%s\n' 'The following icons exist but are not listed in icons.mk' "$unlisted" >&2
+ exit 1
+fi