aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2005-03-27 21:39:38 +0000
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2005-03-27 21:39:38 +0000
commit5d87d146b2518b24d0d686f3680fd31d06389f2e (patch)
tree35ea2fa205cbdffca86574773c127890662c0172 /tools
parent74ad7d1063d4a5c5608e96b2c898e9cbf46b6de0 (diff)
From Jacques, Olivier:
The patch attached fixes it by creating a table of unique files at the time of file deletion. This way, current asn2eth behaviour is not modified. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13943 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'tools')
-rw-r--r--tools/asn2eth.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/asn2eth.py b/tools/asn2eth.py
index d22aa2b433..adb5663ea2 100644
--- a/tools/asn2eth.py
+++ b/tools/asn2eth.py
@@ -1442,6 +1442,7 @@ class EthOut:
self.outdir = '.'
self.single_file = None
self.created_files = []
+ self.unique_created_files = []
self.keep = False
#--- output_fname -------------------------------------------------------
def output_fname(self, ftype, ext='c'):
@@ -1471,7 +1472,7 @@ class EthOut:
fx.close()
if (discard):
os.unlink(fx.name)
- elif (not keep_anyway):
+ elif (not keep_anyway):
self.created_files.append(os.path.normcase(os.path.abspath(fx.name)))
#--- fhdr -------------------------------------------------------
def fhdr(self, fn, comment=None):
@@ -1499,7 +1500,9 @@ class EthOut:
out_nm = self.output_fullname('', ext='h')
self.do_include(out_nm, in_nm)
if (not self.keep):
- for fn in self.created_files:
+ self.unique_created_files = []
+ [self.unique_created_files.append(wrd) for wrd in self.created_files if not self.unique_created_files.count(wrd)]
+ for fn in self.unique_created_files:
os.unlink(fn)
#--- do_include -------------------------------------------------------