Merge pull request #9096 from natemcmaster/installer-fix
Fix .deb and .rpm dependency on the aspnetcore-store package
This commit is contained in:
commit
7f0abdbf3e
4 changed files with 92 additions and 9 deletions
|
@ -73,7 +73,6 @@
|
||||||
<CurrentAspNetCoreRuntimeVersion Condition="'$(AspNetCoreRuntimePackageFlavor)'!='notimestamp'">$(AspNetCoreVersion)-$(AspNetCoreRelease)-$(AspNetCoreRuntimePackageTimestamp)</CurrentAspNetCoreRuntimeVersion>
|
<CurrentAspNetCoreRuntimeVersion Condition="'$(AspNetCoreRuntimePackageFlavor)'!='notimestamp'">$(AspNetCoreVersion)-$(AspNetCoreRelease)-$(AspNetCoreRuntimePackageTimestamp)</CurrentAspNetCoreRuntimeVersion>
|
||||||
|
|
||||||
<AspNetCoreRuntimePackageBrandName>aspnetcore-store</AspNetCoreRuntimePackageBrandName>
|
<AspNetCoreRuntimePackageBrandName>aspnetcore-store</AspNetCoreRuntimePackageBrandName>
|
||||||
<AspNetCoreVersionAndRelease>$(AspNetCoreVersion)-$(AspNetCoreRelease)</AspNetCoreVersionAndRelease>
|
|
||||||
<AspNetCoreRuntimeAzureblobStoresSubfolderName>$(AspNetCoreBranchName)-$(AspNetCoreRuntimePackageTimestamp)</AspNetCoreRuntimeAzureblobStoresSubfolderName>
|
<AspNetCoreRuntimeAzureblobStoresSubfolderName>$(AspNetCoreBranchName)-$(AspNetCoreRuntimePackageTimestamp)</AspNetCoreRuntimeAzureblobStoresSubfolderName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
<HostFxrDebianPackageName>dotnet-hostfxr-$(HostFxrDebianPackageVersion)</HostFxrDebianPackageName>
|
<HostFxrDebianPackageName>dotnet-hostfxr-$(HostFxrDebianPackageVersion)</HostFxrDebianPackageName>
|
||||||
<HostFxrDebianPackageName>$(HostFxrDebianPackageName.ToLower())</HostFxrDebianPackageName>
|
<HostFxrDebianPackageName>$(HostFxrDebianPackageName.ToLower())</HostFxrDebianPackageName>
|
||||||
<HostDebianPackageName>dotnet-host</HostDebianPackageName>
|
<HostDebianPackageName>dotnet-host</HostDebianPackageName>
|
||||||
|
<AspNetCoreRuntimeDebPackageName>$(AspNetCoreRuntimePackageBrandName)-$(CurrentAspNetCoreRuntimeVersion)</AspNetCoreRuntimeDebPackageName>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- Inputs -->
|
<!-- Inputs -->
|
||||||
|
@ -84,7 +85,7 @@
|
||||||
<ReplacementString>$(SharedFxDebianPackageName)</ReplacementString>
|
<ReplacementString>$(SharedFxDebianPackageName)</ReplacementString>
|
||||||
</DebianConfigTokenValues>
|
</DebianConfigTokenValues>
|
||||||
<DebianConfigTokenValues Include="%ASPNETCOREPACKAGESTORE_DEBIAN_PACKAGE_NAME%">
|
<DebianConfigTokenValues Include="%ASPNETCOREPACKAGESTORE_DEBIAN_PACKAGE_NAME%">
|
||||||
<ReplacementString>$(AspNetCoreRuntimePackageName)</ReplacementString>
|
<ReplacementString>$(AspNetCoreRuntimeDebPackageName)</ReplacementString>
|
||||||
</DebianConfigTokenValues>
|
</DebianConfigTokenValues>
|
||||||
<DebianConfigTokenValues Include="%SHARED_FRAMEWORK_DEBIAN_PACKAGE_ADDITIONAL_DEPENDENCY%"
|
<DebianConfigTokenValues Include="%SHARED_FRAMEWORK_DEBIAN_PACKAGE_ADDITIONAL_DEPENDENCY%"
|
||||||
Condition="'$(IncludeAdditionalSharedFrameworks)' == 'true'">
|
Condition="'$(IncludeAdditionalSharedFrameworks)' == 'true'">
|
||||||
|
@ -109,6 +110,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<TestSdkDebTaskEnvironmentVariables Include="PATH=$(DebianInstalledDirectory)$(PathListSeparator)$(PATH)" />
|
<TestSdkDebTaskEnvironmentVariables Include="PATH=$(DebianInstalledDirectory)$(PathListSeparator)$(PATH)" />
|
||||||
|
<TestSdkDebTaskEnvironmentVariables Include="SDK_INSTALLER_FILE=$(SdkInstallerFile)" />
|
||||||
|
|
||||||
<!-- Consumed By Publish -->
|
<!-- Consumed By Publish -->
|
||||||
<GeneratedInstallers Include="$(SdkInstallerFile)" />
|
<GeneratedInstallers Include="$(SdkInstallerFile)" />
|
||||||
|
|
|
@ -50,10 +50,8 @@
|
||||||
<HostFxrRpmPackageName>dotnet-hostfxr-$(HostFxrRpmPackageVersion)</HostFxrRpmPackageName>
|
<HostFxrRpmPackageName>dotnet-hostfxr-$(HostFxrRpmPackageVersion)</HostFxrRpmPackageName>
|
||||||
<HostFxrRpmPackageName>$(HostFxrRpmPackageName.ToLower())</HostFxrRpmPackageName>
|
<HostFxrRpmPackageName>$(HostFxrRpmPackageName.ToLower())</HostFxrRpmPackageName>
|
||||||
<HostRpmPackageName>dotnet-host</HostRpmPackageName>
|
<HostRpmPackageName>dotnet-host</HostRpmPackageName>
|
||||||
<AspNetCoreRuntimePackageName>$(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersionAndRelease)-$(AspNetCoreRuntimePackageTimestamp)</AspNetCoreRuntimePackageName>
|
<AspNetCoreRuntimeRpmPackageName>$(AspNetCoreRuntimePackageBrandName)-$(CurrentAspNetCoreRuntimeVersion)</AspNetCoreRuntimeRpmPackageName>
|
||||||
<AspNetCoreRuntimePackageName Condition="'$(AspNetCoreRuntimePackageFlavor)' == 'notimestamp'">$(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersion)</AspNetCoreRuntimePackageName>
|
<AspNetCoreRuntimeRpmPackageVersion>$(CurrentAspNetCoreRuntimeVersion)</AspNetCoreRuntimeRpmPackageVersion>
|
||||||
<AspNetCoreRuntimePackageName200>$(AspNetCoreRuntimePackageBrandName)-2.0.0</AspNetCoreRuntimePackageName200>
|
|
||||||
<AspNetCoreRuntimePackageName203>$(AspNetCoreRuntimePackageBrandName)-2.0.3</AspNetCoreRuntimePackageName203>
|
|
||||||
<AfterInstallHostScriptTemplateFile>$(ScriptsDir)/$(AfterInstallHostScriptName)</AfterInstallHostScriptTemplateFile>
|
<AfterInstallHostScriptTemplateFile>$(ScriptsDir)/$(AfterInstallHostScriptName)</AfterInstallHostScriptTemplateFile>
|
||||||
<AfterInstallHostScriptDestinationFile>$(RpmLayoutScripts)/$(AfterInstallHostScriptName)</AfterInstallHostScriptDestinationFile>
|
<AfterInstallHostScriptDestinationFile>$(RpmLayoutScripts)/$(AfterInstallHostScriptName)</AfterInstallHostScriptDestinationFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@ -112,10 +110,10 @@
|
||||||
<ReplacementString>$(SharedFrameworkVersion)</ReplacementString>
|
<ReplacementString>$(SharedFrameworkVersion)</ReplacementString>
|
||||||
</SDKTokenValue>
|
</SDKTokenValue>
|
||||||
<SDKTokenValue Include="%ASPNETCOREPACKAGESTORE_RPM_PACKAGE_NAME%">
|
<SDKTokenValue Include="%ASPNETCOREPACKAGESTORE_RPM_PACKAGE_NAME%">
|
||||||
<ReplacementString>$(AspNetCoreRuntimePackageName)</ReplacementString>
|
<ReplacementString>$(AspNetCoreRuntimeRpmPackageName)</ReplacementString>
|
||||||
</SDKTokenValue>
|
</SDKTokenValue>
|
||||||
<SDKTokenValue Include="%ASPNETCOREPACKAGESTORE_RPM_PACKAGE_VERSION%">
|
<SDKTokenValue Include="%ASPNETCOREPACKAGESTORE_RPM_PACKAGE_VERSION%">
|
||||||
<ReplacementString>$(AspNetCoreRuntimePackageVersion)</ReplacementString>
|
<ReplacementString>$(AspNetCoreRuntimeRpmPackageVersion)</ReplacementString>
|
||||||
</SDKTokenValue>
|
</SDKTokenValue>
|
||||||
<SDKTokenValue Include="%SHARED_HOST_RPM_NAME%">
|
<SDKTokenValue Include="%SHARED_HOST_RPM_NAME%">
|
||||||
<ReplacementString>$(SharedFxRpmPackageName)</ReplacementString>
|
<ReplacementString>$(SharedFxRpmPackageName)</ReplacementString>
|
||||||
|
@ -137,6 +135,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<TestSdkRpmTaskEnvironmentVariables Include="PATH=$(RpmInstalledDirectory)$(PathListSeparator)$(PATH)" />
|
<TestSdkRpmTaskEnvironmentVariables Include="PATH=$(RpmInstalledDirectory)$(PathListSeparator)$(PATH)" />
|
||||||
|
<TestSdkRpmTaskEnvironmentVariables Include="SDK_INSTALLER_FILE=$(SdkInstallerFile)" />
|
||||||
<GeneratedInstallers Include="$(SdkInstallerFile)" />
|
<GeneratedInstallers Include="$(SdkInstallerFile)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@ -238,7 +237,7 @@
|
||||||
ToolPath="$(RpmInstalledDirectory)" />
|
ToolPath="$(RpmInstalledDirectory)" />
|
||||||
|
|
||||||
<DotNetTest ProjectPath="$(EndToEndTestProject)"
|
<DotNetTest ProjectPath="$(EndToEndTestProject)"
|
||||||
EnvironmentVariables="@(TestSdkDebTaskEnvironmentVariables)"
|
EnvironmentVariables="@(TestSdkRpmTaskEnvironmentVariables)"
|
||||||
ToolPath="$(RpmInstalledDirectory)" />
|
ToolPath="$(RpmInstalledDirectory)" />
|
||||||
|
|
||||||
<!-- Clean up Packages -->
|
<!-- Clean up Packages -->
|
||||||
|
|
83
test/EndToEnd/GivenDotNetLinuxInstallers.cs
Normal file
83
test/EndToEnd/GivenDotNetLinuxInstallers.cs
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||||
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using Microsoft.DotNet.Tools.Test.Utilities;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace Microsoft.DotNet.Tests.EndToEnd
|
||||||
|
{
|
||||||
|
public class GivenDotNetLinuxInstallers
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void ItHasExpectedDependencies()
|
||||||
|
{
|
||||||
|
var installerFile = Environment.GetEnvironmentVariable("SDK_INSTALLER_FILE");
|
||||||
|
if (string.IsNullOrEmpty(installerFile))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var ext = Path.GetExtension(installerFile);
|
||||||
|
switch (ext)
|
||||||
|
{
|
||||||
|
case ".deb":
|
||||||
|
DebianPackageHasDependencyOnAspNetCoreStoreAndDotnetRuntime(installerFile);
|
||||||
|
return;
|
||||||
|
case ".rpm":
|
||||||
|
RpmPackageHasDependencyOnAspNetCoreStoreAndDotnetRuntime(installerFile);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DebianPackageHasDependencyOnAspNetCoreStoreAndDotnetRuntime(string installerFile)
|
||||||
|
{
|
||||||
|
// Example output:
|
||||||
|
|
||||||
|
// $ dpkg --info dotnet-sdk-2.1.105-ubuntu-x64.deb
|
||||||
|
|
||||||
|
// new debian package, version 2.0.
|
||||||
|
// size 75660448 bytes: control archive=29107 bytes.
|
||||||
|
// 717 bytes, 11 lines control
|
||||||
|
// 123707 bytes, 1004 lines md5sums
|
||||||
|
// 1710 bytes, 28 lines * postinst #!/usr/bin/env
|
||||||
|
// Package: dotnet-sdk-2.1.104
|
||||||
|
// Version: 2.1.104-1
|
||||||
|
// Architecture: amd64
|
||||||
|
// Maintainer: Microsoft <dotnetcore@microsoft.com>
|
||||||
|
// Installed-Size: 201119
|
||||||
|
// Depends: dotnet-runtime-2.0.6, aspnetcore-store-2.0.6
|
||||||
|
// Section: devel
|
||||||
|
// Priority: standard
|
||||||
|
// Homepage: https://dotnet.github.io/core
|
||||||
|
// Description: Microsoft .NET Core SDK - 2.1.104
|
||||||
|
|
||||||
|
new TestCommand("dpkg")
|
||||||
|
.ExecuteWithCapturedOutput($"--info {installerFile}")
|
||||||
|
.Should().Pass()
|
||||||
|
.And.HaveStdOutMatching(@"Depends:.*\s?dotnet-runtime-\d+(\.\d+){2}")
|
||||||
|
.And.HaveStdOutMatching(@"Depends:.*\s?aspnetcore-store-\d+(\.\d+){2}");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RpmPackageHasDependencyOnAspNetCoreStoreAndDotnetRuntime(string installerFile)
|
||||||
|
{
|
||||||
|
// Example output:
|
||||||
|
|
||||||
|
// $ rpm -qpR dotnet-sdk-2.1.105-rhel-x64.rpm
|
||||||
|
|
||||||
|
// dotnet-runtime-2.0.7 >= 2.0.7
|
||||||
|
// aspnetcore-store-2.0.7 >= 2.0.7
|
||||||
|
// /bin/sh
|
||||||
|
// /bin/sh
|
||||||
|
// rpmlib(PayloadFilesHavePrefix) <= 4.0-1
|
||||||
|
// rpmlib(CompressedFileNames) <= 3.0.4-1
|
||||||
|
|
||||||
|
new TestCommand("rpm")
|
||||||
|
.ExecuteWithCapturedOutput($"-qpR {installerFile}")
|
||||||
|
.Should().Pass()
|
||||||
|
.And.HaveStdOutMatching(@"dotnet-runtime-\d+(\.\d+){2} >= \d+(\.\d+){2}")
|
||||||
|
.And.HaveStdOutMatching(@"aspnetcore-store-\d+(\.\d+){2} >= \d+(\.\d+){2}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue