From c616195c0a9a203058031dfe000bb220266ceb2c Mon Sep 17 00:00:00 2001
From: dms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Date: Fri, 22 Sep 2000 10:48:42 +0000
Subject: [PATCH] verbose on reload (time ago, delta time)

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@120 c11ca15a-4712-0410-83d8-924469b57eb5
---
 src/modules.pl | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/modules.pl b/src/modules.pl
index 746de95..9c49f56 100644
--- a/src/modules.pl
+++ b/src/modules.pl
@@ -193,7 +193,7 @@ sub reloadModule {
     my $file	= (grep /\/$mod/, keys %INC)[0];
 
     if (!defined $file) {
-	&WARN("rM: Cannot reload $mod ($file) since it was not loaded anyway.");
+	&WARN("rM: Cannot reload $mod since it was not loaded anyway.");
 	return;
     }
 
@@ -205,12 +205,23 @@ sub reloadModule {
     my $age = (stat $file)[9];
     return if ($age == $moduleAge{$file});
 
+    if ($age < $moduleAge{$file}) {
+	&WARN("rM: we're not gonna downgrade the file. use 'touch'.");
+	return;
+    }
+
     if (grep /$mod/, @myModulesReloadNot) {
 	&DEBUG("rM: SHOULD NOT RELOAD $mod!!!");
 	return;
     }
 
+    my $dc  = &Time2String($age   - $moduleAge{$file});
+    my $ago = &Time2String(time() - $moduleAge{$file});
+
     &status("Module: Loading $mod...");
+    &VERB("Module:  delta change: $dc",2);
+    &VERB("Module:           ago: $ago",2);
+
     delete $INC{$file};
     eval "require \"$file\"";	# require or use?
     if (@$) {
-- 
2.39.5