summaryrefslogtreecommitdiff
path: root/bin/atoms_to_keylost
blob: 60e8404f48798254a032360f7103f2c8e9e08755 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/python
import sys
import entropy.dep

atoms = sys.argv[1:]

keyslot_cache = set()
for atom in atoms:
    key = entropy.dep.dep_getkey(atom)
    with open("/var/db/pkg/%s/SLOT" % (atom,)) as slot_f:
        slot = slot_f.readline().strip()
    keyslot = "%s:%s" % (key, slot)
    if keyslot in keyslot_cache:
        continue
    print(keyslot)
    keyslot_cache.add(keyslot)