Просмотр исходного кода

* Update system now uses revisions instead of build timestamp


svn: 3630
Bryan Drewery 18 лет назад
Родитель
Сommit
fdcf453bc6
14 измененных файлов с 54 добавлено и 37 удалено
  1. 1 0
      doc/UPDATES
  2. 1 1
      src/Makefile.in
  3. 9 3
      src/botcmd.c
  4. 5 5
      src/botmsg.c
  5. 10 7
      src/botnet.c
  6. 2 2
      src/botnet.h
  7. 1 1
      src/cmds.c
  8. 6 3
      src/dcc.c
  9. 3 3
      src/main.c
  10. 2 1
      src/main.h
  11. 3 3
      src/mod/share.mod/share.c
  12. 8 6
      src/mod/update.mod/update.c
  13. 2 1
      src/tandem.h
  14. 1 1
      src/users.c

+ 1 - 0
doc/UPDATES

@@ -67,6 +67,7 @@
 * Fix an automatic hostmask bug (fixes #339)
 * Fix an automatic hostmask bug (fixes #339)
 * Bots no longer die when receiving a corrupt userfile under some conditions
 * Bots no longer die when receiving a corrupt userfile under some conditions
 * Delay for auto-op/voice (+O, +v) and +voice can now be set with 'chanset auto-delay' (default 5 seconds)
 * Delay for auto-op/voice (+O, +v) and +voice can now be set with 'chanset auto-delay' (default 5 seconds)
+* Update system now uses revisions instead of build timestamp
 
 
 1.2.13 - http://wraith.botpack.net/milestone/1.2.13
 1.2.13 - http://wraith.botpack.net/milestone/1.2.13
 * Fix cmd_chanset accepting invalid flags
 * Fix cmd_chanset accepting invalid flags

+ 1 - 1
src/Makefile.in

@@ -8,7 +8,7 @@ depcomp = /bin/sh $(top_srcdir)/autotools/depcomp
 
 
 @SET_MAKE@
 @SET_MAKE@
 
 
-CXXFLAGS = @CXXFLAGS@ -I.. -I$(top_srcdir) -I$(top_srcdir)/pack @DEFS@ $(CFLGS) '-DREVISION="$(REVISION)"' -DBUILDTS=$(BUILDTS)
+CXXFLAGS = @CXXFLAGS@ -I.. -I$(top_srcdir) -I$(top_srcdir)/pack @DEFS@ $(CFLGS) '-DREVISION=$(REVISION)' -DBUILDTS=$(BUILDTS)
 CPPFLAGS = @CPPFLAGS@
 CPPFLAGS = @CPPFLAGS@
 
 
 OBJCOPY = @OBJCOPY@
 OBJCOPY = @OBJCOPY@

+ 9 - 3
src/botcmd.c

@@ -577,6 +577,7 @@ static void bot_update(int idx, char *par)
   char *bot = NULL, x, *vversion = NULL;
   char *bot = NULL, x, *vversion = NULL;
   int vlocalhub = 0;
   int vlocalhub = 0;
   time_t vbuildts = 0L;
   time_t vbuildts = 0L;
+  int vrevision = 0;
 
 
   bot = newsplit(&par);
   bot = newsplit(&par);
   x = par[0];
   x = par[0];
@@ -589,11 +590,13 @@ static void bot_update(int idx, char *par)
     vlocalhub = atoi(newsplit(&par));
     vlocalhub = atoi(newsplit(&par));
   if (par[0])
   if (par[0])
     vbuildts = atol(newsplit(&par));
     vbuildts = atol(newsplit(&par));
+  if (par[0])
+    vrevision = atol(newsplit(&par));
   if (par[0])
   if (par[0])
     vversion = newsplit(&par);
     vversion = newsplit(&par);
 
 
   if (in_chain(bot))
   if (in_chain(bot))
-    updatebot(idx, bot, x, vlocalhub, vbuildts, vversion);
+    updatebot(idx, bot, x, vlocalhub, vbuildts, vrevision, vversion);
 }
 }
 
 
 /* Newbot next share?
 /* Newbot next share?
@@ -603,6 +606,7 @@ static void bot_nlinked(int idx, char *par)
   char *newbot = NULL, *next = NULL, *p = NULL, s[1024] = "", x = 0, *vversion = NULL;
   char *newbot = NULL, *next = NULL, *p = NULL, s[1024] = "", x = 0, *vversion = NULL;
   int i, vlocalhub = 0;
   int i, vlocalhub = 0;
   time_t vbuildts = 0L;
   time_t vbuildts = 0L;
+  int vrevision = 0;
   bool bogus = 0;
   bool bogus = 0;
 
 
   newbot = newsplit(&par);
   newbot = newsplit(&par);
@@ -653,9 +657,11 @@ static void bot_nlinked(int idx, char *par)
     vlocalhub = atoi(newsplit(&par));
     vlocalhub = atoi(newsplit(&par));
   if (par[0])
   if (par[0])
     vbuildts = atol(newsplit(&par));
     vbuildts = atol(newsplit(&par));
+  if (par[0])
+    vrevision = atol(newsplit(&par));
   if (par[0])
   if (par[0])
     vversion = newsplit(&par);
     vversion = newsplit(&par);
-  botnet_send_nlinked(idx, newbot, next, x, vlocalhub, vbuildts, vversion);
+  botnet_send_nlinked(idx, newbot, next, x, vlocalhub, vbuildts, vrevision, vversion);
   
   
   if (x == '!') {
   if (x == '!') {
     if (conf.bot->hub)
     if (conf.bot->hub)
@@ -664,7 +670,7 @@ static void bot_nlinked(int idx, char *par)
       chatout("*** %s linked to botnet.\n", newbot);
       chatout("*** %s linked to botnet.\n", newbot);
     x = '-';
     x = '-';
   }
   }
-  addbot(newbot, dcc[idx].nick, next, x, vlocalhub, vbuildts, vversion ? vversion : (char *) "");
+  addbot(newbot, dcc[idx].nick, next, x, vlocalhub, vbuildts, vrevision, vversion ? vversion : (char *) "");
 }
 }
 
 
 static void bot_unlinked(int idx, char *par)
 static void bot_unlinked(int idx, char *par)

+ 5 - 5
src/botmsg.c

@@ -222,11 +222,11 @@ void botnet_send_unlinked(int idx, char *bot, char *args)
   }
   }
 }
 }
 
 
-void botnet_send_nlinked(int idx, char *bot, char *next, char flag, int vlocalhub, time_t vbuildts, char *vversion)
+void botnet_send_nlinked(int idx, char *bot, char *next, char flag, int vlocalhub, time_t vbuildts, int vrevision, char *vversion)
 {
 {
   if (tands > 0) {
   if (tands > 0) {
-    const size_t len = simple_snprintf(OBUF, sizeof(OBUF), "n %s %s %cD0gc %d %d %s\n", bot, next, flag, 
-                                       vlocalhub, (int) vbuildts, vversion ? vversion : "");
+    const size_t len = simple_snprintf(OBUF, sizeof(OBUF), "n %s %s %cD0gc %d %d %d %s\n", bot, next, flag, 
+                                       vlocalhub, (int) vbuildts, vrevision, vversion ? vversion : "");
     send_tand_but(idx, OBUF, len);
     send_tand_but(idx, OBUF, len);
   }
   }
 }
 }
@@ -249,8 +249,8 @@ void botnet_send_update(int idx, tand_t * ptr)
 {
 {
   if (tands > 0) {
   if (tands > 0) {
     /* the D0gc is a lingering hack which probably will never be able to come out. */
     /* the D0gc is a lingering hack which probably will never be able to come out. */
-    const size_t len = simple_snprintf(OBUF, sizeof(OBUF), "u %s %cD0gc %d %d %s\n", ptr->bot, ptr->share, ptr->localhub, 
-                                                          (int) ptr->buildts, ptr->version ? ptr->version : "");
+    const size_t len = simple_snprintf(OBUF, sizeof(OBUF), "u %s %cD0gc %d %d %d %s\n", ptr->bot, ptr->share, ptr->localhub, 
+                                                          (int) ptr->buildts, ptr->revision, ptr->version ? ptr->version : "");
     send_tand_but(idx, OBUF, len);
     send_tand_but(idx, OBUF, len);
   }
   }
 }
 }

+ 10 - 7
src/botnet.c

@@ -54,7 +54,7 @@ tand_t *findbot(const char *who)
 
 
 /* Add a tandem bot to our chain list
 /* Add a tandem bot to our chain list
  */
  */
-void addbot(char *who, char *from, char *next, char flag, int vlocalhub, time_t vbuildts, char *vversion)
+void addbot(char *who, char *from, char *next, char flag, int vlocalhub, time_t vbuildts, int vrevision, char *vversion)
 {
 {
   tand_t **ptr = &tandbot, *ptr2 = NULL;
   tand_t **ptr = &tandbot, *ptr2 = NULL;
 
 
@@ -69,6 +69,7 @@ void addbot(char *who, char *from, char *next, char flag, int vlocalhub, time_t
   ptr2->share = flag;
   ptr2->share = flag;
   ptr2->localhub = vlocalhub;
   ptr2->localhub = vlocalhub;
   ptr2->buildts = vbuildts;
   ptr2->buildts = vbuildts;
+  ptr2->revision = vrevision;
   if (vversion && vversion[0])
   if (vversion && vversion[0])
     strlcpy(ptr2->version, vversion, 121);
     strlcpy(ptr2->version, vversion, 121);
   ptr2->next = *ptr;
   ptr2->next = *ptr;
@@ -100,7 +101,7 @@ void check_should_backup()
 }
 }
 #endif /* G_BACKUP */
 #endif /* G_BACKUP */
 
 
-void updatebot(int idx, char *who, char share, int vlocalhub, time_t vbuildts, char *vversion)
+void updatebot(int idx, char *who, char share, int vlocalhub, time_t vbuildts, int vrevision, char *vversion)
 {
 {
   tand_t *ptr = findbot(who);
   tand_t *ptr = findbot(who);
 
 
@@ -111,6 +112,8 @@ void updatebot(int idx, char *who, char share, int vlocalhub, time_t vbuildts, c
       ptr->localhub = vlocalhub;
       ptr->localhub = vlocalhub;
     if (vbuildts)
     if (vbuildts)
       ptr->buildts = vbuildts;
       ptr->buildts = vbuildts;
+    if (vrevision)
+      ptr->revision = vrevision;
     if (vversion && vversion[0])
     if (vversion && vversion[0])
       strlcpy(ptr->version, vversion, 121);
       strlcpy(ptr->version, vversion, 121);
     botnet_send_update(idx, ptr);
     botnet_send_update(idx, ptr);
@@ -619,7 +622,7 @@ void tell_bottree(int idx)
   dprintf(idx, "%s%s%s (%s %li)\n", color_str ? color_str : "", 
   dprintf(idx, "%s%s%s (%s %li)\n", color_str ? color_str : "", 
                                     conf.bot->nick,
                                     conf.bot->nick,
                                     color_str ? COLOR_END(idx) : "",
                                     color_str ? COLOR_END(idx) : "",
-                                    egg_version, buildts);
+                                    egg_version, revision);
 
 
   thisbot = (tand_t *) 1;
   thisbot = (tand_t *) 1;
   work[0] = 0;
   work[0] = 0;
@@ -666,7 +669,7 @@ void tell_bottree(int idx)
           i = sprintf(s + 1, "%s%s%s (%s %li)", color_str ? color_str : "",
           i = sprintf(s + 1, "%s%s%s (%s %li)", color_str ? color_str : "",
                                                 bot->bot,
                                                 bot->bot,
                                                 color_str ? COLOR_END(idx) : "",
                                                 color_str ? COLOR_END(idx) : "",
-                                                bot->version, bot->buildts);
+                                                bot->version, bot->revision);
 	} else
 	} else
 	  bot = bot->next;
 	  bot = bot->next;
       }
       }
@@ -712,7 +715,7 @@ void tell_bottree(int idx)
                 i = sprintf(s + 1, "%s%s%s (%s %li)", color_str ? color_str : "",
                 i = sprintf(s + 1, "%s%s%s (%s %li)", color_str ? color_str : "",
                                                       bot->bot,
                                                       bot->bot,
                                                       color_str ? COLOR_END(idx) : "",
                                                       color_str ? COLOR_END(idx) : "",
-                                                      bot->version, bot->buildts);
+                                                      bot->version, bot->revision);
 	      }
 	      }
 	    }
 	    }
 	  }
 	  }
@@ -773,8 +776,8 @@ void dump_links(int z)
       else
       else
         p = bot->uplink->bot;
         p = bot->uplink->bot;
 
 
-      l = simple_sprintf(x, "n %s %s %cD0gc %d %d %s\n", bot->bot, p, bot->share, bot->localhub, 
-                                                        (int) bot->buildts, bot->version ? bot->version : "");
+      l = simple_sprintf(x, "n %s %s %cD0gc %d %d %d %s\n", bot->bot, p, bot->share, bot->localhub, 
+                                                        (int) bot->buildts, bot->revision, bot->version ? bot->version : "");
       tputs(dcc[z].sock, x, l);
       tputs(dcc[z].sock, x, l);
     }
     }
   }
   }

