Menu

[r8164]: / branches / mathtex / release / osx / data / bdist.patch  Maximize  Restore  History

Download this file

26 lines (23 with data), 984 Bytes

 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
diff -rNu bdist_mpkg-0.4.3/bdist_mpkg/tools.py bdist_mpkg-0.4.3.leopard/bdist_mpkg/tools.py
--- bdist_mpkg-0.4.3/bdist_mpkg/tools.py 2006-07-09 00:39:00.000000000 -0400
+++ bdist_mpkg-0.4.3.leopard/bdist_mpkg/tools.py 2008-08-21 07:43:35.000000000 -0400
@@ -79,15 +79,12 @@
yield os.path.join(root, fn)
def get_gid(name, _cache={}):
- if not _cache:
- for line in os.popen('/usr/bin/nidump group .'):
- fields = line.split(':')
- if len(fields) >= 3:
- _cache[fields[0]] = int(fields[2])
- try:
- return _cache[name]
- except KeyError:
- raise ValueError('group %s not found' % (name,))
+ for line in os.popen("dscl . -read /Groups/" + name + " PrimaryGroupID"):
+ fields = [f.strip() for f in line.split(':')]
+ if fields[0] == "PrimaryGroupID":
+ return fields[1]
+
+ raise ValueError('group %s not found' % (name,))
def find_root(path, base='/'):
"""