Merge branch '3007.x' of github.com:saltstack/salt into hotfix/merge-forward-into-3007.x

This commit is contained in:
Pedro Algarvio 2024-03-27 18:47:24 +00:00
commit 15f9f585f0
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF
20 changed files with 129 additions and 65 deletions

1
changelog/66260.fixed.md Normal file
View file

@ -0,0 +1 @@
Fixed `aptpkg.remove` "unable to locate package" error for non-existent package

View file

@ -250,11 +250,9 @@ IMCAC - Immediate Custom Action - It's immediate
<DirectoryRef Id="TARGETDIR"> <DirectoryRef Id="TARGETDIR">
<!-- Visual C++ runtimes depend on the target platform --> <!-- Visual C++ runtimes depend on the target platform -->
<?if $(var.WIN64)=yes ?> <?if $(var.WIN64)=yes ?>
<Merge Id="MSM_VC120_CRT" SourceFile="$(var.WEBCACHE_DIR)\Microsoft_VC120_CRT_x64.msm" DiskId="1" Language="0" /> <Merge Id="MSM_VC143_CRT" SourceFile="$(var.WEBCACHE_DIR)\Microsoft_VC143_CRT_x64.msm" DiskId="1" Language="0" />
<Merge Id="MSM_VC140_CRT" SourceFile="$(var.WEBCACHE_DIR)\Microsoft_VC140_CRT_x64.msm" DiskId="1" Language="0" />
<?else ?> <?else ?>
<Merge Id="MSM_VC120_CRT" SourceFile="$(var.WEBCACHE_DIR)\Microsoft_VC120_CRT_x86.msm" DiskId="1" Language="0" /> <Merge Id="MSM_VC143_CRT" SourceFile="$(var.WEBCACHE_DIR)\Microsoft_VC143_CRT_x86.msm" DiskId="1" Language="0" />
<Merge Id="MSM_VC140_CRT" SourceFile="$(var.WEBCACHE_DIR)\Microsoft_VC140_CRT_x86.msm" DiskId="1" Language="0" />
<?endif ?> <?endif ?>
</DirectoryRef> </DirectoryRef>
<!-- Add INSTALLDIR to the system Path --> <!-- Add INSTALLDIR to the system Path -->
@ -269,8 +267,7 @@ IMCAC - Immediate Custom Action - It's immediate
<!-- Leaving registry keys would mean the product is still installed --> <!-- Leaving registry keys would mean the product is still installed -->
<Feature Id="ProductFeature" Title="Minion" Level="1"> <Feature Id="ProductFeature" Title="Minion" Level="1">
<ComponentGroupRef Id="ProductComponents" /> <ComponentGroupRef Id="ProductComponents" />
<Feature Id="VC120" Title="VC++ 2013" AllowAdvertise="no" Display="hidden"><MergeRef Id="MSM_VC120_CRT" /></Feature> <Feature Id="VC143" Title="VC++ 2022" AllowAdvertise="no" Display="hidden"><MergeRef Id="MSM_VC143_CRT" /></Feature>
<Feature Id="VC140" Title="VC++ 2015" AllowAdvertise="no" Display="hidden"><MergeRef Id="MSM_VC140_CRT" /></Feature>
</Feature> </Feature>
<!-- Get the config file template from the msi store only if no config is present --> <!-- Get the config file template from the msi store only if no config is present -->

View file