+ 2 - 2
src/botnet.h

@@ -21,8 +21,8 @@ void tell_bottree(int);
 void dump_links(int);
 void dump_links(int);
 int botlink(char *, int, char *);
 int botlink(char *, int, char *);
 int botunlink(int, char *, char *);
 int botunlink(int, char *, char *);
-void addbot(char *, char *, char *, char, int, time_t, char *);
-void updatebot(int, char *, char, int, time_t, char *);
+void addbot(char *, char *, char *, char, int, time_t, int, char *);
+void updatebot(int, char *, char, int, time_t, int, char *);
 void rembot(const char *);
 void rembot(const char *);
 tand_t *findbot(const char *);
 tand_t *findbot(const char *);
 void unvia(int, struct tand_t_struct *);
 void unvia(int, struct tand_t_struct *);

+ 1 - 1
src/cmds.c

@@ -368,7 +368,7 @@ static void cmd_about(int idx, char *par)
   egg_strftime(c, sizeof c, "%c %Z", gmtime(&buildts));
   egg_strftime(c, sizeof c, "%c %Z", gmtime(&buildts));
   dprintf(idx, "Version: %s\n", egg_version);
   dprintf(idx, "Version: %s\n", egg_version);
   dprintf(idx, "Build: %s (%li)\n", c, buildts);
   dprintf(idx, "Build: %s (%li)\n", c, buildts);
-  dprintf(idx, "Revision: %s\n", revision);
+  dprintf(idx, "Revision: %d\n", revision);
   dprintf(idx, STR("(written from a base of Eggdrop 1.6.12)\n"));
   dprintf(idx, STR("(written from a base of Eggdrop 1.6.12)\n"));
   dprintf(idx, "..with credits and thanks to the following:\n");
   dprintf(idx, "..with credits and thanks to the following:\n");
   dprintf(idx, " \n");
   dprintf(idx, " \n");

+ 6 - 3
src/dcc.c

@@ -204,7 +204,7 @@ greet_new_bot(int idx)
     dcc[idx].status |= STAT_LEAF;
     dcc[idx].status |= STAT_LEAF;
   dcc[idx].status |= STAT_LINKING;
   dcc[idx].status |= STAT_LINKING;
 
 
