Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/hakchi2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2018-02-14 01:13:00 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2018-02-14 01:13:00 +0300
commit770366b786ff798bb21530bb913897219ec0e600 (patch)
tree4f9ca33b40a5098361a1f56553b80c30a3c9d1b6
parent6dfed02838c04e499e287dcc32c15e655664283d (diff)
rsync fixes
-rw-r--r--WorkerForm.cs22
-rw-r--r--hakchi_gui.csproj3
2 files changed, 21 insertions, 4 deletions
diff --git a/WorkerForm.cs b/WorkerForm.cs
index a2e07d6b..40fd2f49 100644
--- a/WorkerForm.cs
+++ b/WorkerForm.cs
@@ -957,7 +957,7 @@ namespace com.clusterrr.hakchi_gui
{
SetStatus("Writing games to USB drive...");
Directory.CreateDirectory(exportDirectory);
- if (!ExecuteTool("rsync.exe", $"-ac --delete \"/{tempGamesDirectory.Replace("\\", "/").Replace(":/", "/")}\" \"/{exportDirectory.Replace("\\", "/").Replace(":/", "/")}\""))
+ if (!ExecuteTool("rsync.exe", $"-ac --delete --exclude=title.fnt \"{cygwinPath(tempGamesDirectory)}\" \"{cygwinPath(exportDirectory)}\""))
throw new Exception("Can't rsync to USB drive");
}
#if !DEBUG
@@ -1264,7 +1264,7 @@ namespace com.clusterrr.hakchi_gui
public long TransferSize = 0;
}
- private void AddMenu(NesMenuCollection menuCollection, Dictionary<string, string> originalGames, GamesTreeStats stats = null)
+ private void AddMenu(NesMenuCollection menuCollection, Dictionary<string, string> originalGames, GamesTreeStats stats = null, string syncPath = null)
{
if (stats == null)
stats = new GamesTreeStats();
@@ -1285,12 +1285,21 @@ namespace com.clusterrr.hakchi_gui
var desktopFilePath = Path.Combine(desktopEntriesPath, $"{originalCode}.desktop");
var targetGamePath = Path.Combine(targetDirectory, originalCode);
Directory.CreateDirectory(targetGamePath);
+ if (exportGames) // Copy back to reduce repeative original games repair
+ {
+ var realTargetGamePath = Path.Combine(Path.Combine(Path.Combine(exportDirectory, SubConsoleDirectory), string.Format("{0:D3}", menuIndex)), originalCode);
+ if (Directory.Exists(realTargetGamePath))
+ {
+ if (!ExecuteTool("rsync.exe", $"-ac --delete \"{cygwinPath(realTargetGamePath)}\" \"{cygwinPath(targetDirectory)}\""))
+ throw new Exception("Can't rsync to USB drive");
+ }
+ }
Directory.CreateDirectory(Path.Combine(targetGamePath, "autoplay"));
if (ConfigIni.ConsoleType == MainForm.ConsoleType.NES || ConfigIni.ConsoleType == MainForm.ConsoleType.Famicom)
{
Directory.CreateDirectory(Path.Combine(targetGamePath, "pixelart"));
}
- File.Copy(desktopFilePath, Path.Combine(targetGamePath, $"{originalCode}.desktop"));
+ File.Copy(desktopFilePath, Path.Combine(targetGamePath, $"{originalCode}.desktop"), true);
stats.TotalSize += gameSize;
stats.TransferSize += gameSize;
stats.TotalGames++;
@@ -1413,7 +1422,7 @@ namespace com.clusterrr.hakchi_gui
bool YesForAllPatches = false;
- public ICollection<NesMiniApplication> AddGames(IEnumerable<string> files, Form parentForm = null)
+ public ICollection<NesMiniApplication> AddGames(IEnumerable<string> files)
{
var apps = new List<NesMiniApplication>();
addedApplications = null;
@@ -1632,5 +1641,10 @@ namespace com.clusterrr.hakchi_gui
TaskbarProgress.SetValue(this, 0, 1);
}
}
+
+ string cygwinPath(string path)
+ {
+ return ("/cygdrive/" + path.Replace("\\", "/").Replace(":/", "/"));
+ }
}
}
diff --git a/hakchi_gui.csproj b/hakchi_gui.csproj
index e210881f..4f35cb00 100644
--- a/hakchi_gui.csproj
+++ b/hakchi_gui.csproj
@@ -520,6 +520,9 @@
<Content Include="folder_images\cps.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
+ <Content Include="tools\cygpopt-0.dll">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
<Content Include="tools\rsync.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>