From a2d83967182e1943c03ede97fae6bec7388067ab Mon Sep 17 00:00:00 2001
From: ajt <>
Date: Thu, 7 Nov 2002 11:42:35 -0800
Subject: [PATCH] [project @ 2002-11-07 11:42:35 by ajt] make expire update
 index.archive.realtime move the debbugs.trace stuff from expire into errorlib

---
 scripts/errorlib.in | 15 ++++++++++++++-
 scripts/expire.in   |  6 ++----
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/scripts/errorlib.in b/scripts/errorlib.in
index 34c037a2..26e2fa3e 100755
--- a/scripts/errorlib.in
+++ b/scripts/errorlib.in
@@ -1,5 +1,5 @@
 # -*- perl -*-
-# $Id: errorlib.in,v 1.13 2002/11/05 08:33:24 ajt Exp $
+# $Id: errorlib.in,v 1.14 2002/11/07 11:42:35 ajt Exp $
 
 sub F_SETLK { 6; } sub F_WRLCK{ 1; }
 $flockstruct= 'sslll'; # And there ought to be something for this too.
@@ -136,6 +136,19 @@ sub update_realtime {
 	return $line;
 }
 
+sub bughook_archive {
+	my $ref = shift;
+	&filelock("debbugs.trace.lock");
+	&appendfile("debbugs.trace","archive $ref\n");
+	my $line = update_realtime(
+		"/org/bugs.debian.org/spool/index.db.realtime", 
+		$ref,
+		"REMOVE");
+	update_realtime("/org/bugs.debian.org/spool/index.archive.realtime",
+		$ref, $line);
+	&unfilelock;
+}	
+
 sub bughook {
 	my ( $type, $ref ) = ( shift, shift );
 	&filelock("debbugs.trace.lock");
diff --git a/scripts/expire.in b/scripts/expire.in
index 70097cbd..224fe60d 100755
--- a/scripts/expire.in
+++ b/scripts/expire.in
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-# $Id: expire.in,v 1.11 2002/11/02 09:21:43 ajt Exp $
+# $Id: expire.in,v 1.12 2002/11/07 11:42:35 ajt Exp $
 
 # Load modules and set envirnment
 use File::Copy;
@@ -79,9 +79,7 @@ while (length($ref=shift(@list))) {
 		}
 		unlink("db-h/$dir/$mref.log", "db-h/$dir/$mref.status", "db-h/$dir/$mref.report");
 		print("deleted $mref (from $ref)\n") || &quit("output old: $!");
-		&filelock("debbugs.trace.lock");
-		&appendfile("debbugs.trace","archive $mref\n");
-		&unfilelock;
+		bughook_archive($mref);
         }
     }
 	print "$ref unlocking $bfound\n" if $debug;
-- 
2.39.5