[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: refdes_renum
User: sdb
Date: 07/02/10 15:46:17
Modified: . refdes_renum
Log:
Added --clear option to clear refdeses. (* jcl *)
Revision Changes Path
1.3 +31 -11 eda/geda/gaf/utils/scripts/refdes_renum
(In the diff below, changes in quantity of whitespace are not shown.)
Index: refdes_renum
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/utils/scripts/refdes_renum,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- refdes_renum 21 Dec 2005 00:09:56 -0000 1.2
+++ refdes_renum 10 Feb 2007 20:46:17 -0000 1.3
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
#
-# $Id: refdes_renum,v 1.2 2005/12/21 00:09:56 danmc Exp $
+# $Id: refdes_renum,v 1.3 2007/02/10 20:46:17 sdb Exp $
#
# Copyright (C) 2003 Dan McMahill
#
@@ -36,11 +36,14 @@
# don't allow -he to be interpreted as --help
$Getopt::Long::autoabbrev=0;
+my $clear; # reset all refdes
+
&GetOptions(("help" => \&usage,
"nocopy" => \$nocopy,
"pgskip:i" => \$pgskip,
"verbose" => \$verbose,
- "version" => \&version
+ "version" => \&version,
+ "clear" => \$clear,
));
usage() if $Getopt::Long::error;
@@ -84,9 +87,12 @@
# is at work right now.
$pre = $line;
$pre =~ s/^refdes=//;
- $pre =~ s/[0-9\?]*$//;
- print "Refdes line \"$line\" has pre=\"$pre\"\n" if($verbose);
-
+ $pre =~ s/([0-9\?])*$//;
+ my $suf = $1;
+ print "Refdes line \"$line\" has pre=\"$pre\"m suf=$suf\n" if($verbose);
+ if ($clear) {
+ print OUTNET "refdes=$pre?\n";
+ } else {
# if we're skipping numbers, then start at 100 for page 1
# and we'll jump to 200 for page 2, etc.
if( ! $devcnt{$pre} ) { $devcnt{$pre} = $pgskip ? ($i+1)*$pgskip : 0; }
@@ -94,6 +100,7 @@
print "Renumbering $line to $pre$devcnt{$pre}\n" if($verbose);
print OUTNET "refdes=$pre$devcnt{$pre}\n";
}
+ }
close(NETLIST);
close(OUTNET);
@@ -206,6 +213,9 @@
# Change Log
#
# $Log: refdes_renum,v $
+# Revision 1.3 2007/02/10 20:46:17 sdb
+# Added --clear option to clear refdeses. (* jcl *)
+#
# Revision 1.2 2005/12/21 00:09:56 danmc
# - Fix a bug where when using the --pgskip option, components which were
# present on page n, but not on pages n+1 through n+j, and present again
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs