From 630313ce835c6de746e4ff242654e0f0f4672568 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Tue, 6 Sep 2016 16:44:43 -0700 Subject: [PATCH] [SabreTools] Add DFDP as a flag! --- SabreTools.Helper/Data/Build.cs | 17 +++++++++++++++++ SabreTools/SabreTools.cs | 16 ++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/SabreTools.Helper/Data/Build.cs b/SabreTools.Helper/Data/Build.cs index 000bf8f5..4b013bd1 100644 --- a/SabreTools.Helper/Data/Build.cs +++ b/SabreTools.Helper/Data/Build.cs @@ -127,6 +127,23 @@ namespace SabreTools.Helper helptext.Add(" -au=, --author= Set the author of the DAT"); helptext.Add(" -sd, --superdat Enable SuperDAT creation"); helptext.Add(" -t=, --temp= Set the temporary directory to use"); + helptext.Add(" -dp, --dfdp Create a DAT using multithreading"); + helptext.Add(" -nm, --noMD5 Don't include MD5 in output"); + helptext.Add(" -ns, --noSHA1 Don't include SHA1 in output"); + helptext.Add(" -b, --bare Don't include date in file name"); + helptext.Add(" -u, --unzip Force unzipping in created DAT"); + helptext.Add(" -f, --files Treat archives as files"); + helptext.Add(" -o, --old Output DAT in CMP format instead of XML"); + helptext.Add(" -gz, --gz-files Allow reading of GZIP files as archives"); + helptext.Add(" -ro, --romba Read files from a Romba input"); + helptext.Add(" -f=, --filename= Set the external name of the DAT"); + helptext.Add(" -n=, --name= Set the internal name of the DAT"); + helptext.Add(" -de=, --desc= Set the description of the DAT"); + helptext.Add(" -c=, --cat= Set the category of the DAT"); + helptext.Add(" -v=, --version= Set the version of the DAT"); + helptext.Add(" -au=, --author= Set the author of the DAT"); + helptext.Add(" -sd, --superdat Enable SuperDAT creation"); + helptext.Add(" -t=, --temp= Set the temporary directory to use"); helptext.Add(" -es, --ext-split Split a DAT by two file extensions"); helptext.Add(" -exta= First set of extensions (comma-separated)"); helptext.Add(" -extb= Second set of extensions (comma-separated)"); diff --git a/SabreTools/SabreTools.cs b/SabreTools/SabreTools.cs index 5b42ebb1..78fd6624 100644 --- a/SabreTools/SabreTools.cs +++ b/SabreTools/SabreTools.cs @@ -84,6 +84,7 @@ namespace SabreTools bare = false, clean = false, datfromdir = false, + datfromdirparallel = false, datprefix = false, dedup = false, enableGzip = false, @@ -241,6 +242,11 @@ namespace SabreTools case "--diff-nd": diff |= DiffMode.NoDupes; break; + case "-dp": + case "--d2dp": + case "--dfdp": + datfromdirparallel = true; + break; case "-es": case "--ext-split": extsplit = true; @@ -598,7 +604,7 @@ namespace SabreTools } // If more than one switch is enabled, show the help screen - if (!(add ^ datfromdir ^ extsplit ^ generate ^ genall ^ hashsplit ^ import ^ listsrc ^ listsys ^ + if (!(add ^ datfromdir ^ datfromdirparallel ^ extsplit ^ generate ^ genall ^ hashsplit ^ import ^ listsrc ^ listsys ^ (merge || diff != 0 || update || outputCMP || outputRC || outputSD || outputXML || outputMiss || tsv != null|| trim) ^ offlineMerge ^ rem ^ stats)) { @@ -610,7 +616,7 @@ namespace SabreTools // If a switch that requires a filename is set and no file is, show the help screen if (inputs.Count == 0 && (update || (outputMiss || tsv != null) || outputCMP || outputRC || outputSD - || outputXML || extsplit || hashsplit || datfromdir || (merge || diff != 0) || stats || trim)) + || outputXML || extsplit || hashsplit || datfromdir || datfromdirparallel || (merge || diff != 0) || stats || trim)) { _logger.Error("This feature requires at least one input"); Build.Help(); @@ -719,6 +725,12 @@ namespace SabreTools InitDatFromDir(inputs, filename, name, description, category, version, author, forceunpack, old, romba, superdat, noMD5, noSHA1, bare, archivesAsFiles, enableGzip, tempdir); } + // Create a DAT from a directory or set of directories in parallel + else if (datfromdirparallel) + { + InitDatFromDirParallel(inputs, filename, name, description, category, version, author, forceunpack, old, romba, superdat, noMD5, noSHA1, bare, archivesAsFiles, enableGzip, tempdir); + } + // If we want to run Offline merging mode else if (offlineMerge) {