-  dprintf(idx, "v 1001500 %d Wraith %s <%s> %d %li %s\n", HANDLEN, egg_version, "-", conf.bot->localhub, buildts, egg_version);
+  dprintf(idx, "v 1001500 %d Wraith %s <%s> %d %li %d %s\n", HANDLEN, egg_version, "-", conf.bot->localhub, buildts, revision, egg_version);
 
 
   for (int i = 0; i < dcc_total; i++) {
   for (int i = 0; i < dcc_total; i++) {
     if (dcc[i].type && dcc[i].type == &DCC_FORK_BOT) {
     if (dcc[i].type && dcc[i].type == &DCC_FORK_BOT) {
@@ -251,6 +251,7 @@ bot_version(int idx, char *par)
   char x[1024] = "", *vversion = NULL;
   char x[1024] = "", *vversion = NULL;
   int vlocalhub = 0;
   int vlocalhub = 0;
   time_t vbuildts = 0;
   time_t vbuildts = 0;
+  int vrevision = 0;
 
 
   strlcpy(dcc[idx].u.bot->version, par, 120);
   strlcpy(dcc[idx].u.bot->version, par, 120);
   newsplit(&par);               /* 'ver' */
   newsplit(&par);               /* 'ver' */
@@ -260,6 +261,8 @@ bot_version(int idx, char *par)
     vlocalhub = atoi(newsplit(&par));
     vlocalhub = atoi(newsplit(&par));
   if (par[0])
   if (par[0])
     vbuildts = atol(newsplit(&par));
     vbuildts = atol(newsplit(&par));
+  if (par[0])
+    vrevision = atol(newsplit(&par));
   if (par[0])
   if (par[0])
     vversion = newsplit(&par);
     vversion = newsplit(&par);
 
 
@@ -273,7 +276,7 @@ bot_version(int idx, char *par)
       dcc[idx].hub = 1;
       dcc[idx].hub = 1;
     }
     }
 
 
-    botnet_send_nlinked(idx, dcc[idx].nick, conf.bot->nick, '!', vlocalhub, vbuildts, vversion);
+    botnet_send_nlinked(idx, dcc[idx].nick, conf.bot->nick, '!', vlocalhub, vbuildts, vrevision, vversion);
   } else {
   } else {
     putlog(LOG_BOTS, "*", "Linked to botnet.");
     putlog(LOG_BOTS, "*", "Linked to botnet.");
     chatout("*** Linked to botnet.\n");
     chatout("*** Linked to botnet.\n");
@@ -285,7 +288,7 @@ bot_version(int idx, char *par)
 
 
   touch_laston(dcc[idx].user, "linked", now);
   touch_laston(dcc[idx].user, "linked", now);
   dcc[idx].type = &DCC_BOT;
   dcc[idx].type = &DCC_BOT;
-  addbot(dcc[idx].nick, dcc[idx].nick, conf.bot->nick, '-', vlocalhub, vbuildts, vversion);
+  addbot(dcc[idx].nick, dcc[idx].nick, conf.bot->nick, '-', vlocalhub, vbuildts, vrevision, vversion);
   simple_snprintf(x, sizeof x, "v 1001500");
   simple_snprintf(x, sizeof x, "v 1001500");
   bot_shareupdate(idx, x);
   bot_shareupdate(idx, x);
   bot_share(idx, x);
   bot_share(idx, x);

+ 3 - 3
src/main.c

@@ -69,7 +69,7 @@
 extern int		optind;
 extern int		optind;
 
 
 const time_t 	buildts = BUILDTS;		/* build timestamp (UTC) */
 const time_t 	buildts = BUILDTS;		/* build timestamp (UTC) */
-const char	*revision = REVISION;
+const int	revision = REVISION;
 const char	*egg_version = "1.2.14-devel";
 const char	*egg_version = "1.2.14-devel";
 
 
 bool	used_B = 0;		/* did we get started with -B? */
 bool	used_B = 0;		/* did we get started with -B? */
@@ -395,7 +395,7 @@ static void dtx_arg(int& argc, char *argv[])
         egg_strftime(date, sizeof date, "%c %Z", gmtime(&buildts));
         egg_strftime(date, sizeof date, "%c %Z", gmtime(&buildts));
 	printf("%s\nBuild Date: %s (%s%lu%s)\n", version, date, BOLD(-1), buildts, BOLD_END(-1));
 	printf("%s\nBuild Date: %s (%s%lu%s)\n", version, date, BOLD(-1), buildts, BOLD_END(-1));
         printf("BuildOS: %s%s%s BuildArch: %s%s%s\n", BOLD(-1), BUILD_OS, BOLD_END(-1), BOLD(-1), BUILD_ARCH, BOLD_END(-1));
         printf("BuildOS: %s%s%s BuildArch: %s%s%s\n", BOLD(-1), BUILD_OS, BOLD_END(-1), BOLD(-1), BUILD_ARCH, BOLD_END(-1));
-        printf("Revision: %s\n", revision);
+        printf("Revision: %d\n", revision);
 	printf("pack: %d conf: %d settings_t: %d pad: %d\n", SIZE_PACK, SIZE_CONF, sizeof(settings_t), SIZE_PAD);
 	printf("pack: %d conf: %d settings_t: %d pad: %d\n", SIZE_PACK, SIZE_CONF, sizeof(settings_t), SIZE_PAD);
         if (settings.uname[0]) {
         if (settings.uname[0]) {
           sdebug++;
           sdebug++;
@@ -746,7 +746,7 @@ printf("out: %s\n", out);
 
 
   /* Version info! */
   /* Version info! */
   simple_snprintf(ver, sizeof ver, "[%s] Wraith %s", settings.packname, egg_version);
   simple_snprintf(ver, sizeof ver, "[%s] Wraith %s", settings.packname, egg_version);
-  egg_snprintf(version, sizeof version, "[%s] Wraith %s (%lu:%s)", settings.packname, egg_version, buildts, revision);
+  egg_snprintf(version, sizeof version, "[%s] Wraith %s (%lu:%d)", settings.packname, egg_version, buildts, revision);
 
 
   egg_memcpy(&nowtm, gmtime(&now), sizeof(struct tm));
   egg_memcpy(&nowtm, gmtime(&now), sizeof(struct tm));
   lastmin = nowtm.tm_min;
   lastmin = nowtm.tm_min;

+ 2 - 1
src/main.h

@@ -21,7 +21,8 @@ extern time_t		online_since, now, restart_time;
 extern uid_t		myuid;
 extern uid_t		myuid;
 extern pid_t            mypid;
 extern pid_t            mypid;
 extern const time_t	buildts;
 extern const time_t	buildts;
-extern const char	*egg_version, *revision;
+extern const int	revision;
+extern const char	*egg_version;
 
 
 void fatal(const char *, int);
 void fatal(const char *, int);
 
 

+ 3 - 3
src/mod/share.mod/share.c

@@ -1372,7 +1372,7 @@ finish_share(int idx)
   checkchans(1);                /* remove marked channels */
   checkchans(1);                /* remove marked channels */
   var_parse_my_botset();
   var_parse_my_botset();
   reaffirm_owners();            /* Make sure my owners are +a   */
   reaffirm_owners();            /* Make sure my owners are +a   */
-  updatebot(-1, dcc[j].nick, '+', 0, 0, NULL);
+  updatebot(-1, dcc[j].nick, '+', 0, 0, 0, NULL);
   send_sysinfo();
   send_sysinfo();
 
 
   /* Prevents the server connect from dumping JOIN #chan */
   /* Prevents the server connect from dumping JOIN #chan */
@@ -1421,7 +1421,7 @@ start_sending_users(int idx)
            i == DCCSEND_BADFN ? "BAD FILE" : i == DCCSEND_FEMPTY ? "EMPTY FILE" : "UNKNOWN REASON!");
            i == DCCSEND_BADFN ? "BAD FILE" : i == DCCSEND_FEMPTY ? "EMPTY FILE" : "UNKNOWN REASON!");
     dcc[idx].status &= ~(STAT_SHARE | STAT_SENDING | STAT_AGGRESSIVE);
     dcc[idx].status &= ~(STAT_SHARE | STAT_SENDING | STAT_AGGRESSIVE);
   } else {
   } else {
-    updatebot(-1, dcc[idx].nick, '+', 0, 0, NULL);
+    updatebot(-1, dcc[idx].nick, '+', 0, 0, 0, NULL);
     dcc[idx].status |= STAT_SENDING;
     dcc[idx].status |= STAT_SENDING;
     strcpy(dcc[j].host, dcc[idx].nick); /* Store bot's nick */
     strcpy(dcc[j].host, dcc[idx].nick); /* Store bot's nick */
     dprintf(idx, "s us %lu %d %lu\n", iptolong(getmyip()), dcc[j].port, dcc[j].u.xfer->length);
     dprintf(idx, "s us %lu %d %lu\n", iptolong(getmyip()), dcc[j].port, dcc[j].u.xfer->length);
@@ -1449,7 +1449,7 @@ cancel_user_xfer(int idx, void *x)
     idx = -idx;
     idx = -idx;
     k = 1;
     k = 1;
     /* turn off sharing flag */
     /* turn off sharing flag */
-    updatebot(-1, dcc[idx].nick, '-', 0, 0, NULL);
+    updatebot(-1, dcc[idx].nick, '-', 0, 0, 0, NULL);
   }
   }
   flush_tbuf(dcc[idx].nick);
   flush_tbuf(dcc[idx].nick);
 
 

