summaryrefslogtreecommitdiff
path: root/src/modulemanager.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-02-15 00:06:25 -0500
committerAdam <Adam@anope.org>2012-02-15 00:06:25 -0500
commite1f5fc6a0c139eae035d20facb95914642cad50c (patch)
tree60a12e03999b2cbd1ec77dd5b5bf6aef6b0057b3 /src/modulemanager.cpp
parentdb59f1a70f75d26a94df73492dc4aa462546f3d9 (diff)
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.
Diffstat (limited to 'src/modulemanager.cpp')
-rw-r--r--src/modulemanager.cpp35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/modulemanager.cpp b/src/modulemanager.cpp
index 39a4fcc45..d16b71cad 100644
--- a/src/modulemanager.cpp
+++ b/src/modulemanager.cpp
@@ -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)