forked from bingtangx/taobao-kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
find-provides
executable file
·45 lines (37 loc) · 1.02 KB
/
find-provides
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/python
#
# find-provides: munge the provides dependencies from the kabideps file
#
# This software may be freely redistributed under the terms of the GNU
# General Public License (GPL).
#
# Takes a directory prefix, then outputs the kernel ABI dependencies.
__author__ = "Jon Masters <jcm@redhat.com>"
__version__ = "2.0"
__date__ = "Sat 1 Aug 2009 10:00 EDT"
__copyright__ = "Copyright (C) 2009 Red Hat, Inc"
__license__ = "GPL"
import os
import re
import string
import sys
import getpass
false = 0
true = 1
kabideps=""
p = re.compile('^(.*)/symvers-(.*).gz$')
while true:
foo = sys.stdin.readline()
if foo == "":
break
string.split(foo)
m = p.match(foo)
if m:
kabideps=sys.argv[1] + "/kernel-" + m.group(2) + "-" + getpass.getuser() + "-kabideps"
if kabideps == "":
sys.exit(0)
if not (os.path.isfile(kabideps)):
sys.stderr.write(sys.argv[0] + ": cannot locate kabideps file: " + kabideps + "\n")
sys.exit(1)
sys.stderr.write(sys.argv[0] + ": processing kABI: " + kabideps + "\n")
os.system("cat " + kabideps)