File: fnlookup.py

package info (click to toggle)
rpm 4.20.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,832 kB
  • sloc: ansic: 70,093; sh: 1,843; python: 1,037; cpp: 324; makefile: 39
file content (11 lines) | stat: -rwxr-xr-x 228 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/python
# Look up file ownerships from the rpmdb
# Usage: ./fnlookup.py <file1> [...]

import rpm
import sys

ts = rpm.ts()
for arg in sys.argv[1:]:
    for h in ts.dbMatch('basenames', arg):
        print(h['nevra'])