Skip to content

Commit 02f672e

Browse files
committed
Rename dnup to dotnetup in code
1 parent 6dc7af1 commit 02f672e

26 files changed

+109
-109
lines changed

src/Installer/Microsoft.Dotnet.Installation/Internal/DotnetArchiveDownloader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ private static HttpClient CreateDefaultHttpClient()
6868
Timeout = TimeSpan.FromMinutes(10)
6969
};
7070

71-
// Set user-agent to identify dnup in telemetry, including version
71+
// Set user-agent to identify dotnetup in telemetry, including version
7272
var informationalVersion = typeof(DotnetArchiveDownloader).Assembly
7373
.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
74-
string userAgent = informationalVersion == null ? "dotnetup-dotnet-installer" : $"dnup-dotnet-installer/{informationalVersion}";
74+
string userAgent = informationalVersion == null ? "dotnetup-dotnet-installer" : $"dotnetup-dotnet-installer/{informationalVersion}";
7575

7676
client.DefaultRequestHeaders.UserAgent.ParseAdd(userAgent);
7777

src/Installer/Microsoft.Dotnet.Installation/Internal/DotnetArchiveExtractor.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void Prepare()
3636

3737
using var archiveDownloader = new DotnetArchiveDownloader();
3838
var archiveName = $"dotnet-{Guid.NewGuid()}";
39-
_archivePath = Path.Combine(scratchDownloadDirectory, archiveName + DnupUtilities.GetArchiveFileExtensionForPlatform());
39+
_archivePath = Path.Combine(scratchDownloadDirectory, archiveName + DotnetupUtilities.GetArchiveFileExtensionForPlatform());
4040

