/[kportage]/kportage/kportage/portage/portagepython.py
ViewVC logotype

Contents of /kportage/kportage/portage/portagepython.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download) (as text)
Fri Nov 22 22:28:28 2002 UTC (21 years, 5 months ago) by hannes
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +0 -0 lines
File MIME type: text/x-python
FILE REMOVED
this file is obsolete, kportage.py is the correct file for python

1 import portage, os, grp
2
3 class mask:
4 def packageMask(self):
5 portage.portdb.freeze()
6 """returns a string which contains all ebuilds which are masked
7 in packages.mask or by profile."""
8 b=""
9 for package in portage.portdb.cp_all():
10 list1 = portage.portdb.cp_list(package)
11 list2 = portage.portdb.visible(list1)
12 for sub in list1:
13 if (sub not in list2):
14 b+=sub+" "
15 else:
16 list2.remove(sub)
17 return b
18
19 # def teste(self, string):
20 # return string
21
22 def keywordMask(self):
23 portage.portdb.freeze()
24 """returns a string which contains all ebuilds masked by their keywords."""
25 b=""
26 for package in portage.portdb.cp_all():
27 list1 = portage.portdb.cp_list(package)
28 list2 = portage.portdb.gvisible(list1)
29 #print list2
30 for sub in list1:
31 if (sub not in list2):
32 b+=sub+" "
33 else:
34 list2.remove(sub)
35 #print b
36 return b
37
38 class user:
39 def isRootWheel(self):
40 uid=os.getuid()
41 secpass=0
42 if uid==0:
43 secpass=2
44 return "true"
45 try:
46 wheelgid=grp.getgrnam("wheel")[2]
47 if (not secpass) and (wheelgid in os.getgroups()):
48 return "true"
49 except KeyError:
50 return "false"
51 return "false"
52
53 #mymask = mask()
54 #print mymask.keywordMask()

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26