~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/utils/DSAclean.py

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-03-12 11:30:04 UTC
  • mfrom: (0.41.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100312113004-b0fop4bkycszdd0z
Tags: 0.96~rc1+dfsg-0ubuntu1
* New upstream RC - FFE (LP: #537636):
  - Add OfficialDatabaseOnly option to clamav-base.postinst.in
  - Add LocalSocketGroup option to clamav-base.postinst.in
  - Add LocalSocketMode option to clamav-base.postinst.in
  - Add CrossFilesystems option to clamav-base.postinst.in
  - Add ClamukoScannerCount option to clamav-base.postinst.in
  - Add BytecodeSecurity opiton to clamav-base.postinst.in
  - Add DetectionStatsHostID option to clamav-freshclam.postinst.in
  - Add Bytecode option to clamav-freshclam.postinst.in
  - Add MilterSocketGroup option to clamav-milter.postinst.in
  - Add MilterSocketMode option to clamav-milter.postinst.in
  - Add ReportHostname option to clamav-milter.postinst.in
  - Bump libclamav SO version to 6.1.0 in libclamav6.install
  - Drop clamdmon from clamav.examples (no longer shipped by upstream)
  - Drop libclamav.a from libclamav-dev.install (not built by upstream)
  - Update SO version for lintian override for libclamav6
  - Add new Bytecode Testing Tool, usr/bin/clambc, to clamav.install
  - Add build-depends on python and python-setuptools for new test suite
  - Update debian/copyright for the embedded copy of llvm (using the system
    llvm is not currently feasible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/python
 
2
 
 
3
#changelog: 
 
4
#10/13/2005b: replaced the # in tmp(.#*)* with alphanumeric and _, this will then remove
 
5
#nodes such as %tmp.1.i and %tmp._i.3
 
6
#10/13/2005: exntended to remove variables of the form %tmp(.#)* rather than just 
 
7
#%tmp.#, i.e. it now will remove %tmp.12.3.15 etc, additionally fixed a spelling error in
 
8
#the comments
 
9
#10/12/2005: now it only removes nodes and edges for which the label is %tmp.# rather
 
10
#than removing all lines for which the lable CONTAINS %tmp.#
 
11
import re
 
12
import sys
 
13
if( len(sys.argv) < 3 ):
 
14
        print 'usage is: ./DSAclean <dot_file_to_be_cleaned> <out_put_file>'
 
15
        sys.exit(1)
 
16
#get a file object
 
17
input = open(sys.argv[1], 'r')
 
18
output = open(sys.argv[2], 'w')
 
19
#we'll get this one line at a time...while we could just put the whole thing in a string
 
20
#it would kill old computers
 
21
buffer = input.readline()
 
22
while buffer != '':
 
23
        if re.compile("label(\s*)=(\s*)\"\s%tmp(.\w*)*(\s*)\"").search(buffer):
 
24
                #skip next line, write neither this line nor the next
 
25
                buffer = input.readline()
 
26
        else:
 
27
                #this isn't a tmp Node, we can write it
 
28
                output.write(buffer)
 
29
        #prepare for the next iteration
 
30
        buffer = input.readline()
 
31
input.close()
 
32
output.close()