[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] Groups Not Being Removed



I have a revised patch instead of the other one, please try this one (if
you've already applied the other one, back it out with patch -R):

Index: texpire.c
===================================================================
RCS file: /var/CVS/leafnode-2/texpire.c,v
retrieving revision 1.41
retrieving revision 1.43
diff -u -r1.41 -r1.43
--- texpire.c	3 Nov 2003 20:05:23 -0000	1.41
+++ texpire.c	16 Dec 2003 23:27:13 -0000	1.43
@@ -134,7 +134,8 @@
 	if (errno != ENOENT)
 	    ln_log(LNLOG_SERR, LNLOG_CGROUP, "unlink %s/%s: %m", logprefix, file);
     } else {
-	ln_log(LNLOG_SDEBUG, LNLOG_CGROUP, "unlinked %s/%s", logprefix, file);
+	if (debugmode & DEBUG_EXPIRE)
+	    ln_log(LNLOG_SDEBUG, LNLOG_CGROUP, "unlinked %s/%s", logprefix, file);
     }
 }
 
@@ -763,6 +764,7 @@
        * twice? */
     unsigned long first, last, i, totalthreads;
     struct thread *threadlist;
+    const char *appendlog = NULL;
 
     deleted = kept = 0;
 
@@ -835,21 +837,15 @@
 	    g->last = last;
 	}
     }
-    if (dryrun)
-	ln_log(LNLOG_SINFO, LNLOG_CGROUP,
-	       "%s: running without dry-run "
-	       "will delete %lu and keep %lu articles", n,
-	       deleted, kept - deleted);
-    else
-	ln_log(LNLOG_SINFO, LNLOG_CGROUP,
-	       "%s: %lu articles deleted, " "%lu kept", n, deleted, kept);
-    if (!kept) {
+
+    if (!dryrun && !kept) {
 	texpire_log_unlink(".overview", gdir);
 
 	if ((is_interesting(n) == 0)
             && (is_dormant(n) == 0))
 	{
 	    texpire_log_unlink(LASTPOSTING, gdir);
+	    appendlog = "removed directory";
 	    /* delete directory and empty parent directories */
 	    for (;;) {
 		struct stat st;
@@ -861,6 +857,9 @@
 				"rmdir(\"%s\") failed: %m", gdir);
 			break;
 		    }
+		} else {
+		    if (debugmode & DEBUG_EXPIRE)
+			ln_log(LNLOG_SDEBUG, LNLOG_CGROUP, "%s: removed directory %s", n, gdir);
 		}
 		if (0 == stat("leaf.node", &st))
 		    break;
@@ -870,8 +869,23 @@
 		    return;
 		}
 	    }
+	} else {
+	    if (is_interesting(n)) appendlog = "interesting";
+	    if (is_dormant(n)) appendlog = "dormant";
 	}
     }
+
+    if (dryrun)
+	ln_log(LNLOG_SINFO, LNLOG_CGROUP,
+	       "%s: running without dry-run "
+	       "will delete %lu and keep %lu articles", n,
+	       deleted, kept - deleted);
+    else
+	ln_log(LNLOG_SINFO, LNLOG_CGROUP,
+	       "%s: %lu articles deleted, %lu kept%s%s", n, deleted, kept,
+	       appendlog == NULL ? "" : ", ",
+	       appendlog == NULL ? "" : appendlog);
+
     /* Once we're done and there's something left we have to update the
      * .overview file. Otherwise unsubscribed groups will never be
      * deleted.

-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list