+ 8 - 6
src/mod/update.mod/update.c

@@ -136,7 +136,7 @@ static void update_version(int idx, char *par)
 
 
   dcc[idx].status &= ~(STAT_GETTINGU | STAT_SENDINGU | STAT_OFFEREDU);
   dcc[idx].status &= ~(STAT_GETTINGU | STAT_SENDINGU | STAT_OFFEREDU);
   bot = findbot(dcc[idx].nick);
   bot = findbot(dcc[idx].nick);
-  if (bot && (bot->buildts < buildts) && (isupdatehub())) {
+  if (bot && (bot->revision < revision) && (isupdatehub())) {
     putlog(LOG_DEBUG, "@", "Asking %s to accept update from me", dcc[idx].nick);
     putlog(LOG_DEBUG, "@", "Asking %s to accept update from me", dcc[idx].nick);
     dprintf(idx, "sb u?\n");
     dprintf(idx, "sb u?\n");
     dcc[idx].status |= STAT_OFFEREDU;
     dcc[idx].status |= STAT_OFFEREDU;
@@ -172,8 +172,10 @@ static void got_nu(char *botnick, char *code, char *par)
 
 
 /* needupdate? curver */
 /* needupdate? curver */
    time_t newts = atol(newsplit(&par));
    time_t newts = atol(newsplit(&par));
+   newsplit(&par); //ts
+   int newrevision = atol(newsplit(&par));
 
 
-   if (newts > buildts) {
+   if (newrevision > revision) {
      if (!conf.bot->hub) {
      if (!conf.bot->hub) {
        dont_restructure = 1;
        dont_restructure = 1;
        putlog(LOG_MISC, "*", "Linking to %s for binary update.", botnick);
        putlog(LOG_MISC, "*", "Linking to %s for binary update.", botnick);
@@ -181,7 +183,7 @@ static void got_nu(char *botnick, char *code, char *par)
        usleep(1000 * 500);
        usleep(1000 * 500);
        botlink("", -3, botnick);
        botlink("", -3, botnick);
      } else 
      } else 
-       putlog(LOG_MISC, "*", "I need to be updated with %li", newts);
+       putlog(LOG_MISC, "*", "I need to be updated with %d", newrevision);
    }  
    }  
 }
 }
 
 
