aboutsummaryrefslogtreecommitdiffstats
path: root/tools/archiver/main.cpp
diff options
context:
space:
mode:
authorIlnur Khuziev <ilnur.khuziev@yandex.ru>2022-02-10 16:46:14 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:14 +0300
commit60040c91ffe701a84689b2c6310ff845e65cff42 (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /tools/archiver/main.cpp
parent736dcd8ca259457a136f2f9f9168c44643914323 (diff)
downloadydb-60040c91ffe701a84689b2c6310ff845e65cff42.tar.gz
Restoring authorship annotation for Ilnur Khuziev <ilnur.khuziev@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'tools/archiver/main.cpp')
-rw-r--r--tools/archiver/main.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/tools/archiver/main.cpp b/tools/archiver/main.cpp
index 022c0884fd..6cda54c1ea 100644
--- a/tools/archiver/main.cpp
+++ b/tools/archiver/main.cpp
@@ -1,7 +1,7 @@
#include <library/cpp/archive/yarchive.h>
#include <library/cpp/deprecated/mapped_file/mapped_file.h>
#include <library/cpp/digest/md5/md5.h>
-#include <library/cpp/getopt/small/last_getopt.h>
+#include <library/cpp/getopt/small/last_getopt.h>
#include <util/folder/dirut.h>
#include <util/folder/filelist.h>
@@ -414,7 +414,7 @@ namespace {
};
}
-static TString CutFirstSlash(const TString& fileName) {
+static TString CutFirstSlash(const TString& fileName) {
if (fileName[0] == '/') {
return fileName.substr(1);
} else {
@@ -441,7 +441,7 @@ static void UnpackArchive(const TString& archive, const TFsPath& dir = TFsPath()
const size_t count = reader.Count();
for (size_t i = 0; i < count; ++i) {
const TString key = reader.KeyByIndex(i);
- const TString fileName = CutFirstSlash(key);
+ const TString fileName = CutFirstSlash(key);
if (!Quiet) {
Cerr << archive << " --> " << fileName << Endl;
}
@@ -454,30 +454,30 @@ static void UnpackArchive(const TString& archive, const TFsPath& dir = TFsPath()
}
}
-static void ListArchive(const TString& archive, bool cutSlash) {
+static void ListArchive(const TString& archive, bool cutSlash) {
TMappingReader mappingReader(archive);
const TArchiveReader& reader = mappingReader.Reader;
const size_t count = reader.Count();
for (size_t i = 0; i < count; ++i) {
const TString key = reader.KeyByIndex(i);
- TString fileName = key;
- if (cutSlash) {
- fileName = CutFirstSlash(key);
- }
+ TString fileName = key;
+ if (cutSlash) {
+ fileName = CutFirstSlash(key);
+ }
Cout << fileName << Endl;
}
}
-static void ListArchiveMd5(const TString& archive, bool cutSlash) {
+static void ListArchiveMd5(const TString& archive, bool cutSlash) {
TMappingReader mappingReader(archive);
const TArchiveReader& reader = mappingReader.Reader;
const size_t count = reader.Count();
for (size_t i = 0; i < count; ++i) {
const TString key = reader.KeyByIndex(i);
- TString fileName = key;
- if (cutSlash) {
- fileName = CutFirstSlash(key);
- }
+ TString fileName = key;
+ if (cutSlash) {
+ fileName = CutFirstSlash(key);
+ }
char md5buf[33];
Cout << fileName << '\t' << MD5::Stream(reader.ObjectByKey(key).Get(), md5buf) << Endl;
}
@@ -534,12 +534,12 @@ int main(int argc, char** argv) {
.Optional()
.StoreValue(&list, true);
- bool cutSlash = true;
- opts.AddLongOption("as-is", "somewhy slash is cutted by default in list; with this option key will be shown as-is")
- .NoArgument()
- .Optional()
- .StoreValue(&cutSlash, false);
-
+ bool cutSlash = true;
+ opts.AddLongOption("as-is", "somewhy slash is cutted by default in list; with this option key will be shown as-is")
+ .NoArgument()
+ .Optional()
+ .StoreValue(&cutSlash, false);
+
bool listMd5 = false;
opts.AddLongOption('m', "md5", "List files in archive with MD5 sums")
.NoArgument()
@@ -635,11 +635,11 @@ int main(int argc, char** argv) {
try {
if (listMd5) {
for (const auto& rec: recs) {
- ListArchiveMd5(rec.Path, cutSlash);
+ ListArchiveMd5(rec.Path, cutSlash);
}
} else if (list) {
for (const auto& rec: recs) {
- ListArchive(rec.Path, cutSlash);
+ ListArchive(rec.Path, cutSlash);
}
} else if (unpack) {
const TFsPath dir(unpackDir);