Magellan Linux

Diff of /trunk/mkinitrd-magellan/busybox/scripts/bloat-o-meter

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 983 by niro, Fri Apr 24 18:33:46 2009 UTC revision 984 by niro, Sun May 30 11:32:42 2010 UTC
# Line 16  def usage(): Line 16  def usage():
16  if len(sys.argv) < 3:  if len(sys.argv) < 3:
17      usage()      usage()
18    
19  for f in sys.argv[1], sys.argv[2]:  for f in sys.argv[1:3]:
20      if not os.path.exists(f):      if not os.path.exists(f):
21          sys.stderr.write("Error: file '%s' does not exist\n" % f)          sys.stderr.write("Error: file '%s' does not exist\n" % f)
22          usage()          usage()
23    
24  nm_args = " ".join([x for x in sys.argv[3:]])  nm_args = " ".join(sys.argv[3:])
25  def getsizes(file):  def getsizes(file):
26      sym = {}      sym = {}
27      for l in os.popen("nm --size-sort %s %s" % (nm_args, file)).readlines():      for l in os.popen("nm --size-sort %s %s" % (nm_args, file)).readlines():
28       l = l.strip()          l = l.strip()
29   # Skip empty lines          # Skip empty lines
30          if not len(l): continue          if not len(l): continue
31   # Skip archive members          # Skip archive members
32          if len(l.split()) == 1 and l.endswith(':'):          if len(l.split()) == 1 and l.endswith(':'):
33            continue            continue
34          size, type, name = l.split()          size, type, name = l.split()

Legend:
Removed from v.983  
changed lines
  Added in v.984