1
0
mirror of https://github.com/anope/anope.git synced 2026-06-26 21:56:38 +02:00

Remove revision numbers as they're only ever set by Config reading git since we've switched off of SVN. Instead just use the hash for the current head when building. Also recheck the hash on every make not just Config.

This commit is contained in:
Adam
2012-02-15 00:06:25 -05:00
parent db59f1a70f
commit e1f5fc6a0c
9 changed files with 84 additions and 71 deletions
+19 -16
View File
@@ -186,22 +186,30 @@ ModuleReturn ModuleManager::LoadModule(const Anope::string &modname, User *u)
ModuleVersion v = m->GetVersion();
if (v.GetMajor() < Anope::VersionMajor() || (v.GetMajor() == Anope::VersionMajor() && v.GetMinor() < Anope::VersionMinor()))
{
Log() << "Module " << modname << " is compiled against an older version of Anope " << v.GetMajor() << "." << v.GetMinor() << ", this is " << Anope::VersionMajor() << "." << Anope::VersionMinor();
Log() << "Module " << modname << " is compiled against an older version of Anope " << v.GetMajor() << "." << v.GetMinor() << ", this is " << Anope::VersionShort();
DeleteModule(m);
return MOD_ERR_VERSION;
}
else if (v.GetMajor() > Anope::VersionMajor() || (v.GetMajor() == Anope::VersionMajor() && v.GetMinor() > Anope::VersionMinor()))
{
Log() << "Module " << modname << " is compiled against a newer version of Anope " << v.GetMajor() << "." << v.GetMinor() << ", this is " << Anope::VersionMajor() << "." << Anope::VersionMinor();
Log() << "Module " << modname << " is compiled against a newer version of Anope " << v.GetMajor() << "." << v.GetMinor() << ", this is " << Anope::VersionShort();
DeleteModule(m);
return MOD_ERR_VERSION;
}
else if (v.GetBuild() < Anope::VersionBuild())
Log() << "Module " << modname << " is compiled against an older revision of Anope " << v.GetBuild() << ", this is " << Anope::VersionBuild();
else if (v.GetBuild() > Anope::VersionBuild())
Log() << "Module " << modname << " is compiled against a newer revision of Anope " << v.GetBuild() << ", this is " << Anope::VersionBuild();
else if (v.GetBuild() == Anope::VersionBuild())
Log(LOG_DEBUG) << "Module " << modname << " compiled against current version of Anope " << v.GetBuild();
else if (v.GetPatch() < Anope::VersionPatch())
{
Log() << "Module " << modname << " is compiled against an older version of Anope, " << v.GetMajor() << "." << v.GetMinor() << "." << v.GetPatch() << ", this is " << Anope::VersionShort();
DeleteModule(m);
return MOD_ERR_VERSION;
}
else if (v.GetPatch() > Anope::VersionPatch())
{
Log() << "Module " << modname << " is compiled against a newer version of Anope, " << v.GetMajor() << "." << v.GetMinor() << "." << v.GetPatch() << ", this is " << Anope::VersionShort();
DeleteModule(m);
return MOD_ERR_VERSION;
}
else
Log(LOG_DEBUG) << "Module " << modname << " is compiled against current version of Anope " << Anope::VersionShort();
if (m->type == PROTOCOL && ModuleManager::FindFirstOf(PROTOCOL) != m)
{
@@ -251,7 +259,7 @@ Module *ModuleManager::FindFirstOf(ModType type)
return NULL;
}
void ModuleManager::RequireVersion(int major, int minor, int patch, int build)
void ModuleManager::RequireVersion(int major, int minor, int patch)
{
if (Anope::VersionMajor() > major)
return;
@@ -268,16 +276,11 @@ void ModuleManager::RequireVersion(int major, int minor, int patch, int build)
else if (Anope::VersionPatch() > patch)
return;
else if (Anope::VersionPatch() == patch)
{
if (build == -1)
return;
else if (Anope::VersionBuild() >= build)
return;
}
return;
}
}
throw ModuleException("This module requires version " + stringify(major) + "." + stringify(minor) + "." + stringify(patch) + "-" + build + " - this is " + Anope::Version());
throw ModuleException("This module requires version " + stringify(major) + "." + stringify(minor) + "." + stringify(patch) + " - this is " + Anope::VersionShort());
}
ModuleReturn ModuleManager::DeleteModule(Module *m)