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