• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/support/scripts/size-stats
Thomas De SchampheleireThomas De Schampheleire committed a3f37c53d5b02 Jan 2018
Raw file
Source viewDiff to previous
xxxxxxxxxx
    with open(os.path.join(builddir, "build", "packages-file-list.txt")) as filelistf:
 
1
#!/usr/bin/env python
2
​
3
# Copyright (C) 2014 by Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
4
​
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 2 of the License, or
8
# (at your option) any later version.
9
#
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
# General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with this program; if not, write to the Free Software
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
​
19
import sys
20
import os
21
import os.path
22
import argparse
23
import csv
24
import collections
25
​
26
try:
27
    import matplotlib
28
    matplotlib.use('Agg')
29
    import matplotlib.font_manager as fm
30
    import matplotlib.pyplot as plt
31
except ImportError:
32
    sys.stderr.write("You need python-matplotlib to generate the size graph\n")
33
    exit(1)
34
​
35
colors = ['#e60004', '#009836', '#2e1d86', '#ffed00',
36
          '#0068b5', '#f28e00', '#940084', '#97c000']
37
​
38
#
39
# This function adds a new file to 'filesdict', after checking its
40
# size. The 'filesdict' contain the relative path of the file as the
41
# key, and as the value a tuple containing the name of the package to
42
# which the file belongs and the size of the file.
43
#
44
# filesdict: the dict to which  the file is added
45
# relpath: relative path of the file
46
# fullpath: absolute path to the file
47
# pkg: package to which the file belongs
48
#
49
def add_file(filesdict, relpath, abspath, pkg):
50
    if not os.path.exists(abspath):
51
        return
52
    if os.path.islink(abspath):
53
        return
54
    sz = os.stat(abspath).st_size
55
    filesdict[relpath] = (pkg, sz)
56
​
57
#
58
# This function returns a dict where each key is the path of a file in
59
# the root filesystem, and the value is a tuple containing two
60
# elements: the name of the package to which this file belongs and the
61
# size of the file.
62
#
63
# builddir: path to the Buildroot output directory
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.