Root/scripts/dcm2desc

Source at commit 8cc36e65d43a04b781dc18f43b43d495e90a866e created 7 years 7 months ago.
By Adam Wang, diode, fairchild, filter, hole, ir.lib: changed reference, pin name, pin number size.
1#!/bin/sh
2#
3# dcm2desc - Convert .dcm files to genex descriptions
4#
5# Copyright 2012 by Werner Almesberger
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12
13
14usage()
15{
16    echo "usage: $0 [-L libdir ...] [-l lib ...]" 1>&2
17    exit 1
18}
19
20
21scan_dcm()
22{
23    for n in "$@"; do
24        sed -e '/^\$CMP /{s///;x;}' \
25            -e '/^[DKF] /{s///;x;G;s/\n/: /;p;s/: .*//;x;}' \
26            -e d <"$n"
27    done
28}
29
30
31while [ "$1" ]; do
32    case "$1" in
33    -L) shift
34        [ "`echo \"$1\"/*.dcm`" != "$1/*.dcm" ] &&
35            scan_dcm "$1"/*.dcm;;
36    -l) shift
37        scan_dcm "$1";;
38    -*) usage;;
39    *) usage;;
40    esac
41    shift
42done
43
44exit 0
45

Archive Download this file

Branches:
master



interactive