aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTrond B Krokli <tkrokli@gmail.com>2016-05-29 16:06:07 +0200
committerjackpoz <giacomopoz@gmail.com>2016-08-10 18:11:36 +0200
commit70b3373da1d00413f7e98178b0085a6d8748e662 (patch)
treec9500fc8ce67dc045661dce22b7a43553e79a5cd /src
parent7616f796d0fa6a82935cfc67bfdfbcf54efbcbc7 (diff)
Core/DB/Updater: English grammar corrections (#17207)
Improve English text in strings and comments in UpdateFetcher.cpp - replace incorrect text with the intended words in some output strings - corrections in the comments to point out the intention of the code (cherry picked from commit 186375d997caab33eee878a1e102f41939c7a688)
Diffstat (limited to 'src')
-rw-r--r--src/server/database/Updater/UpdateFetcher.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/server/database/Updater/UpdateFetcher.cpp b/src/server/database/Updater/UpdateFetcher.cpp
index 7dc0a307ca2..3d81b9e035e 100644
--- a/src/server/database/Updater/UpdateFetcher.cpp
+++ b/src/server/database/Updater/UpdateFetcher.cpp
@@ -67,11 +67,11 @@ void UpdateFetcher::FillFileListRecursively(Path const& path, LocaleFileStorage&
LocaleFileEntry const entry = { itr->path(), state };
// Check for doubled filenames
- // Since elements are only compared through their filenames this is ok
+ // Because elements are only compared by their filenames, this is ok
if (storage.find(entry) != storage.end())
{
- TC_LOG_FATAL("sql.updates", "Duplicated filename occurred \"%s\", since updates are ordered " \
- "through its filename every name needs to be unique!", itr->path().generic_string().c_str());
+ TC_LOG_FATAL("sql.updates", "Duplicate filename \"%s\" occurred. Because updates are ordered " \
+ "by their filenames, every name needs to be unique!", itr->path().generic_string().c_str());
throw UpdateException("Updating failed, see the log for details.");
}
@@ -101,7 +101,7 @@ UpdateFetcher::DirectoryStorage UpdateFetcher::ReceiveIncludedDirectories() cons
if (!is_directory(p))
{
- TC_LOG_WARN("sql.updates", "DBUpdater: Given update include directory \"%s\" isn't existing, skipped!", p.generic_string().c_str());
+ TC_LOG_WARN("sql.updates", "DBUpdater: Given update include directory \"%s\" does not exist, skipped!", p.generic_string().c_str());
continue;
}
@@ -144,7 +144,7 @@ std::string UpdateFetcher::ReadSQLUpdate(boost::filesystem::path const& file) co
{
TC_LOG_FATAL("sql.updates", "Failed to open the sql update \"%s\" for reading! "
"Stopping the server to keep the database integrity, "
- "try to identify and solve the issue or disabled the database updater.",
+ "try to identify and solve the issue or disable the database updater.",
file.generic_string().c_str());
throw UpdateException("Opening the sql update failed!");
@@ -192,7 +192,7 @@ UpdateResult UpdateFetcher::Update(bool const redundancyChecks,
AppliedFileStorage::const_iterator iter = applied.find(availableQuery.first.filename().string());
if (iter != applied.end())
{
- // If redundancy is disabled skip it since the update is already applied.
+ // If redundancy is disabled, skip it, because the update is already applied.
if (!redundancyChecks)
{
TC_LOG_DEBUG("sql.updates", ">> Update is already applied, skipping redundancy checks.");
@@ -200,7 +200,7 @@ UpdateResult UpdateFetcher::Update(bool const redundancyChecks,
continue;
}
- // If the update is in an archived directory and is marked as archived in our database skip redundancy checks (archived updates never change).
+ // If the update is in an archived directory and is marked as archived in our database, skip redundancy checks (archived updates never change).
if (!archivedRedundancy && (iter->second.state == ARCHIVED) && (availableQuery.second == ARCHIVED))
{
TC_LOG_DEBUG("sql.updates", ">> Update is archived and marked as archived in database, skipping redundancy checks.");
@@ -217,11 +217,11 @@ UpdateResult UpdateFetcher::Update(bool const redundancyChecks,
// Update is not in our applied list
if (iter == applied.end())
{
- // Catch renames (different filename but same hash)
+ // Catch renames (different filename, but same hash)
HashToFileNameStorage::const_iterator const hashIter = hashToName.find(hash);
if (hashIter != hashToName.end())
{
- // Check if the original file was removed if not we've got a problem.
+ // Check if the original file was removed. If not, we've got a problem.
LocaleFileStorage::const_iterator localeIter;
// Push localeIter forward
for (localeIter = available.begin(); (localeIter != available.end()) &&
@@ -230,12 +230,12 @@ UpdateResult UpdateFetcher::Update(bool const redundancyChecks,
// Conflict!
if (localeIter != available.end())
{
- TC_LOG_WARN("sql.updates", ">> Seems like update \"%s\" \'%s\' was renamed, but the old file is still there! " \
- "Trade it as a new file! (Probably its an unmodified copy of file \"%s\")",
+ TC_LOG_WARN("sql.updates", ">> It seems like the update \"%s\" \'%s\' was renamed, but the old file is still there! " \
+ "Treating it as a new file! (It is probably an unmodified copy of the file \"%s\")",
availableQuery.first.filename().string().c_str(), hash.substr(0, 7).c_str(),
localeIter->first.filename().string().c_str());
}
- // Its save to trade the file as renamed here
+ // It is safe to treat the file as renamed here
else
{
TC_LOG_INFO("sql.updates", ">> Renaming update \"%s\" to \"%s\" \'%s\'.",
@@ -253,7 +253,7 @@ UpdateResult UpdateFetcher::Update(bool const redundancyChecks,
availableQuery.first.filename().string().c_str(), hash.substr(0, 7).c_str());
}
}
- // Rehash the update entry if it is contained in our database but with an empty hash.
+ // Rehash the update entry if it exists in our database with an empty hash.
else if (allowRehash && iter->second.hash.empty())
{
mode = MODE_REHASH;
@@ -263,7 +263,7 @@ UpdateResult UpdateFetcher::Update(bool const redundancyChecks,
}
else
{
- // If the hash of the files differs from the one stored in our database reapply the update (because it was changed).
+ // If the hash of the files differs from the one stored in our database, reapply the update (because it changed).
if (iter->second.hash != hash)
{
TC_LOG_INFO("sql.updates", ">> Reapplying update \"%s\" \'%s\' -> \'%s\' (it changed)...", availableQuery.first.filename().string().c_str(),
@@ -271,16 +271,16 @@ UpdateResult UpdateFetcher::Update(bool const redundancyChecks,
}
else
{
- // If the file wasn't changed and just moved update its state if necessary.
+ // If the file wasn't changed and just moved, update its state (if necessary).
if (iter->second.state != availableQuery.second)
{
- TC_LOG_DEBUG("sql.updates", ">> Updating state of \"%s\" to \'%s\'...",
+ TC_LOG_DEBUG("sql.updates", ">> Updating the state of \"%s\" to \'%s\'...",
availableQuery.first.filename().string().c_str(), AppliedFileEntry::StateConvert(availableQuery.second).c_str());
UpdateState(availableQuery.first.filename().string(), availableQuery.second);
}
- TC_LOG_DEBUG("sql.updates", ">> Update is already applied and is matching hash \'%s\'.", hash.substr(0, 7).c_str());
+ TC_LOG_DEBUG("sql.updates", ">> Update is already applied and matches the hash \'%s\'.", hash.substr(0, 7).c_str());
applied.erase(iter);
continue;
@@ -307,14 +307,14 @@ UpdateResult UpdateFetcher::Update(bool const redundancyChecks,
++importedUpdates;
}
- // Cleanup up orphaned entries if enabled
+ // Cleanup up orphaned entries (if enabled)
if (!applied.empty())
{
bool const doCleanup = (cleanDeadReferencesMaxCount < 0) || (applied.size() <= static_cast<size_t>(cleanDeadReferencesMaxCount));
for (auto const& entry : applied)
{
- TC_LOG_WARN("sql.updates", ">> File \'%s\' was applied to the database but is missing in" \
+ TC_LOG_WARN("sql.updates", ">> The file \'%s\' was applied to the database, but is missing in" \
" your update directory now!", entry.first.c_str());
if (doCleanup)
@@ -325,8 +325,8 @@ UpdateResult UpdateFetcher::Update(bool const redundancyChecks,
CleanUp(applied);
else
{
- TC_LOG_ERROR("sql.updates", "Cleanup is disabled! There are " SZFMTD " dirty files that were applied to your database " \
- "but are now missing in your source directory!", applied.size());
+ TC_LOG_ERROR("sql.updates", "Cleanup is disabled! There were " SZFMTD " dirty files applied to your database, " \
+ "but they are now missing in your source directory!", applied.size());
}
}
@@ -343,7 +343,7 @@ uint32 UpdateFetcher::Apply(Path const& path) const
// Update database
_applyFile(path);
- // Return time the query took to apply
+ // Return the time it took the query to apply
return uint32(std::chrono::duration_cast<std::chrono::milliseconds>(Time::now() - begin).count());
}
@@ -358,7 +358,7 @@ void UpdateFetcher::UpdateEntry(AppliedFileEntry const& entry, uint32 const spee
void UpdateFetcher::RenameEntry(std::string const& from, std::string const& to) const
{
- // Delete target if it exists
+ // Delete the target if it exists
{
std::string const update = "DELETE FROM `updates` WHERE `name`=\"" + to + "\"";