Skip to content

Commit b539ede

Browse files
add root-user-action=ignore and check for .complete file (actions#223)
1 parent e952c80 commit b539ede

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

installers/macos-pkg-setup-template.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ chmod +x ../python $PYTHON_MAJOR $PYTHON_MAJOR_DOT_MINOR $PYTHON_MAJOR_MINOR pyt
6969

7070
echo "Upgrading pip..."
7171
./python -m ensurepip
72-
./python -m pip install --ignore-installed pip --disable-pip-version-check --no-warn-script-location
72+
./python -m pip install --ignore-installed pip --disable-pip-version-check --no-warn-script-location --root-user-action=ignore
7373

7474
echo "Install OpenSSL certificates"
7575
sh -e "${PYTHON_APPLICATION_PATH}/Install Certificates.command"

installers/nix-setup-template.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ chmod +x ../python $PYTHON_MAJOR $PYTHON_MAJOR_DOT_MINOR $PYTHON_MAJORMINOR pyth
5050

5151
echo "Upgrading pip..."
5252
./python -m ensurepip
53-
./python -m pip install --ignore-installed pip --disable-pip-version-check --no-warn-script-location
53+
./python -m pip install --ignore-installed pip --disable-pip-version-check --no-warn-script-location --root-user-action=ignore
5454

5555
echo "Create complete file"
5656
touch $PYTHON_TOOLCACHE_VERSION_PATH/x64.complete

installers/win-setup-template.ps1

+4-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ if ($null -ne $InstalledVersions) {
101101
if (Test-Path -Path $InstalledVersion) {
102102
Write-Host "Deleting $InstalledVersion..."
103103
Remove-Item -Path $InstalledVersion -Recurse -Force
104-
Remove-Item -Path "$($InstalledVersion.Parent.FullName)/${Architecture}.complete" -Force -Verbose
104+
if (Test-Path -Path "$($InstalledVersion.Parent.FullName)/${Architecture}.complete") {
105+
Remove-Item -Path "$($InstalledVersion.Parent.FullName)/${Architecture}.complete" -Force -Verbose
106+
}
105107
}
106108
}
107109
} else {
@@ -132,7 +134,7 @@ if ($MajorVersion -ne "2") {
132134

133135
Write-Host "Install and upgrade Pip"
134136
$PythonExePath = Join-Path -Path $PythonArchPath -ChildPath "python.exe"
135-
cmd.exe /c "$PythonExePath -m ensurepip && $PythonExePath -m pip install --upgrade pip --no-warn-script-location"
137+
cmd.exe /c "$PythonExePath -m ensurepip && $PythonExePath -m pip install --upgrade pip --no-warn-script-location --root-user-action=ignore"
136138

137139
Write-Host "Create complete file"
138140
New-Item -ItemType File -Path $PythonVersionPath -Name "$Architecture.complete" | Out-Null

0 commit comments

Comments
 (0)