termcol: configurable xcolors input location
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 30 Oct 2016 15:59:45 +0000 (16:59 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 22 Mar 2017 21:28:04 +0000 (22:28 +0100)
Checkout at data/xcolors defined in makefile but no longer hardcoded in
parser tool.

Makefile
tools/mktermcol-xcolor

index 1750fd006ebf530cdad7438488027848503bef1a..3489370cdbaa311a1a551bca4fdaa2c48ebbb004 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -37,8 +37,8 @@ unicode-char.inc.pl: tools/mkcharinfo data/digraphs-rfc.inc.pl data/digraphs-shi
 ttfsupport/%.inc.pl: tools/mkttfinfo data/font/%.ttf
        $< $(word 2,$^) $@ || true
 
-termcol-xcolor.inc.pl: tools/mktermcol-xcolor
-       $< >$@
+termcol-xcolor.inc.pl: tools/mktermcol-xcolor data/xcolors/themes
+       $< $(word 2,$^)/* >$@
 
 .SECONDARY:
 data/font/%.ttf:
index f731e5a7048a248eea697134402e7fb0d9ff3036..112dd833a6cebff8004623f6b075ff18d8d7b32b 100755 (executable)
@@ -7,8 +7,11 @@ say 'use strict;';
 say '+{';
 my @names;
 
-for my $path (glob 'data/xcolors/themes/*') {
-       open my $theme, '<', $path;
+for my $path (@ARGV) {
+       open my $theme, '<', $path or do {
+               warn "could not open $path: $!\n";
+               next;
+       };
        (my $name = $path) =~ s{.*/}{};  # basename
 
        my (%pal, @pal);