diff options
Diffstat (limited to 'bin/atoms_to_keylost')
-rwxr-xr-x | bin/atoms_to_keylost | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/atoms_to_keylost b/bin/atoms_to_keylost new file mode 100755 index 0000000..60e8404 --- /dev/null +++ b/bin/atoms_to_keylost @@ -0,0 +1,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) + |