depot/pkgs/by-name/ke/keepass/fix-paths.patch
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

143 lines
5.4 KiB
Diff

From 830d0db80f2fce09e12c117f8338b8e4b05866ff Mon Sep 17 00:00:00 2001
From: Pascal Winkelmann <pascal@wnklmnn.de>
Date: Tue, 19 May 2020 10:28:31 +0200
Subject: [PATCH] fixpaths
---
KeePass/Native/NativeMethods.Unix.cs | 2 +-
KeePass/UI/UISystemFonts.cs | 2 +-
KeePass/Util/AppLocator.cs | 2 +-
KeePass/Util/ClipboardUtil.Unix.cs | 14 +++++++-------
KeePassLib/Native/ClipboardU.cs | 2 +-
KeePassLib/Native/NativeLib.cs | 2 +-
KeePassLib/Utility/MonoWorkarounds.cs | 4 ++--
7 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/KeePass/Native/NativeMethods.Unix.cs b/KeePass/Native/NativeMethods.Unix.cs
index 4c47258..79cfdb2 100644
--- a/KeePass/Native/NativeMethods.Unix.cs
+++ b/KeePass/Native/NativeMethods.Unix.cs
@@ -130,7 +130,7 @@ namespace KeePass.Native
try
{
Application.DoEvents(); // E.g. for clipboard updates
- string strOutput = NativeLib.RunConsoleApp("xdotool", strParams);
+ string strOutput = NativeLib.RunConsoleApp("@xdotool@", strParams);
Application.DoEvents(); // E.g. for clipboard updates
return (strOutput ?? string.Empty);
}
diff --git a/KeePass/UI/UISystemFonts.cs b/KeePass/UI/UISystemFonts.cs
index 08d6134..2bfa4a2 100644
--- a/KeePass/UI/UISystemFonts.cs
+++ b/KeePass/UI/UISystemFonts.cs
@@ -188,7 +188,7 @@ namespace KeePass.UI
private static void UbuntuLoadFonts()
{
- string strDef = NativeLib.RunConsoleApp("gsettings",
+ string strDef = NativeLib.RunConsoleApp("@gsettings@",
"get org.gnome.desktop.interface font-name");
if(strDef == null) return;
diff --git a/KeePass/Util/AppLocator.cs b/KeePass/Util/AppLocator.cs
index af02803..8a32c9d 100644
--- a/KeePass/Util/AppLocator.cs
+++ b/KeePass/Util/AppLocator.cs
@@ -468,7 +468,7 @@ namespace KeePass.Util
if(NativeLib.GetPlatformID() == PlatformID.MacOSX)
strOpt = string.Empty; // FR 3535696
- string str = NativeLib.RunConsoleApp("whereis", strOpt + strApp);
+ string str = NativeLib.RunConsoleApp("@whereis@", strOpt + strApp);
if(string.IsNullOrEmpty(str)) return null;
int iSep = str.IndexOf(':');
diff --git a/KeePass/Util/ClipboardUtil.Unix.cs b/KeePass/Util/ClipboardUtil.Unix.cs
--- a/KeePass/Util/ClipboardUtil.Unix.cs
+++ b/KeePass/Util/ClipboardUtil.Unix.cs
@@ -65,7 +65,7 @@
// "-out -selection clipboard");
// if(str != null) return str;
- string str = NativeLib.RunConsoleApp("xsel",
+ string str = NativeLib.RunConsoleApp("@xsel@",
"--output --clipboard", null, XSelFlags);
if(str != null) return str;
}
@@ -93,10 +93,10 @@
if(string.IsNullOrEmpty(str))
{
// xsel with an empty input can hang, thus use --clear
- if(NativeLib.RunConsoleApp("xsel", "--clear --primary",
+ if(NativeLib.RunConsoleApp("@xsel@", "--clear --primary",
null, XSelFlags) != null)
{
- NativeLib.RunConsoleApp("xsel", "--clear --clipboard",
+ NativeLib.RunConsoleApp("@xsel@", "--clear --clipboard",
null, XSelFlags);
return;
}
@@ -107,10 +107,10 @@
}
// xsel does not support --primary and --clipboard together
- if(NativeLib.RunConsoleApp("xsel", "--input --primary",
+ if(NativeLib.RunConsoleApp("@xsel@", "--input --primary",
str, XSelFlags) != null)
{
- NativeLib.RunConsoleApp("xsel", "--input --clipboard",
+ NativeLib.RunConsoleApp("@xsel@", "--input --clipboard",
str, XSelFlags);
return;
}
diff --git a/KeePassLib/Native/ClipboardU.cs b/KeePassLib/Native/ClipboardU.cs
index 291c51d..3c76380 100644
--- a/KeePassLib/Native/ClipboardU.cs
+++ b/KeePassLib/Native/ClipboardU.cs
@@ -27,7 +27,7 @@ namespace KeePassLib.Native
{
internal static class ClipboardU
{
- internal const string XSel = "xsel";
+ internal const string XSel = "@xsel@";
private const string XSelV = "--version";
private const string XSelR = "--output --clipboard";
private const string XSelC = "--clear --clipboard";
diff --git a/KeePassLib/Native/NativeLib.cs b/KeePassLib/Native/NativeLib.cs
index 2d227a3..243f4ee 100644
--- a/KeePassLib/Native/NativeLib.cs
+++ b/KeePassLib/Native/NativeLib.cs
@@ -143,7 +143,7 @@ namespace KeePassLib.Native
// Mono returns PlatformID.Unix on MacOS, workaround this
if(g_platID.Value == PlatformID.Unix)
{
- if((RunConsoleApp("uname", null) ?? string.Empty).Trim().Equals(
+ if((RunConsoleApp("@uname@", null) ?? string.Empty).Trim().Equals(
"Darwin", StrUtil.CaseIgnoreCmp))
g_platID = PlatformID.MacOSX;
}
diff --git a/KeePassLib/Utility/MonoWorkarounds.cs b/KeePassLib/Utility/MonoWorkarounds.cs
index e20bb3a..4fd875b 100644
--- a/KeePassLib/Utility/MonoWorkarounds.cs
+++ b/KeePassLib/Utility/MonoWorkarounds.cs
@@ -41,7 +41,7 @@ namespace KeePassLib.Utility
{
public static class MonoWorkarounds
{
- private const string AppXDoTool = "xdotool";
+ private const string AppXDoTool = "@xdotool@";
private static Dictionary<uint, bool> g_dForceReq = new Dictionary<uint, bool>();
private static Thread g_thFixClip = null;
@@ -356,7 +356,7 @@ namespace KeePassLib.Utility
// }
// else { Debug.Assert(false); }
- string strWmClass = (NativeLib.RunConsoleApp("xprop",
+ string strWmClass = (NativeLib.RunConsoleApp("@xprop@",
"-id " + strHandle + " WM_CLASS") ?? string.Empty);
if(strWmClass.IndexOf("\"" + PwDefs.ResClass + "\"",
--
2.25.4