mirror of
git://projects.qi-hardware.com/kicad-libs.git
synced 2024-11-22 11:57:32 +02:00
scripts/dcm2desc: script to convert comments from .dcm files to genex descriptions
This commit is contained in:
parent
994e3a84b0
commit
33f9ac4876
44
scripts/dcm2desc
Executable file
44
scripts/dcm2desc
Executable file
@ -0,0 +1,44 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# dcm2desc - Convert .dcm files to genex descriptions
|
||||
#
|
||||
# Copyright 2012 by Werner Almesberger
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "usage: $0 [-L libdir ...] [-l lib ...]" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
scan_dcm()
|
||||
{
|
||||
for n in "$@"; do
|
||||
sed -e '/^\$CMP /{s///;x;}' \
|
||||
-e '/^[DKF] /{s///;x;G;s/\n/: /;p;s/: .*//;x;}' \
|
||||
-e d <"$n"
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
while [ "$1" ]; do
|
||||
case "$1" in
|
||||
-L) shift
|
||||
[ "`echo \"$1\"/*.dcm`" != "$1/*.dcm" ] &&
|
||||
scan_dcm "$1"/*.dcm;;
|
||||
-l) shift
|
||||
scan_dcm "$1";;
|
||||
-*) usage;;
|
||||
*) usage;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user