forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
outerspace-0.5.68-setup.patch
83 lines (77 loc) · 1.61 KB
/
outerspace-0.5.68-setup.patch
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
--- setup.py
+++ setup.py
@@ -42,12 +42,7 @@
# collect data files
data_files = []
-data_files.append(
- (
- ".",
- ["../ChangeLog.txt", "../COPYING", "../README", "../README_CZ"]
- )
-)
+
# resources
for root, dirs, files in os.walk('res'):
@@ -57,16 +52,6 @@
pass
if files:
data_files.append((root, [os.path.join(root, file) for file in files]))
-
-data_files.append(
- (
- "res/techspec",
- [
- "../server/lib/ige/ospace/Rules/techs.spf",
- "../server/lib/ige/ospace/Rules/Tech.spf",
- ]
- )
-)
if havePy2Exe:
data_files.append((".", ["../updater/update.exe"]))
@@ -114,10 +99,3 @@
**extraArgs
)
-# cleanup
-def onerror(func, path, err):
- if func is os.remove:
- os.chmod(path, stat.S_IWRITE)
- os.remove(path)
-
-shutil.rmtree("libsrvr", onerror = onerror)
--- osc.py
+++ osc.py
@@ -23,12 +23,36 @@
# tweak PYTHONPATH
import sys
import os
+import errno
sys.path.insert(0, "lib")
for item in ("libsrvr", "../server/lib"):
if os.path.exists(item):
sys.path.insert(0, item)
break
+
+userdir=os.path.expanduser("~/.outerspace")
+resdir=os.path.join(userdir, "res")
+rootresdir="@GENTOO_DATADIR@/res"
+
+if not (os.path.isdir(userdir)):
+ try:
+ os.makedirs(userdir)
+ except:
+ sys.exit("unable to create %s" % userdir)
+
+try:
+ os.symlink(rootresdir, resdir)
+except OSError, e:
+ if e.errno == errno.EEXIST:
+ os.remove(resdir)
+ os.symlink(rootresdir, resdir)
+
+try:
+ os.chdir(userdir)
+except:
+ sys.exit("unable to cd into %s" % userdir)
+
#configure gc
#import gc