Skip to content

Commit 6d5a28d

Browse files
committed
jobs: Dropping chdir (process-wide).
1 parent eb60afb commit 6d5a28d

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
@@ -206,10 +206,9 @@ def build_one(version, git_branch, isdev, quick, venv, build_root, www_root,
206206
target, str(err))
207207
git_clone('https://github.com/python/cpython.git',
208208
checkout, git_branch)
209-
os.chdir(checkout)
210209
maketarget = "autobuild-" + ("dev" if isdev else "stable") + ("-html" if quick else "")
211210
logging.info("Running make %s", maketarget)
212-
logname = "{}-{}.log".format(os.path.basename(checkout), language)
211+
logname = "{}.log".format(os.path.basename(checkout))
213212
python = os.path.join(venv, "bin/python")
214213
sphinxbuild = os.path.join(venv, "bin/sphinx-build")
215214
blurb = os.path.join(venv, "bin/blurb")
@@ -220,20 +219,20 @@ def build_one(version, git_branch, isdev, quick, venv, build_root, www_root,
220219
shell_out(['chgrp', '-R', group, log_directory])
221220
changed = changed_files(os.path.join(checkout, "Doc/build/html"), target)
222221
logging.info("Copying HTML files to %s", target)
223-
shell_out(['chown', '-R', ':' + group, 'Doc/build/html/'])
224-
shell_out(['chmod', '-R', 'o+r', 'Doc/build/html/'])
225-
shell_out(['find', 'Doc/build/html/', '-type', 'd',
222+
shell_out(['chown', '-R', ':' + group, os.path.join(checkout, 'Doc/build/html/')])
223+
shell_out(['chmod', '-R', 'o+r', os.path.join(checkout, 'Doc/build/html/')])
224+
shell_out(['find', os.path.join(checkout, 'Doc/build/html/'), '-type', 'd',
226225
'-exec', 'chmod', 'o+x', '{}', ';'])
227226
if quick:
228-
shell_out(['rsync', '-a', 'Doc/build/html/', target])
227+
shell_out(['rsync', '-a', os.path.join(checkout, 'Doc/build/html/'), target])
229228
else:
230-
shell_out(['rsync', '-a', '--delete-delay', 'Doc/build/html/', target])
229+
shell_out(['rsync', '-a', '--delete-delay', os.path.join(checkout, 'Doc/build/html/'), target])
231230
if not quick:
232231
logging.debug("Copying dist files")
233-
shell_out(['chown', '-R', ':' + group, 'Doc/dist/'])
234-
shell_out(['chmod', '-R', 'o+r', 'Doc/dist/'])
235-
shell_out(['mkdir', '-m', 'o+rx', '-p', target + '/archives'])
236-
shell_out(['chown', ':' + group, target + '/archives'])
232+
shell_out(['chown', '-R', ':' + group, os.path.join(checkout, 'Doc/dist/')])
233+
shell_out(['chmod', '-R', 'o+r', os.path.join('Doc/dist/')])
234+
shell_out(['mkdir', '-m', 'o+rx', '-p', os.path.join(target, 'archives')])
235+
shell_out(['chown', ':' + group, os.path.join(target, 'archives')])
237236
shell_out("cp -a Doc/dist/* %s/archives" % target, shell=True)
238237
changed.append("archives/")
239238
for fn in os.listdir(os.path.join(target, "archives")):

0 commit comments

Comments
 (0)