@@ -354,15 +356,15 @@ static void check_updates()
 
 
         dcc[i].status &= ~(STAT_GETTINGU | STAT_SENDINGU | STAT_OFFEREDU);
         dcc[i].status &= ~(STAT_GETTINGU | STAT_SENDINGU | STAT_OFFEREDU);
 
 
-        if (bot && (bot->buildts < buildts) && (isupdatehub())) {
-          putlog(LOG_DEBUG, "@", "Bot: %s has build %lu, offering them %lu", dcc[i].nick, bot->buildts, buildts);
+        if (bot && (bot->revision < revision) && (isupdatehub())) {
+          putlog(LOG_DEBUG, "@", "Bot: %s has build %d, offering them %d", dcc[i].nick, bot->revision, revision);
           dprintf(i, "sb u?\n");
           dprintf(i, "sb u?\n");
           dcc[i].status |= STAT_OFFEREDU;
           dcc[i].status |= STAT_OFFEREDU;
         }
         }
       }
       }
     }
     }
     /* send out notice to update remote bots ... */
     /* send out notice to update remote bots ... */
-    egg_snprintf(buf, sizeof buf, "nu? %lu", buildts);
+    egg_snprintf(buf, sizeof buf, "nu? %lu %d", buildts, revision);
     putallbots(buf);
     putallbots(buf);
   }
   }
 }
 }

