Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikola Milosavljevic <nikolam@microsoft.com>2021-06-06 19:08:30 +0300
committerGitHub <noreply@github.com>2021-06-06 19:08:30 +0300
commit004dd56e8c8d61907b9e8266b8bad65f926ac36d (patch)
treecf250757b2041663879445325254e5e8e2030b1a /src/installer/pkg
parenta822d3909b90139b642b143e889505ab7157b10c (diff)
Create dotnet symlink during RPM install (#53705)
Diffstat (limited to 'src/installer/pkg')
-rw-r--r--src/installer/pkg/sfx/installers/dotnet-host.proj5
-rw-r--r--src/installer/pkg/sfx/installers/rpm_scripts/host/after_install.sh7
-rw-r--r--src/installer/pkg/sfx/installers/rpm_scripts/host/after_remove.sh6
3 files changed, 18 insertions, 0 deletions
diff --git a/src/installer/pkg/sfx/installers/dotnet-host.proj b/src/installer/pkg/sfx/installers/dotnet-host.proj
index 6f645a73a52..0963a7b89d8 100644
--- a/src/installer/pkg/sfx/installers/dotnet-host.proj
+++ b/src/installer/pkg/sfx/installers/dotnet-host.proj
@@ -17,6 +17,9 @@
<IncludeVersionInMacOSComponentName>false</IncludeVersionInMacOSComponentName>
<MacOSScriptsDirectory>osx_scripts/host</MacOSScriptsDirectory>
<MacOSPackageDescription>The .NET Shared Host.</MacOSPackageDescription>
+ <RpmScriptsDirectory>$(MSBuildThisFileDirectory)rpm_scripts/host</RpmScriptsDirectory>
+ <RpmAfterInstallScript>$(RpmScriptsDirectory)/after_install.sh</RpmAfterInstallScript>
+ <RpmAfterRemoveScript>$(RpmScriptsDirectory)/after_remove.sh</RpmAfterRemoveScript>
</PropertyGroup>
<ItemGroup>
@@ -68,6 +71,8 @@
<ItemGroup>
<DebJsonProperty Include="symlinks" Object="{ &quot;dotnet&quot;: &quot;/usr/bin/dotnet&quot; }" />
<RpmJsonProperty Include="directories" Object="[ &quot;/usr/share/dotnet&quot;, &quot;/usr/share/doc/dotnet-host&quot; ]" />
+ <RpmJsonProperty Include="after_install_source" Object="&quot;$(RpmAfterInstallScript)&quot;" />
+ <RpmJsonProperty Include="after_remove_source" Object="&quot;$(RpmAfterRemoveScript)&quot;" />
<PackageConflictsProperty Include="package_conflicts" Object="[ &quot;dotnet&quot;, &quot;dotnet-nightly&quot; ]" />
<DebJsonProperty Include="@(PackageConflictsProperty)" />
<RpmJsonProperty Include="@(PackageConflictsProperty)" />
diff --git a/src/installer/pkg/sfx/installers/rpm_scripts/host/after_install.sh b/src/installer/pkg/sfx/installers/rpm_scripts/host/after_install.sh
new file mode 100644
index 00000000000..2a588366faa
--- /dev/null
+++ b/src/installer/pkg/sfx/installers/rpm_scripts/host/after_install.sh
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+if [[ -L /usr/local/bin/dotnet ]]; then
+ rm /usr/local/bin/dotnet
+fi
+ln -s /usr/share/dotnet/dotnet /usr/local/bin/dotnet
+
diff --git a/src/installer/pkg/sfx/installers/rpm_scripts/host/after_remove.sh b/src/installer/pkg/sfx/installers/rpm_scripts/host/after_remove.sh
new file mode 100644
index 00000000000..fa151c4809b
--- /dev/null
+++ b/src/installer/pkg/sfx/installers/rpm_scripts/host/after_remove.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+if [[ -L /usr/local/bin/dotnet ]]; then
+ rm /usr/local/bin/dotnet && \
+fi
+