Merge pull request #34360 from joncojonathan/update-keepass238

Update keepass238
This commit is contained in:
Jörg Thalheim 2018-02-10 12:33:46 +00:00 committed by GitHub
commit e43aded160
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 66 deletions

View file

@ -8,34 +8,17 @@
# plugin derivations in the Nix store and nowhere else.
with builtins; buildDotnetPackage rec {
baseName = "keepass";
version = "2.37";
version = "2.38";
src = fetchurl {
url = "mirror://sourceforge/keepass/KeePass-${version}-Source.zip";
sha256 = "1wfbpfjng1blzkbjnxsdnny544297bm9869ianbr6l0hrvcgv3qx";
sha256 = "0m33gfpvv01xc28k4rrc8llbyk6qanm9rsqcnv8ydms0cr78dbbk";
};
sourceRoot = ".";
buildInputs = [ unzip makeWrapper icoutils ];
pluginLoadPathsPatch =
let outputLc = toString (add 7 (length plugins));
patchTemplate = readFile ./keepass-plugins.patch;
loadTemplate = readFile ./keepass-plugins-load.patch;
loads =
lib.concatStrings
(map
(p: replaceStrings ["$PATH$"] [ (unsafeDiscardStringContext (toString p)) ] loadTemplate)
plugins);
in replaceStrings ["$OUTPUT_LC$" "$DO_LOADS$"] [outputLc loads] patchTemplate;
passAsFile = [ "pluginLoadPathsPatch" ];
postPatch = ''
sed -i 's/\r*$//' KeePass/Forms/MainForm.cs
patch -p1 <$pluginLoadPathsPatchPath
'';
preConfigure = ''
rm -rvf Build/*
find . -name "*.sln" -print -exec sed -i 's/Format Version 10.00/Format Version 11.00/g' {} \;

View file

@ -1 +0,0 @@
+ m_pluginManager.LoadAllPlugins("$PATH$/lib/dotnet/keepass", SearchOption.TopDirectoryOnly, new string[] {});

View file

@ -1,46 +0,0 @@
--- old/KeePass/Forms/MainForm.cs
+++ new/KeePass/Forms/MainForm.cs
@@ -386,42 +386,$OUTPUT_LC$ @@ namespace KeePass.Forms
m_pluginManager.UnloadAllPlugins();
if(AppPolicy.Current.Plugins)
{
- string[] vExclNames = new string[] {
- AppDefs.FileNames.Program, AppDefs.FileNames.XmlSerializers,
- AppDefs.FileNames.NativeLib32, AppDefs.FileNames.NativeLib64,
- AppDefs.FileNames.ShInstUtil
- };
-
- string strPlgRoot = UrlUtil.GetFileDirectory(
- WinUtil.GetExecutable(), false, true);
- m_pluginManager.LoadAllPlugins(strPlgRoot, SearchOption.TopDirectoryOnly,
- vExclNames);
-
- if(!NativeLib.IsUnix())
- {
- string strPlgSub = UrlUtil.EnsureTerminatingSeparator(strPlgRoot,
- false) + AppDefs.PluginsDir;
- m_pluginManager.LoadAllPlugins(strPlgSub, SearchOption.AllDirectories,
- vExclNames);
- }
- else // Unix
- {
- try
- {
- DirectoryInfo diPlgRoot = new DirectoryInfo(strPlgRoot);
- foreach(DirectoryInfo diSub in diPlgRoot.GetDirectories())
- {
- if(diSub == null) { Debug.Assert(false); continue; }
-
- if(string.Equals(diSub.Name, AppDefs.PluginsDir,
- StrUtil.CaseIgnoreCmp))
- m_pluginManager.LoadAllPlugins(diSub.FullName,
- SearchOption.AllDirectories, vExclNames);
- }
- }
- catch(Exception) { Debug.Assert(false); }
- }
- }
$DO_LOADS$+ }
// Delete old files *after* loading plugins (when timestamps
// of loaded plugins have been updated already)