+ 2 - 1
src/tandem.h

@@ -12,6 +12,7 @@ typedef struct tand_t_struct {
   struct tand_t_struct *uplink;
   struct tand_t_struct *uplink;
   struct tand_t_struct *next;
   struct tand_t_struct *next;
   time_t buildts;
   time_t buildts;
+  int revision;
   int localhub;
   int localhub;
   struct userrec* u;
   struct userrec* u;
   char *not_chans;
   char *not_chans;
@@ -58,7 +59,7 @@ void botnet_send_trace(int, char *, char *, char *);
 void botnet_send_unlink(int, char *, char *, char *, char *);
 void botnet_send_unlink(int, char *, char *, char *, char *);
 void botnet_send_link(int, char *, char *, char *);
 void botnet_send_link(int, char *, char *, char *);
 void botnet_send_update(int, tand_t *);
 void botnet_send_update(int, tand_t *);
-void botnet_send_nlinked(int, char *, char *, char, int, time_t, char *);
+void botnet_send_nlinked(int, char *, char *, char, int, time_t, int, char *);
 void botnet_send_reject(int, char *, char *, char *, char *, char *);
 void botnet_send_reject(int, char *, char *, char *, char *, char *);
 void botnet_send_log(int, const char *, int, const char *);
 void botnet_send_log(int, const char *, int, const char *);
 void botnet_send_zapf(int, const char *, const char *, const char *);
 void botnet_send_zapf(int, const char *, const char *, const char *);

+ 1 - 1
src/users.c

@@ -1002,7 +1002,7 @@ void autolink_cycle_hub(char *start)
       if (dcc[i].status & (STAT_OFFEREDU | STAT_GETTINGU | STAT_SENDINGU))
       if (dcc[i].status & (STAT_OFFEREDU | STAT_GETTINGU | STAT_SENDINGU))
         continue; /* lets let the binary update have it's peace. */
         continue; /* lets let the binary update have it's peace. */
 
 
-      if ((bot = findbot(dcc[i].nick)) && bot->buildts != buildts)
+      if ((bot = findbot(dcc[i].nick)) && bot->revision != revision)
         continue; /* same thing. */
         continue; /* same thing. */
 
 
       if (dcc[i].status & (STAT_SHARE | STAT_OFFERED | STAT_SENDING | STAT_GETTING)) {
       if (dcc[i].status & (STAT_SHARE | STAT_OFFERED | STAT_SENDING | STAT_GETTING)) {