3 # Check that the binaries for links BusyBox outputs and the ones
4 # in the packages *.links files match.
6 # Copyright (C) 2008 by Nokia Corporation
8 # Contact: Eero Tamminen <eero.tamminen@nokia.com>
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License
12 # version 2 as published by the Free Software Foundation.
14 # This program is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
26 def add_links_from(filename, olditems):
27 "read busybox.links file and return a list of binary names"
31 for line in open(filename):
35 name = os.path.basename(line.split()[-1])
36 if name in olditems and name not in newitems:
37 # same package may symlink same name to different
38 # places, but other packages may not
41 olditems[name] = filename
45 print "ERROR: following items were already in (some) previous links file:"
48 print "Re-run of create-control.py needed?"
52 def process_args(argv):
56 add_links_from(argv[1], bblinks)
57 for filename in argv[2:]:
58 add_links_from(filename, links)
61 for link in bblinks.keys():
68 print "WARNING: links files for packages are missing following BB links:"
71 print "Are all these installed as alternatives?"
74 print "ERROR: BB links file doesn't contain following packages links:"
75 for link in links.keys():
76 print "- %s (in '%s')" % (link, links[link])
77 print "Re-run of create-control.py needed?"
81 if __name__ == "__main__":
83 process_args(sys.argv)
86 Script to check that binary names in packages link files
87 match the list of binary names in the BB link file.
89 usage: %s <BB links file> <packages link files>
90 """ % os.path.basename(sys.argv[0])