~ubuntu-branches/ubuntu/precise/pcb/precise

« back to all changes in this revision

Viewing changes to tools/Merge_dimPCBPS

  • Committer: Bazaar Package Importer
  • Author(s): Hamish Moffatt
  • Date: 2005-02-20 13:14:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050220131400-pfz66g5vhx0azl8f
Tags: 1.99j+20050127-2
* Improved package description: (closes: #295405)
* Fixed dependency: tk84 -> tk8.4 (closes: #295404)
* Updated README.debian (closes: #269578)
* Applied patch to src/djopt.c to allow compilation with gcc-4.0
  (closes: #294319), thanks to Andreas Jochens for the patch.
* Prevent example files from being compressed

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# $Id: Merge_dimPCBPS,v 1.2 2004/02/09 04:06:30 danmc Exp $
 
4
#
 
5
# merges PostScript files created by pcb (version >= 1.4.2) into
 
6
# a single file for backward compatibility
 
7
#
 
8
# Usage: name files...
 
9
#
 
10
# by Thomas Nau 9/96
 
11
#
 
12
 
 
13
if [ $# -eq 0 ]; then
 
14
        echo "Usage: `basename $0` files..." >&2
 
15
        exit 1
 
16
fi
 
17
 
 
18
# some system need nawk
 
19
#
 
20
case `uname` in
 
21
        SunOS)  AWK=nawk;;
 
22
        *)              AWK=awk;;
 
23
esac
 
24
 
 
25
$AWK '
 
26
        BEGIN                                                           { filecount = 0; }
 
27
        /^%!PS/                                                         { filecount++;  if (filecount > 1) { print "Black"; } }
 
28
        /^%!PS/,/^% PCBENDDATA/                         {
 
29
                if (filecount == 1)
 
30
                {
 
31
                        if (index($0, "%%Title:") == 1)
 
32
                                sub(",.*$", ", merged layouts");
 
33
                        if (index($0, "Black") == 1)
 
34
                           sub ("Black", "0.9 mysetgray");
 
35
                        print $0;
 
36
                        next;
 
37
                }
 
38
        }
 
39
        /^% PCBSTARTDATA/,/^% PCBENDDATA/       {
 
40
                if (filecount > 1)
 
41
                {
 
42
                        print $0;
 
43
                        next;
 
44
                }
 
45
        }
 
46
                                                                                { next; }
 
47
        END                                                                     {
 
48
                print "showpage";
 
49
                print "%%EOF";
 
50
        }
 
51
' $@