Files
OpenCellular/scripts/bitmaps/makelines.sh
Roy Hashimoto 8bb2f10999 Revert "Move bitmaps for shipping products into a separate directory."
This reverts commit 97505494b15f65e5e667521fa65b9155db673d46

Change-Id: Icbf0b997711fc44aeeeec8e3bb4b6fa103e6e7e6
Reviewed-on: http://gerrit.chromium.org/gerrit/5156
Tested-by: Roy Hashimoto <rhashimoto@chromium.org>
Reviewed-by: Roy Hashimoto <rhashimoto@chromium.org>
2011-08-02 11:45:24 -07:00

42 lines
813 B
Bash
Executable File

#!/usr/bin/perl
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);
}