[open-ils-commits] r18493 - trunk/build/tools (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Oct 27 12:42:49 EDT 2010


Author: miker
Date: 2010-10-27 12:42:46 -0400 (Wed, 27 Oct 2010)
New Revision: 18493

Added:
   trunk/build/tools/intern_css_imports.pl
Log:
A tool for interning CSS @import declarations, stripping comments, and removing useless whitespace

Added: trunk/build/tools/intern_css_imports.pl
===================================================================
--- trunk/build/tools/intern_css_imports.pl	                        (rev 0)
+++ trunk/build/tools/intern_css_imports.pl	2010-10-27 16:42:46 UTC (rev 18493)
@@ -0,0 +1,16 @@
+#!/usr/bin/perl
+my $in_comment = 0;
+while (<>) {
+    chomp;
+    if (/^\s*\@import\s+url\((['"])([^'"]+)\1\)/) {
+        print `$0 $2`
+    } else {
+        s#(/\*).*?(\*/|$)##g;
+        $in_comment = 1 if ($1 && !$2);
+        s#(/\*|^).*?(\*/)##g;
+        $in_comment = 0 if ($2);
+        s/\s+$//;
+        s/^\s+//;
+        print "$_\n" unless ($in_comment || /^\s*$/)
+    }
+}


Property changes on: trunk/build/tools/intern_css_imports.pl
___________________________________________________________________
Name: svn:executable
   + *



More information about the open-ils-commits mailing list