File: binary-control.py

package info (click to toggle)
binutils-mipsen 14%2Bc1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 64 kB
  • sloc: makefile: 86; python: 29
file content (33 lines) | stat: -rw-r--r-- 1,006 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python3

arch_map = {}
host = []
fullc = []
with open("stamp-dir/archmap.tmp") as arcf:
    a=arcf.readline().strip().split(' ')
    for i in a:
        i=i.split('=')
        arch_map[i[0]] = i[1]
    host=arcf.readline().strip().split(' ')

with open("stamp-dir/fullc.tmp") as fullcf:
    fullc = fullcf.readlines()
fullc_len = len(fullc) - 1

for a in arch_map:
    i = fullc.index("Package: binutils-" + arch_map[a] + "\n")
    while i<=fullc_len and fullc[i] != "\n":
        if fullc[i].startswith("Architecture: "):
            print("Architecture: " + " ".join([h for h in host if h != a]))
        else:
            print(fullc[i], end="")
        i += 1
    print()
    i = fullc.index("Package: binutils-" + arch_map[a] + "-dbg\n")
    while i<=fullc_len and fullc[i] != "\n":
        if fullc[i].startswith("Architecture: "):
            print("Architecture: " + " ".join([h for h in host if h != a]))
        else:
            print(fullc[i], end="")
        i += 1
    print()