4141
using (var progressReporter = _progressTarget.CreateProgressReporter())
4242
{
@@ -105,7 +105,7 @@ private MuxerHandlingConfig ConfigureMuxerHandling(IEnumerable<ReleaseVersion> e
105105
ReleaseVersion newRuntimeVersion = _resolvedVersion;
106106
bool shouldUpdateMuxer = existingMuxerVersion is null || newRuntimeVersion.CompareTo(existingMuxerVersion) > 0;
107107

108-
string muxerName = DnupUtilities.GetDotnetExeName();
108+
string muxerName = DotnetupUtilities.GetDotnetExeName();
109109
string muxerTargetPath = Path.Combine(_request.InstallRoot.Path!, muxerName);
110110

111111
return new MuxerHandlingConfig(
@@ -253,7 +253,7 @@ private void HandleMuxerUpdateFromTar(TarEntry entry, string muxerTargetPath)
253253
try
254254
{
255255
// Replace the muxer using the utility that handles locking
256-
DnupUtilities.ForceReplaceFile(tempMuxerPath, muxerTargetPath);
256+
DotnetupUtilities.ForceReplaceFile(tempMuxerPath, muxerTargetPath);
257257
}
258258
finally
259259
{
@@ -335,7 +335,7 @@ private void HandleMuxerUpdateFromZip(ZipArchiveEntry entry, string muxerTargetP
335335
try
336336
{
337337
// Replace the muxer using the utility that handles locking
338-
DnupUtilities.ForceReplaceFile(tempMuxerPath, muxerTargetPath);
338+
DotnetupUtilities.ForceReplaceFile(tempMuxerPath, muxerTargetPath);
339339
}
340340
finally
341341
{

src/Installer/Microsoft.Dotnet.Installation/Internal/DnupUtilities.cs renamed to src/Installer/Microsoft.Dotnet.Installation/Internal/DotnetupUtilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace Microsoft.Dotnet.Installation.Internal;
1111

12-
internal static class DnupUtilities
12+
internal static class DotnetupUtilities
1313
{
1414
public static string ExeSuffix = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : "";
1515

src/Installer/Microsoft.Dotnet.Installation/Internal/ReleaseManifest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ public ProductCollection GetReleasesIndex()
112112
/// </summary>
113113
private static ReleaseFile? FindMatchingFile(ReleaseComponent release, DotnetInstallRequest installRequest, ReleaseVersion resolvedVersion)
114114
{
115-
var rid = DnupUtilities.GetRuntimeIdentifier(installRequest.InstallRoot.Architecture);
116-
var fileExtension = DnupUtilities.GetArchiveFileExtensionForPlatform();
115+
var rid = DotnetupUtilities.GetRuntimeIdentifier(installRequest.InstallRoot.Architecture);
116+
var fileExtension = DotnetupUtilities.GetArchiveFileExtensionForPlatform();
117117

118118
var matchingFiles = release.Files
119119
.Where(f => f.Rid == rid) // TODO: Do we support musl here?

src/Installer/dotnetup/ArchiveInstallationValidator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public bool Validate(DotnetInstall install)
3232
return false;
3333
}
3434

35-
string dotnetMuxerPath = Path.Combine(installRoot, DnupUtilities.GetDotnetExeName());
35+
string dotnetMuxerPath = Path.Combine(installRoot, DotnetupUtilities.GetDotnetExeName());
3636
if (!File.Exists(dotnetMuxerPath))
3737
{
3838
return false;
@@ -82,7 +82,7 @@ private bool ValidateWithHostFxr(string installRoot, ReleaseVersion resolvedVers
8282
string expectedPath = Path.Combine(installRoot, "sdk", resolvedVersion.ToString());
8383
return environmentInfo.SdkInfo.Any(sdk =>
8484
string.Equals(sdk.Version.ToString(), resolvedVersion.ToString(), StringComparison.OrdinalIgnoreCase) &&
85-
DnupUtilities.PathsEqual(sdk.Path, expectedPath));
85+
DotnetupUtilities.PathsEqual(sdk.Path, expectedPath));
8686
}
8787

8888
if (!RuntimeMonikerByComponent.TryGetValue(component, out string? runtimeMoniker))
@@ -94,7 +94,7 @@ private bool ValidateWithHostFxr(string installRoot, ReleaseVersion resolvedVers
9494
return environmentInfo.RuntimeInfo.Any(runtime =>
9595
string.Equals(runtime.Name, runtimeMoniker, StringComparison.OrdinalIgnoreCase) &&
9696
string.Equals(runtime.Version.ToString(), resolvedVersion.ToString(), StringComparison.OrdinalIgnoreCase) &&
97-
DnupUtilities.PathsEqual(runtime.Path, expectedRuntimePath));
97+
DotnetupUtilities.PathsEqual(runtime.Path, expectedRuntimePath));
9898
}
9999
catch
100100
{

src/Installer/dotnetup/Commands/Sdk/Install/SdkInstallCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public override int Execute()
3939
installPathFromGlobalJson = globalJsonInfo.SdkPath;
4040

4141
if (installPathFromGlobalJson is not null && _installPath is not null &&
42-
!DnupUtilities.PathsEqual(installPathFromGlobalJson, _installPath))
42+
!DotnetupUtilities.PathsEqual(installPathFromGlobalJson, _installPath))
4343
{
4444
// TODO: Add parameter to override error
4545
Console.Error.WriteLine($"Error: The install path specified in global.json ({installPathFromGlobalJson}) does not match the install path provided ({_installPath}).");
@@ -140,7 +140,7 @@ public override int Execute()
140140
}
141141
else if (currentDotnetInstallRoot.InstallType == InstallType.User)
142142
{
143-
if (DnupUtilities.PathsEqual(resolvedInstallPath, currentDotnetInstallRoot.Path))
143+
if (DotnetupUtilities.PathsEqual(resolvedInstallPath, currentDotnetInstallRoot.Path))
144144
{
145145
// No need to prompt here, the default install is already set up.
146146
}

src/Installer/dotnetup/Commands/Sdk/Install/SdkInstallCommandParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static Command GetSdkInstallCommand()
5252
return SdkInstallCommand;
5353
}
5454

55-
// Trying to use the same command object for both "dnup install" and "dnup sdk install" causes the following exception:
55+
// Trying to use the same command object for both "dotnetup install" and "dotnetup sdk install" causes the following exception:
5656
// System.InvalidOperationException: Command install has more than one child named "channel".
5757
// So we create a separate instance for each case
5858
private static readonly Command RootInstallCommand = ConstructCommand();

src/Installer/dotnetup/Commands/Sdk/Update/SdkUpdateCommandParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public static Command GetSdkUpdateCommand()
3131
return SdkUpdateCommand;
3232
}
3333

34-
// Trying to use the same command object for both "dnup udpate" and "dnup sdk update" causes an InvalidOperationException
34+
// Trying to use the same command object for both "dotnetup udpate" and "dotnetup sdk update" causes an InvalidOperationException
3535
// So we create a separate instance for each case
3636
private static readonly Command RootUpdateCommand = ConstructCommand();
3737

src/Installer/dotnetup/Constants.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace Microsoft.DotNet.Tools.Bootstrapper
55
{
66
/// <summary>
7-
/// Shared constants for the dnup application.
7+
/// Shared constants for the dotnetup application.
88
/// </summary>
99
internal static class Constants
1010
{
@@ -17,7 +17,7 @@ public static class MutexNames
1717
/// Mutex used during the final installation phase to protect the manifest file and extracting folder(s).
1818
/// Mutex names MUST be valid file names on Unix. https://learn.microsoft.com/dotnet/api/system.threading.mutex.openexisting?view=net-9.0
1919
/// </summary>
20-
public const string ModifyInstallationStates = "Global\\DnupFinalize";
20+
public const string ModifyInstallationStates = "Global\\DotnetupFinalize";
2121
}
2222
}
2323
}

src/Installer/dotnetup/DotnetInstallManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public DotnetInstallManager(IEnvironmentProvider? environmentProvider = null)
4040

4141
var installRoot = new DotnetInstallRoot(installDir, InstallerUtilities.GetDefaultInstallArchitecture());
4242

43-
bool isSetAsDotnetRoot = DnupUtilities.PathsEqual(dotnetRoot, installDir);
43+
bool isSetAsDotnetRoot = DotnetupUtilities.PathsEqual(dotnetRoot, installDir);
4444

4545
return new(installRoot, isAdminInstall ? InstallType.Admin : InstallType.User, IsOnPath: true, isSetAsDotnetRoot);
4646
}

0 commit comments

Comments
 (0)