Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"configurations": {
"Linux": {
"buildOptions": {
"define": ["LINUX"]
"define": ["UNIX"]
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"configurations": {
"Linux": {
"buildOptions": {
"define": ["LINUX"]
"define": ["UNIX"]
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"configurations": {
"Linux": {
"buildOptions": {
"define": ["LINUX"]
"define": ["UNIX"]
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.PackageManagement.MsiProvider/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"configurations": {
"Linux": {
"buildOptions": {
"define": ["LINUX"]
"define": ["UNIX"]
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.PackageManagement.MsuProvider/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"configurations": {
"Linux": {
"buildOptions": {
"define": ["LINUX"]
"define": ["UNIX"]
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ internal string Destination {
// or $env:programfiles\NuGet\Packages\ if you are an admin.
try
{
#if LINUX
#if UNIX
// there is only 1 installation location by default for linux ("HOME/.local/share/powershell/PackageManagement/NuGet/Packages")
string basePath = CurrentUserDefaultInstallLocation;
#else
Expand Down Expand Up @@ -220,7 +220,7 @@ internal string CurrentUserDefaultInstallLocation
get
{
#if CORECLR
#if LINUX
#if UNIX
return Path.Combine(Path.GetDirectoryName(Platform.SelectProductNameForDirectory(Platform.XDG_Type.DATA)), "PackageManagement", "NuGet", "Packages");
#else
return Path.Combine(Environment.GetEnvironmentVariable("LocalAppData"), "PackageManagement", "NuGet", "Packages");
Expand All @@ -237,7 +237,7 @@ internal string AllUserDefaultInstallLocation
get
{
#if CORECLR
#if LINUX
#if UNIX
return Path.Combine(Path.GetDirectoryName(Platform.SelectProductNameForDirectory(Platform.XDG_Type.DATA)), "PackageManagement", "NuGet", "Packages");
#else
return Path.Combine(Environment.GetEnvironmentVariable("ProgramFiles"), "NuGet", "Packages");
Expand Down Expand Up @@ -1302,7 +1302,7 @@ private string ConfigurationFileLocation {
}

} else {
#if LINUX
#if UNIX
var appdataFolder = Path.GetDirectoryName(Platform.SelectProductNameForDirectory(Platform.XDG_Type.CONFIG));
#else
var appdataFolder = Environment.GetEnvironmentVariable("appdata");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"configurations": {
"Linux": {
"buildOptions": {
"define": ["LINUX"]
"define": ["UNIX"]
}
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !LINUX
#if !UNIX

// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !LINUX
#if !UNIX

//
// Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !LINUX
#if !UNIX

//
// Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !LINUX
#if !UNIX

using System;
using System.Collections.Generic;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !LINUX
#if !UNIX

//
// Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !LINUX
#if !UNIX

//
// Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !LINUX
#if !UNIX

//
// Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !LINUX
#if !UNIX

//
// Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !LINUX
#if !UNIX

//
// Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !LINUX
#if !UNIX

//
// Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !LINUX
#if !UNIX

//
// Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !LINUX
#if !UNIX

//
// Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !LINUX
#if !UNIX

namespace Microsoft.PackageManagement.PackageSourceListProvider
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"configurations": {
"Linux": {
"buildOptions": {
"define": [ "LINUX" ]
"define": [ "UNIX" ]
}
}
},
Expand Down Expand Up @@ -68,4 +68,4 @@
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public IDictionary<string, List<string>> Features {
/// <param name="providerPath"></param>
public void SetSwidTag(string providerPath)
{
#if !LINUX
#if !UNIX
if (!string.IsNullOrWhiteSpace(providerPath))
{
// check whether there is swidtag attached to the provider path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public bool IsSignedAndTrusted(string filename, IRequest request) {
Debug(request, "Calling 'ProviderService::IsSignedAndTrusted, '{0}'", filename);

// we are not using this function anywhere
#if !LINUX
#if !UNIX
var wtd = new WinTrustData(filename);

var result = NativeMethods.WinVerifyTrust(new IntPtr(-1), new Guid("{00AAC56B-CD44-11d0-8CC2-00C04FC295EE}"), wtd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Microsoft.PackageManagement.Internal.Utility.Extensions {

internal static class ExceptionExtensions {
public static void Dump(this Exception e) {
#if !LINUX
#if !UNIX
var text = string.Format(CultureInfo.CurrentCulture, "{0}/{1}\r\n{2}", e.GetType().Name, e.Message, e.StackTrace);
// for now, this is the only way we'll see exceptions in the wild.
NativeMethods.OutputDebugString(text);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public static string CanonicalizePath(this string path, bool isPotentiallyRelati

// is this a unc path?
if (string.IsNullOrWhiteSpace(pathUri.Host)) {
#if !LINUX
#if !UNIX
// no, this is a drive:\path path
// use API to resolve out the drive letter to see if it is a remote
var drive = pathUri.Segments[1].Replace('/', '\\'); // the zero segment is always just '/'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ internal class AdminPrivilege {
/// </returns>
public static bool IsElevated {
get {
#if LINUX
#if UNIX
return string.Equals(System.Environment.GetEnvironmentVariable("SUDO_UID"), "1000");
#else
var id = WindowsIdentity.GetCurrent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace Microsoft.PackageManagement.Internal.Utility.Platform {
internal static class Manifest {
private static readonly byte[] _utf = {0xef, 0xbb, 0xbf};

#if !LINUX
#if !UNIX
public static IEnumerable<XElement> LoadFrom(string filename) {
var manifests = new List<XElement>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// limitations under the License.
//

#if !LINUX
#if !UNIX
namespace Microsoft.PackageManagement.Internal.Utility.Platform {
using System;
using System.Diagnostics.CodeAnalysis;
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.PackageManagement/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"configurations": {
"Linux": {
"buildOptions": {
"define": [ "LINUX" ]
"define": [ "UNIX" ]
}
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !LINUX
#if !UNIX

/********************************************************************++
Copyright (c) Microsoft Corporation. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ internal object AddProperties(bool includeUserName, Process process, Cmdlet cmdl
private static string RetrieveProcessUserName(Process process, Cmdlet cmdlet)
{
string userName = null;
#if LINUX
#if UNIX
userName = Platform.NonWindowsGetUserFromPid(process.Id);
#else
IntPtr tokenUserInfo = IntPtr.Zero;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !LINUX
#if !UNIX

using System;
using System.Collections.Generic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"configurations": {
"Linux": {
"buildOptions": {
"define": [ "LINUX" ]
"define": [ "UNIX" ]
}
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !LINUX
#if !UNIX
/********************************************************************++
Copyright (c) Microsoft Corporation. All rights reserved.
--********************************************************************/
Expand Down
10 changes: 5 additions & 5 deletions src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ internal static int Start(



#if LINUX
#if UNIX
/// <summary>
///
/// The break handler for the program. Dispatches a break event to the current Executor.
Expand Down Expand Up @@ -466,7 +466,7 @@ private static void HandleBreak()
// call the console APIs directly, instead of ui.rawui.FlushInputHandle, as ui may be finalized
// already if this thread is lagging behind the main thread.

#if !LINUX
#if !UNIX
ConsoleHandle handle = ConsoleControl.GetConioDeviceHandle();
ConsoleControl.FlushConsoleInputBuffer(handle);
#endif
Expand Down Expand Up @@ -1064,7 +1064,7 @@ internal ConsoleHost(RunspaceConfiguration configuration)

private void BindBreakHandler()
{
#if LINUX
#if UNIX
Console.CancelKeyPress += new ConsoleCancelEventHandler(MyBreakHandler);
#else
breakHandlerGcHandle = GCHandle.Alloc(new ConsoleControl.BreakHandler(MyBreakHandler));
Expand Down Expand Up @@ -1123,7 +1123,7 @@ private void Dispose(bool isDisposingNotFinalizing)
{
if (!isDisposed)
{
#if !LINUX
#if !UNIX
Dbg.Assert(breakHandlerGcHandle != null, "break handler should be set");
ConsoleControl.RemoveBreakHandler();
breakHandlerGcHandle.Free();
Expand Down Expand Up @@ -2872,7 +2872,7 @@ private class ConsoleHostStartupException : Exception
/// </summary>
private RunspaceRef runspaceRef;

#if !LINUX
#if !UNIX
private GCHandle breakHandlerGcHandle;
#endif
private System.Threading.Thread breakHandlerThread;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !LINUX
#if !UNIX
/********************************************************************++
Copyright (c) Microsoft Corporation. All rights reserved.
--********************************************************************/
Expand Down
Loading