classification
Title: Check for COMMAND_LINE_INSTALL variable in Python_Documentation.pkg
Type: Stage: resolved
Components: macOS Versions: Python 3.10, Python 3.9, Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ned.deily Nosy List: flammable, miss-islington, ned.deily, rickheil, ronaldoussoren
Priority: normal Keywords: patch

Created on 2020-02-07 21:44 by flammable, last changed 2020-06-25 11:05 by ned.deily. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 20271 merged rickheil, 2020-05-20 19:29
PR 21139 merged miss-islington, 2020-06-25 10:37
PR 21140 merged miss-islington, 2020-06-25 10:38
Messages (8)
msg361610 - (view) Author: Mike Solin (flammable) Date: 2020-02-07 21:44
Hello Python developers!

I'm looking to deploy Python 3 silently to the Macs that I manage, so I can use Python for various scripts. I'm using Munki to accomplish this. However, the Python_Documentation.pkg subpackage includes this code in the postinstall script:

```
# make link in /Applications/Python m.n/ for Finder users
if [ -d "${APPDIR}" ]; then
    ln -fhs "${FWK_DOCDIR}/index.html" "${APPDIR}/Python Documentation.html"
    open "${APPDIR}" || true  # open the applications folder
fi
```

Would it be possible to test for the $COMMAND_LINE_INSTALL variable before opening a Finder window? If the $COMMAND_LINE_INSTALL exists, it'd be really great if it didn't open the Finder. This would allow me to silently deploy Python 3 without disrupting my users.

Thanks!

Mike
msg369472 - (view) Author: Rick Heil (rickheil) * Date: 2020-05-20 19:31
In case folks reading this are not aware, installer(8) sets an environmental variable COMMAND_LINE_INSTALL when an installation is triggered on the command line versus when a user double-clicks a package in the GUI to kick off the install.

I've filed the linked PR to add a test on the APPDIR open statement to avoid popping up the Finder when the package is installed on the command line. If there's a different method by which I should do this, please point me in the vague direction and I'm happy to update!

(note - I just signed the CLA today so it should be registered soonish)
msg370062 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2020-05-27 10:39
Thanks for the PR! It looks reasonable but I do want to test it first on older macOS versions that we support before merging it. I'll do that before the next releases.
msg371789 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2020-06-18 03:51
New changeset 966036af0e5e1dff8fedd423d90a246067537345 by Ned Deily in branch '3.7':
bpo-39580: add check for CLI installation on macOS
https://github.com/python/cpython/commit/966036af0e5e1dff8fedd423d90a246067537345
msg372338 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2020-06-25 10:37
New changeset 5f190d2cc60cd82a604cbffb58b6ca8f40350a7a by Rick Heil in branch 'master':
bpo-39580: add check for CLI installation on macOS (GH-20271)
https://github.com/python/cpython/commit/5f190d2cc60cd82a604cbffb58b6ca8f40350a7a
msg372341 - (view) Author: miss-islington (miss-islington) Date: 2020-06-25 10:56
New changeset 4564ebb1e62378d350d5483b0ae5d0d84082af2b by Miss Islington (bot) in branch '3.8':
bpo-39580: add check for CLI installation on macOS (GH-20271)
https://github.com/python/cpython/commit/4564ebb1e62378d350d5483b0ae5d0d84082af2b
msg372342 - (view) Author: miss-islington (miss-islington) Date: 2020-06-25 10:56
New changeset bdc55eb55f7a88e374593dea1257566c2db3f5e4 by Miss Islington (bot) in branch '3.9':
bpo-39580: add check for CLI installation on macOS (GH-20271)
https://github.com/python/cpython/commit/bdc55eb55f7a88e374593dea1257566c2db3f5e4
msg372343 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2020-06-25 11:05
Thanks again for the PR. The change will be included in python.org installers for macOS as of 3.9.0b4, 3.8.4, and 3.7.8.
History
Date User Action Args
2020-06-25 11:05:59ned.deilysetstatus: open -> closed
resolution: fixed
messages: + msg372343

stage: patch review -> resolved
2020-06-25 10:56:55miss-islingtonsetmessages: + msg372342
2020-06-25 10:56:18miss-islingtonsetmessages: + msg372341
2020-06-25 10:38:03miss-islingtonsetpull_requests: + pull_request20299
2020-06-25 10:37:56miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request20298
2020-06-25 10:37:44ned.deilysetmessages: + msg372338
2020-06-18 03:51:44ned.deilysetmessages: + msg371789
2020-05-27 10:39:05ned.deilysetmessages: + msg370062
versions: + Python 3.7, Python 3.9, Python 3.10
2020-05-20 19:31:21rickheilsetnosy: ronaldoussoren, ned.deily, flammable, rickheil
messages: + msg369472
2020-05-20 19:29:14rickheilsetkeywords: + patch
nosy: + rickheil

pull_requests: + pull_request19551
stage: patch review
2020-02-07 21:46:46ned.deilysetassignee: ned.deily
2020-02-07 21:44:10flammablecreate