dot/gpg.conf.m4, dot/gpg-agent.conf, Makefile: Adopt GnuPG configuration.
[profile] / firefox / implode-stylus
CommitLineData
53ad55a5
MW
1#! /usr/bin/perl
2
3use autodie;
4use JSON;
5
6use Data::Dumper;
7
8my $NOW = time;
9
10my ($dir) = @ARGV;
11my $j = [];
12my $seq = 0;
13opendir my $dh, $dir;
14FILE: while (my $f = readdir $dh) {
15 next if $f eq "." || $f eq "..";
16 next unless $f =~ /\.css$/;
17 (my $name = $f) =~ s/\.css$//;
18 my @s = ();
19 my $s = {};
20 my $c = "";
21 open my $fh, "<", "$dir/$f";
22 while (<$fh>) {
23 if (m{/\* -\*-css-\*- \*/}) {
24 next;
25 } elsif (m{/\*\@END\*/}) {
26 $s->{code} = $c;
27 push @s, $s;
28 $s = {}; $c = "";
29 } elsif (m{/\*\@ \s* ([^:]+) \s* : \s* ( | \S | \S .* \S) \s* \*/}x) {
30 $s->{$1} = [split /\s*,\s*/, $2];
31 } else {
32 $c .= $_;
33 }
34 }
35 push @$j, { enabled => JSON::true,
36 updateUrl => undef,
37 md5Url => undef,
38 url => undef,
39 originalMd5 => undef,
40 installDate => $NOW,
41 name => $name,
42 id => ++$seq,
43 sections => \@s };
44}
45print encode_json($j), "\n";