|
17 | 17 | import time
|
18 | 18 | import hashlib
|
19 | 19 | import subprocess
|
20 |
| -from sage.env import DOT_SAGE, SAGE_LOCAL, HOSTNAME, GAP_ROOT_DIR |
| 20 | +from sage.env import DOT_SAGE, HOSTNAME, GAP_LIB_DIR, GAP_SHARE_DIR |
21 | 21 |
|
22 | 22 |
|
23 | 23 | def gap_workspace_file(system="gap", name="workspace", dir=None):
|
@@ -60,12 +60,13 @@ def gap_workspace_file(system="gap", name="workspace", dir=None):
|
60 | 60 | if dir is None:
|
61 | 61 | dir = os.path.join(DOT_SAGE, 'gap')
|
62 | 62 |
|
63 |
| - data = SAGE_LOCAL |
64 |
| - sysinfo = os.path.join(GAP_ROOT_DIR, "sysinfo.gap") |
65 |
| - if os.path.exists(sysinfo): |
66 |
| - data += subprocess.getoutput(f'. "{sysinfo}" && echo ":$GAP_VERSION:$GAParch"') |
| 63 | + data = f'{GAP_LIB_DIR}:{GAP_SHARE_DIR}' |
| 64 | + for path in GAP_LIB_DIR, GAP_SHARE_DIR: |
| 65 | + sysinfo = os.path.join(path, "sysinfo.gap") |
| 66 | + if os.path.exists(sysinfo): |
| 67 | + data += subprocess.getoutput(f'. "{sysinfo}" && echo ":$GAP_VERSION:$GAParch"') |
67 | 68 | h = hashlib.sha1(data.encode('utf-8')).hexdigest()
|
68 |
| - return os.path.join(dir, '%s-%s-%s-%s' % (system, name, HOSTNAME, h)) |
| 69 | + return os.path.join(dir, f'{system}-{name}-{HOSTNAME}-{h}') |
69 | 70 |
|
70 | 71 |
|
71 | 72 | def prepare_workspace_dir(dir=None):
|
|
0 commit comments