@ -10,10 +10,8 @@ You need
- .Net 3.5 SDK (for WiX)<sup>*</sup> - .Net 3.5 SDK (for WiX)<sup>*</sup>
- [Wix 3](http://wixtoolset.org/releases/)<sup>**</sup> - [Wix 3](http://wixtoolset.org/releases/)<sup>**</sup>
- [Build tools 2015](https://www.microsoft.com/en-US/download/confirmation.aspx?id=48159)<sup>**</sup> - [Build tools 2015](https://www.microsoft.com/en-US/download/confirmation.aspx?id=48159)<sup>**</sup>
- Microsoft_VC140_CRT_x64.msm from Visual Studio 2015<sup>**</sup> - Microsoft_VC143_CRT_x64.msm from Visual Studio 2015<sup>**</sup>
- Microsoft_VC140_CRT_x86.msm from Visual Studio 2015<sup>**</sup> - Microsoft_VC143_CRT_x86.msm from Visual Studio 2015<sup>**</sup>
- Microsoft_VC120_CRT_x64.msm from Visual Studio 2013<sup>**</sup>
- Microsoft_VC120_CRT_x86.msm from Visual Studio 2013<sup>**</sup>
Notes: Notes:
- <sup>*</sup> `build.cmd` will open `optionalfeatures` if necessary. - <sup>*</sup> `build.cmd` will open `optionalfeatures` if necessary.

View file

@ -51,11 +51,14 @@ function VerifyOrDownload ($local_file, $URL, $SHA256) {
$filename = Split-Path $local_file -leaf $filename = Split-Path $local_file -leaf
if ( Test-Path -Path $local_file ) { if ( Test-Path -Path $local_file ) {
Write-Host "Verifying hash for $filename`: " -NoNewline Write-Host "Verifying hash for $filename`: " -NoNewline
if ( (Get-FileHash $local_file).Hash -eq $SHA256 ) { $hash = (Get-FileHash $local_file).Hash
if ( $hash -eq $SHA256 ) {
Write-Result "Verified" -ForegroundColor Green Write-Result "Verified" -ForegroundColor Green
return return
} else { } else {
Write-Result "Failed Hash" -ForegroundColor Red Write-Result "Failed Hash" -ForegroundColor Red
Write-Host "Found Hash: $hash"
Write-Host "Expected Hash: $SHA256"
Remove-Item -Path $local_file -Force Remove-Item -Path $local_file -Force
} }
} }
@ -161,10 +164,8 @@ if ( ! "$env:WIX" ) {
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
$RUNTIMES = @( $RUNTIMES = @(
("Microsoft_VC120_CRT_x64.msm", "64", "15FD10A495287505184B8913DF8D6A9CA461F44F78BC74115A0C14A5EDD1C9A7"), ("Microsoft_VC143_CRT_x64.msm", "64", "F209B8906063A79B0DFFBB55D3C20AC0A676252DD4F5377CFCD148C409C859EC"),
("Microsoft_VC120_CRT_x86.msm", "32", "26340B393F52888B908AC3E67B935A80D390E1728A31FF38EBCEC01117EB2579"), ("Microsoft_VC143_CRT_x86.msm", "32", "B187BD73C7DC0BA353C5D3A6D9D4E63EF72435F8E68273466F30E5496C1A86F7")
("Microsoft_VC140_CRT_x64.msm", "64", "E1344D5943FB2BBB7A56470ED0B7E2B9B212CD9210D3CC6FA82BC3DA8F11EDA8"),
("Microsoft_VC140_CRT_x86.msm", "32", "0D36CFE6E9ABD7F530DBAA4A83841CDBEF9B2ADCB625614AF18208FDCD6B92A4")
) )
$RUNTIMES | ForEach-Object { $RUNTIMES | ForEach-Object {
$name, $arch, $hash = $_ $name, $arch, $hash = $_

View file

@ -602,9 +602,9 @@ Section -install_ucrt
SectionEnd SectionEnd
# Check and install Visual C++ redist 2013 packages # Check and install Visual C++ redist 2022 packages
# Hidden section (-) to install VCRedist # Hidden section (-) to install VCRedist
Section -install_vcredist_2013 Section -install_vcredist_2022
Var /GLOBAL VcRedistName Var /GLOBAL VcRedistName
Var /GLOBAL VcRedistReg Var /GLOBAL VcRedistReg
@ -613,11 +613,11 @@ Section -install_vcredist_2013
# Use RunningX64 here to get the Architecture for the system running the # Use RunningX64 here to get the Architecture for the system running the
# installer. # installer.
${If} ${RunningX64} ${If} ${RunningX64}
StrCpy $VcRedistName "vcredist_x64_2013" StrCpy $VcRedistName "vcredist_x64_2022"
StrCpy $VcRedistReg "SOFTWARE\WOW6432Node\Microsoft\VisualStudio\12.0\VC\Runtimes\x64" StrCpy $VcRedistReg "SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\x64"
${Else} ${Else}
StrCpy $VcRedistName "vcredist_x86_2013" StrCpy $VcRedistName "vcredist_x86_2022"
StrCpy $VcRedistReg "SOFTWARE\Microsoft\VisualStudio\12.0\VC\Runtimes\x86" StrCpy $VcRedistReg "SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x86"
${EndIf} ${EndIf}
# Detecting VCRedist Installation # Detecting VCRedist Installation

View file

@ -70,10 +70,8 @@ $directories | ForEach-Object {
# Create binaries # Create binaries
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
$prereq_files = "vcredist_x86_2013.exe", $prereq_files = "vcredist_x86_2022.exe",
"vcredist_x64_2013.exe", "vcredist_x64_2022.exe",
"ucrt_x86.zip",
"ucrt_x64.zip"
$prereq_files | ForEach-Object { $prereq_files | ForEach-Object {
Write-Host "Creating $_`: " -NoNewline Write-Host "Creating $_`: " -NoNewline
Set-Content -Path "$PREREQS_DIR\$_" -Value "binary" Set-Content -Path "$PREREQS_DIR\$_" -Value "binary"

View file

@ -183,21 +183,10 @@ $scripts | ForEach-Object {
} }
} }
# Copy VCRedist 2013 to the prereqs directory # Copy VCRedist 2022 to the prereqs directory
New-Item -Path $PREREQ_DIR -ItemType Directory | Out-Null New-Item -Path $PREREQ_DIR -ItemType Directory | Out-Null
Write-Host "Copying VCRedist 2013 $ARCH_X to prereqs: " -NoNewline Write-Host "Copying VCRedist 2022 $ARCH_X to prereqs: " -NoNewline
$file = "vcredist_$ARCH_X`_2013.exe" $file = "vcredist_$ARCH_X`_2022.exe"
Invoke-WebRequest -Uri "$SALT_DEP_URL/$file" -OutFile "$PREREQ_DIR\$file"
if ( Test-Path -Path "$PREREQ_DIR\$file" ) {
Write-Result "Success" -ForegroundColor Green
} else {
Write-Result "Failed" -ForegroundColor Red
exit 1
}
# Copy Universal C Runtimes to the prereqs directory
Write-Host "Copying Universal C Runtimes $ARCH_X to prereqs: " -NoNewline
$file = "ucrt_$ARCH_X.zip"
Invoke-WebRequest -Uri "$SALT_DEP_URL/$file" -OutFile "$PREREQ_DIR\$file" Invoke-WebRequest -Uri "$SALT_DEP_URL/$file" -OutFile "$PREREQ_DIR\$file"
if ( Test-Path -Path "$PREREQ_DIR\$file" ) { if ( Test-Path -Path "$PREREQ_DIR\$file" ) {
Write-Result "Success" -ForegroundColor Green Write-Result "Success" -ForegroundColor Green

View file

@ -30,10 +30,11 @@ cryptography>=42.0.0
rpm-vercmp; sys_platform == 'linux' rpm-vercmp; sys_platform == 'linux'
# From old windows.txt requirements file # From old windows.txt requirements file
pywin32>=305; sys_platform == 'win32' gitpython>=3.1.37; sys_platform == 'win32'
wmi>=1.5.1; sys_platform == 'win32' lxml>=4.6.3; sys_platform == 'win32'
pythonnet>=3.0.1; sys_platform == 'win32'
pymssql>=2.2.1; sys_platform == 'win32' pymssql>=2.2.1; sys_platform == 'win32'
pymysql>=1.0.2; sys_platform == 'win32' pymysql>=1.0.2; sys_platform == 'win32'
lxml>=4.6.3; sys_platform == 'win32' pythonnet>=3.0.1; sys_platform == 'win32'
pywin32>=305; sys_platform == 'win32'
wmi>=1.5.1; sys_platform == 'win32'
xmltodict>=0.13.0; sys_platform == 'win32' xmltodict>=0.13.0; sys_platform == 'win32'

View file

@ -138,9 +138,14 @@ genshi==0.7.7
geomet==0.2.1.post1 geomet==0.2.1.post1
# via cassandra-driver # via cassandra-driver
gitdb==4.0.11 gitdb==4.0.11
# via gitpython # via
gitpython==3.1.41 # -c requirements/static/ci/../pkg/py3.10/windows.txt
# via -r requirements/static/ci/common.in # gitpython
gitpython==3.1.42 ; sys_platform == "win32"
# via
# -c requirements/static/ci/../pkg/py3.10/windows.txt
# -r requirements/base.txt
# -r requirements/static/ci/common.in
google-auth==2.27.0 google-auth==2.27.0
# via kubernetes # via kubernetes
idna==3.4 idna==3.4
@ -439,7 +444,9 @@ six==1.15.0
# textfsm # textfsm
# websocket-client # websocket-client
smmap==5.0.1 smmap==5.0.1
# via gitdb # via
# -c requirements/static/ci/../pkg/py3.10/windows.txt
# gitdb
sqlparse==0.4.4 sqlparse==0.4.4
# via -r requirements/static/ci/common.in # via -r requirements/static/ci/common.in
strict-rfc3339==0.7 strict-rfc3339==0.7

View file

@ -135,9 +135,14 @@ genshi==0.7.7
geomet==0.2.1.post1 geomet==0.2.1.post1
# via cassandra-driver # via cassandra-driver
gitdb==4.0.11 gitdb==4.0.11
# via gitpython # via
gitpython==3.1.41 # -c requirements/static/ci/../pkg/py3.11/windows.txt
# via -r requirements/static/ci/common.in # gitpython
gitpython==3.1.42 ; sys_platform == "win32"
# via
# -c requirements/static/ci/../pkg/py3.11/windows.txt
# -r requirements/base.txt
# -r requirements/static/ci/common.in
google-auth==2.27.0 google-auth==2.27.0
# via kubernetes # via kubernetes
idna==3.4 idna==3.4
@ -440,7 +445,9 @@ six==1.15.0
# textfsm # textfsm
# websocket-client # websocket-client
smmap==5.0.1 smmap==5.0.1
# via gitdb # via
# -c requirements/static/ci/../pkg/py3.11/windows.txt
# gitdb
sqlparse==0.4.4 sqlparse==0.4.4
# via -r requirements/static/ci/common.in # via -r requirements/static/ci/common.in
strict-rfc3339==0.7 strict-rfc3339==0.7

View file

@ -135,9 +135,14 @@ genshi==0.7.7
geomet==0.2.1.post1 geomet==0.2.1.post1
# via cassandra-driver # via cassandra-driver
gitdb==4.0.11 gitdb==4.0.11
# via gitpython # via
gitpython==3.1.41 # -c requirements/static/ci/../pkg/py3.12/windows.txt
# via -r requirements/static/ci/common.in # gitpython
gitpython==3.1.42 ; sys_platform == "win32"
# via
# -c requirements/static/ci/../pkg/py3.12/windows.txt
# -r requirements/base.txt
# -r requirements/static/ci/common.in
google-auth==2.27.0 google-auth==2.27.0
# via kubernetes # via kubernetes
idna==3.4 idna==3.4
@ -440,7 +445,9 @@ six==1.15.0
# textfsm # textfsm
# websocket-client # websocket-client
smmap==5.0.1 smmap==5.0.1
# via gitdb # via
# -c requirements/static/ci/../pkg/py3.12/windows.txt
# gitdb
sqlparse==0.4.4 sqlparse==0.4.4
# via -r requirements/static/ci/common.in # via -r requirements/static/ci/common.in
strict-rfc3339==0.7 strict-rfc3339==0.7

View file

@ -138,9 +138,14 @@ genshi==0.7.7
geomet==0.2.1.post1 geomet==0.2.1.post1
# via cassandra-driver # via cassandra-driver
gitdb==4.0.11 gitdb==4.0.11
# via gitpython # via
gitpython==3.1.41 # -c requirements/static/ci/../pkg/py3.8/windows.txt
# via -r requirements/static/ci/common.in # gitpython
gitpython==3.1.42 ; sys_platform == "win32"
# via
# -c requirements/static/ci/../pkg/py3.8/windows.txt
# -r requirements/base.txt
# -r requirements/static/ci/common.in
google-auth==2.27.0 google-auth==2.27.0
# via kubernetes # via kubernetes
idna==3.4 idna==3.4
@ -444,7 +449,9 @@ six==1.15.0
# textfsm # textfsm
# websocket-client # websocket-client
smmap==5.0.1 smmap==5.0.1
# via gitdb # via
# -c requirements/static/ci/../pkg/py3.8/windows.txt
# gitdb
sqlparse==0.4.4 sqlparse==0.4.4
# via -r requirements/static/ci/common.in # via -r requirements/static/ci/common.in
strict-rfc3339==0.7 strict-rfc3339==0.7

View file

@ -138,9 +138,14 @@ genshi==0.7.7
geomet==0.2.1.post1 geomet==0.2.1.post1
# via cassandra-driver # via cassandra-driver
gitdb==4.0.11 gitdb==4.0.11
# via gitpython # via
gitpython==3.1.41 # -c requirements/static/ci/../pkg/py3.9/windows.txt
# via -r requirements/static/ci/common.in # gitpython
gitpython==3.1.42 ; sys_platform == "win32"
# via
# -c requirements/static/ci/../pkg/py3.9/windows.txt
# -r requirements/base.txt
# -r requirements/static/ci/common.in
google-auth==2.27.0 google-auth==2.27.0
# via kubernetes # via kubernetes
idna==3.4 idna==3.4
@ -440,7 +445,9 @@ six==1.15.0
# textfsm # textfsm
# websocket-client # websocket-client
smmap==5.0.1 smmap==5.0.1
# via gitdb # via
# -c requirements/static/ci/../pkg/py3.9/windows.txt
# gitdb
sqlparse==0.4.4 sqlparse==0.4.4
# via -r requirements/static/ci/common.in # via -r requirements/static/ci/common.in
strict-rfc3339==0.7 strict-rfc3339==0.7

View file

@ -40,6 +40,10 @@ frozenlist==1.4.1
# via # via
# aiohttp # aiohttp
# aiosignal # aiosignal
gitdb==4.0.11
# via gitpython
gitpython==3.1.42 ; sys_platform == "win32"
# via -r requirements/base.txt
idna==3.4 idna==3.4
# via # via
# requests # requests
@ -125,6 +129,8 @@ setproctitle==1.3.2
# via -r requirements/base.txt # via -r requirements/base.txt
six==1.15.0 six==1.15.0
# via python-dateutil # via python-dateutil
smmap==5.0.1
# via gitdb
tempora==5.3.0 tempora==5.3.0
# via portend # via portend
timelib==0.3.0 timelib==0.3.0

View file

@ -40,6 +40,10 @@ frozenlist==1.4.1
# via # via
# aiohttp # aiohttp
# aiosignal # aiosignal
gitdb==4.0.11
# via gitpython
gitpython==3.1.42 ; sys_platform == "win32"
# via -r requirements/base.txt
idna==3.4 idna==3.4
# via # via
# requests # requests
@ -127,6 +131,8 @@ setproctitle==1.3.2
# via -r requirements/base.txt # via -r requirements/base.txt
six==1.15.0 six==1.15.0
# via python-dateutil # via python-dateutil
smmap==5.0.1
# via gitdb
tempora==5.3.0 tempora==5.3.0
# via portend # via portend
timelib==0.3.0 timelib==0.3.0

View file

@ -40,6 +40,10 @@ frozenlist==1.4.1
# via # via
# aiohttp # aiohttp
# aiosignal # aiosignal
gitdb==4.0.11
# via gitpython
gitpython==3.1.42 ; sys_platform == "win32"
# via -r requirements/base.txt
idna==3.4 idna==3.4
# via # via
# requests # requests
@ -127,6 +131,8 @@ setproctitle==1.3.2
# via -r requirements/base.txt # via -r requirements/base.txt
six==1.15.0 six==1.15.0
# via python-dateutil # via python-dateutil
smmap==5.0.1
# via gitdb
tempora==5.3.0 tempora==5.3.0
# via portend # via portend
timelib==0.3.0 timelib==0.3.0

View file

@ -40,6 +40,10 @@ frozenlist==1.4.1
# via # via
# aiohttp # aiohttp
# aiosignal # aiosignal
gitdb==4.0.11
# via gitpython
gitpython==3.1.42 ; sys_platform == "win32"
# via -r requirements/base.txt
idna==3.4 idna==3.4
# via # via
# requests # requests
@ -128,6 +132,8 @@ setproctitle==1.3.2
# via -r requirements/base.txt # via -r requirements/base.txt
six==1.15.0 six==1.15.0
# via python-dateutil # via python-dateutil
smmap==5.0.1
# via gitdb
tempora==5.3.0 tempora==5.3.0
# via portend # via portend
timelib==0.3.0 timelib==0.3.0

View file

@ -40,6 +40,10 @@ frozenlist==1.4.1
# via # via
# aiohttp # aiohttp
# aiosignal # aiosignal
gitdb==4.0.11
# via gitpython
gitpython==3.1.42 ; sys_platform == "win32"
# via -r requirements/base.txt
idna==3.4 idna==3.4
# via # via
# requests # requests
@ -126,6 +130,8 @@ setproctitle==1.3.2
# via -r requirements/base.txt # via -r requirements/base.txt
six==1.15.0 six==1.15.0
# via python-dateutil # via python-dateutil
smmap==5.0.1
# via gitdb
tempora==5.3.0 tempora==5.3.0
# via portend # via portend
timelib==0.3.0 timelib==0.3.0

View file

@ -1071,9 +1071,17 @@ def _uninstall(action="remove", name=None, pkgs=None, **kwargs):
old = list_pkgs() old = list_pkgs()
old_removed = list_pkgs(removed=True) old_removed = list_pkgs(removed=True)
targets = salt.utils.pkg.match_wildcard(old, pkg_params) targets = [
_pkg for _pkg in salt.utils.pkg.match_wildcard(old, pkg_params) if _pkg in old
]
if action == "purge": if action == "purge":
targets.update(salt.utils.pkg.match_wildcard(old_removed, pkg_params)) targets.extend(
[
_pkg
for _pkg in salt.utils.pkg.match_wildcard(old_removed, pkg_params)
if _pkg in old_removed
]
)
if not targets: if not targets:
return {} return {}
cmd = ["apt-get", "-q", "-y", action] cmd = ["apt-get", "-q", "-y", action]

View file

@ -398,3 +398,9 @@ def test_aptpkg_remove_wildcard():
assert ret["nginx-light"]["old"] assert ret["nginx-light"]["old"]
assert not ret["nginx-doc"]["new"] assert not ret["nginx-doc"]["new"]
assert ret["nginx-doc"]["old"] assert ret["nginx-doc"]["old"]
@pytest.mark.skip_if_not_root
def test_aptpkg_remove_unknown_package():
ret = aptpkg.remove(name="thispackageistotallynotthere")
assert not ret