Jesse Keating 7a3296
#!/usr/bin/python
Jesse Keating 7a3296
#
Jesse Keating 7a3296
# find-provides: munge the provides dependencies from the kabideps file
Jesse Keating 7a3296
#
Jesse Keating 7a3296
# This software may be freely redistributed under the terms of the GNU
Jesse Keating 7a3296
# General Public License (GPL).
Jesse Keating 7a3296
#
Jesse Keating 7a3296
# Takes a directory prefix, then outputs the kabideps file contents.
Jesse Keating 7a3296
Jesse Keating 7a3296
__author__ = "Jon Masters <jcm@redhat.com>"
Jesse Keating 7a3296
__version__ = "1.0"
Jesse Keating 7a3296
__date__ = "Tue 25 Jul 2006 04:00 GMT"
Jesse Keating 7a3296
__copyright__ = "Copyright (C) 2006 Red Hat, Inc"
Jesse Keating 7a3296
__license__ = "GPL"
Jesse Keating 7a3296
Jesse Keating 7a3296
import os
Jesse Keating 7a3296
import re
Jesse Keating 7a3296
import string
Jesse Keating 7a3296
import sys
Jesse Keating 7a3296
Jesse Keating 7a3296
false = 0
Jesse Keating 7a3296
true = 1
Jesse Keating 7a3296
Jesse Keating 7a3296
kabideps=""
Jesse Keating 7a3296
Jesse Keating 7a3296
p = re.compile('^(.*)/symvers-(.*).gz$')
Jesse Keating 7a3296
while true:
Jesse Keating 7a3296
	foo = sys.stdin.readline()
Jesse Keating 7a3296
	if foo == "":
Jesse Keating 7a3296
		break
Jesse Keating 7a3296
	string.split(foo)
Jesse Keating 7a3296
	m = p.match(foo)
Jesse Keating 7a3296
	if m:
Jesse Keating 7a3296
		kabideps=sys.argv[1] + "/kernel-" + m.group(2) + "-kabideps"
Jesse Keating 7a3296
	
Jesse Keating 7a3296
if kabideps == "":
Jesse Keating 7a3296
	sys.exit(0)
Jesse Keating 7a3296
Jesse Keating 7a3296
if not (os.path.isfile(kabideps)):
Jesse Keating 7a3296
	sys.stderr.write(sys.argv[0] + ": cannot locate kabideps file: " + kabideps + "\n")
Jesse Keating 7a3296
	sys.exit(1)
Jesse Keating 7a3296
Jesse Keating 7a3296
sys.stderr.write(sys.argv[0] + ": processing kABI: " + kabideps)
Jesse Keating 7a3296
os.system("cat " + kabideps)