summaryrefslogtreecommitdiff
path: root/scripts/newbitmaps/old_releases/mario/makelines.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/newbitmaps/old_releases/mario/makelines.sh')
-rwxr-xr-xscripts/newbitmaps/old_releases/mario/makelines.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/scripts/newbitmaps/old_releases/mario/makelines.sh b/scripts/newbitmaps/old_releases/mario/makelines.sh
new file mode 100755
index 00000000..fca0f9c4
--- /dev/null
+++ b/scripts/newbitmaps/old_releases/mario/makelines.sh
@@ -0,0 +1,44 @@
+#!/usr/bin/perl
+# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+use strict;
+our $opt_u = 'http://www.chromium.org';
+our $opt_m = 'Unsupported Prototype 0000';
+our $opt_d = '.';
+
+use File::Basename;
+my $progdir = dirname($0);
+my $prog = basename($0);
+
+use Getopt::Std;
+my $usage = "
+Usage: $prog
+
+";
+getopts('u:m:d:') or die $usage;
+
+my @old = glob("$opt_d/linetxt_*");
+unlink(@old) if @old;
+
+$/ = undef;
+$_ = <>;
+s/\s+$//gs;
+
+my $count = 1;
+foreach (split(/\n/, $_))
+{
+ s/^\s+//;
+ s/\s+$//;
+ s/\$URL/$opt_u/g;
+ s/\$MODEL/$opt_m/g;
+ $_ = ' ' unless $_;
+ my $big = s/^\$BIG:\s*//;
+ my $filename = sprintf('%s/linetxt_%02d.%s', $opt_d, $count++,
+ $big ? 'TXT' : 'txt');
+# print "$filename: ($_)\n"; next;
+ open(OUT, ">$filename") || die "$0 can't write $filename: $!\n";
+ print OUT "$_";
+ close(OUT);
+}