Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
mastersign committed Jan 6, 2020
2 parents 80dd2e1 + 1baa4f0 commit 7773f52
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 19 deletions.
4 changes: 2 additions & 2 deletions BenchManager/BenchCLI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.22.3.0")]
[assembly: AssemblyFileVersion("0.22.3.0")]
[assembly: AssemblyVersion("0.22.4.0")]
[assembly: AssemblyFileVersion("0.22.4.0")]
4 changes: 2 additions & 2 deletions BenchManager/BenchDashboard/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.22.3.0")]
[assembly: AssemblyFileVersion("0.22.3.0")]
[assembly: AssemblyVersion("0.22.4.0")]
[assembly: AssemblyFileVersion("0.22.4.0")]
25 changes: 14 additions & 11 deletions BenchManager/BenchLib/FileSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,7 @@ public static string EmptyDir(string path)
if (Directory.Exists(path))
{
Debug.WriteLine("Cleaning directory: " + path);
File.SetAttributes(path, FileAttributes.Normal);
foreach (var dir in Directory.GetDirectories(path))
{
ForceDeleteDirectory(dir);
}
foreach (var file in Directory.GetFiles(path))
{
ForceDeleteFile(file);
}
ForceEmptyDirectory(path);
}
else
{
Expand Down Expand Up @@ -98,10 +90,11 @@ public static void PurgeDir(string path)
path = NormalizePath(path);
if (!Directory.Exists(path)) return;
Debug.WriteLine("Purging directory: " + path);
ForceEmptyDirectory(path);
ForceDeleteDirectory(path);
}

private static void ForceDeleteDirectory(string targetDir)
private static void ForceEmptyDirectory(string targetDir)
{
targetDir = NormalizePath(targetDir);
File.SetAttributes(targetDir, FileAttributes.Normal);
Expand All @@ -116,15 +109,24 @@ private static void ForceDeleteDirectory(string targetDir)

foreach (string dir in dirs)
{
if (!File.GetAttributes(dir).HasFlag(FileAttributes.ReparsePoint))
{
// empty folder if it is not a junction (directory symlink)
ForceEmptyDirectory(dir);
}
ForceDeleteDirectory(dir);
}
}

private static void ForceDeleteDirectory(string targetDir)
{
// poll to work around short time locks from anti virus software
for (int i = 0; i < UNAUTHORIZED_RETRY_LIMIT; i++)
{
try
{
Directory.Delete(targetDir, true);
// expect the directory to be empty
Directory.Delete(targetDir, false);
return;
}
catch (UnauthorizedAccessException)
Expand Down Expand Up @@ -185,6 +187,7 @@ public static void MoveContent(string sourceDir, string targetDir)
if (Directory.Exists(tp))
{
MoveContent(currentDir, tp);
ForceEmptyDirectory(currentDir);
ForceDeleteDirectory(currentDir);
}
else
Expand Down
4 changes: 2 additions & 2 deletions BenchManager/BenchLib/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.22.3.0")]
[assembly: AssemblyFileVersion("0.22.3.0")]
[assembly: AssemblyVersion("0.22.4.0")]
[assembly: AssemblyFileVersion("0.22.4.0")]
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ Add a link to the GitHub diff like

[Unreleased]: https://github.com/winbench/bench/compare/master...dev

## [0.22.4] - 2020-01-06

[0.22.4]: https://github.com/winbench/bench/compare/v0.22.3...v0.22.4

### Fixed
* Prevent recursive deletion of junctions
([#142](https://github.com/winbench/bench/issues/142))

## [0.22.3] - 2019-08-13

[0.22.3]: https://github.com/winbench/bench/compare/v0.22.2...v0.22.3
Expand Down
2 changes: 1 addition & 1 deletion res/bench-install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SetLocal
:: https://winbench.org/guide/setup/
::

SET VERSION=0.22.3
SET VERSION=0.22.4
SET TAG=v%VERSION%
SET ROOT=%~dp0
IF [%1] NEQ [] SET ROOT=%~dpnx1\
Expand Down
2 changes: 1 addition & 1 deletion res/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.22.3
0.22.4

0 comments on commit 7773f52

Please sign in to comment.