Skip to content

Commit 76bc509

Browse files
committedJul 21, 2018
jobs: Dropping chdir (process-wide).
1 parent 791dffa commit 76bc509

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed
 

‎build_docs.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,9 @@ def build_one(version, git_branch, isdev, quick, venv, build_root, www_root,
219219
logging.warning("Can't change group of %s: %s", target, str(err))
220220
git_clone('https://github.com/python/cpython.git',
221221
checkout, git_branch)
222-
os.chdir(checkout)
223222
maketarget = "autobuild-" + ("dev" if isdev else "stable") + ("-html" if quick else "")
224223
logging.info("Running make %s", maketarget)
225-
logname = "{}-{}.log".format(os.path.basename(checkout), language)
224+
logname = "{}.log".format(os.path.basename(checkout))
226225
python = os.path.join(venv, "bin/python")
227226
sphinxbuild = os.path.join(venv, "bin/sphinx-build")
228227
blurb = os.path.join(venv, "bin/blurb")
@@ -233,20 +232,20 @@ def build_one(version, git_branch, isdev, quick, venv, build_root, www_root,
233232
shell_out(['chgrp', '-R', group, log_directory])
234233
changed = changed_files(os.path.join(checkout, "Doc/build/html"), target)
235234
logging.info("Copying HTML files to %s", target)
236-
shell_out(['chown', '-R', ':' + group, 'Doc/build/html/'])
237-
shell_out(['chmod', '-R', 'o+r', 'Doc/build/html/'])
238-
shell_out(['find', 'Doc/build/html/', '-type', 'd',
235+
shell_out(['chown', '-R', ':' + group, os.path.join(checkout, 'Doc/build/html/')])
236+
shell_out(['chmod', '-R', 'o+r', os.path.join(checkout, 'Doc/build/html/')])
237+
shell_out(['find', os.path.join(checkout, 'Doc/build/html/'), '-type', 'd',
239238
'-exec', 'chmod', 'o+x', '{}', ';'])
240239
if quick:
241-
shell_out(['rsync', '-a', 'Doc/build/html/', target])
240+
shell_out(['rsync', '-a', os.path.join(checkout, 'Doc/build/html/'), target])
242241
else:
243-
shell_out(['rsync', '-a', '--delete-delay', 'Doc/build/html/', target])
242+
shell_out(['rsync', '-a', '--delete-delay', os.path.join(checkout, 'Doc/build/html/'), target])
244243
if not quick:
245244
logging.debug("Copying dist files")
246-
shell_out(['chown', '-R', ':' + group, 'Doc/dist/'])
247-
shell_out(['chmod', '-R', 'o+r', 'Doc/dist/'])
248-
shell_out(['mkdir', '-m', 'o+rx', '-p', target + '/archives'])
249-
shell_out(['chown', ':' + group, target + '/archives'])
245+
shell_out(['chown', '-R', ':' + group, os.path.join(checkout, 'Doc/dist/')])
246+
shell_out(['chmod', '-R', 'o+r', os.path.join('Doc/dist/')])
247+
shell_out(['mkdir', '-m', 'o+rx', '-p', os.path.join(target, 'archives')])
248+
shell_out(['chown', ':' + group, os.path.join(target, 'archives')])
250249
shell_out("cp -a Doc/dist/* %s/archives" % target, shell=True)
251250
changed.append("archives/")
252251
for fn in os.listdir(os.path.join(target, "archives")):

0 commit comments

Comments
 (0)
Please sign in to comment.