From e4aacb4eb2c1a76a70e5964448951ef995118d98 Mon Sep 17 00:00:00 2001 From: cjwatson <> Date: Sun, 17 Jul 2005 16:07:59 -0800 Subject: [PATCH] [project @ 2005-07-17 17:07:59 by cjwatson] Use readbug() interface to read from .summary files rather than .status files. --- migrate/debbugs-makeversions | 41 +++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/migrate/debbugs-makeversions b/migrate/debbugs-makeversions index 234d0fd..84b6943 100755 --- a/migrate/debbugs-makeversions +++ b/migrate/debbugs-makeversions @@ -3,13 +3,18 @@ # guesswork, based on Version: pseudo-headers and closing mails that look # like Debian changelogs. The latter in particular is somewhat heuristic. -use strict; +my $config_path = '/etc/debbugs'; +my $lib_path = '/usr/lib/debbugs'; + +require "$config_path/config"; +require "$lib_path/errorlib"; + use Debbugs::Log; use Debbugs::MIME; if (@ARGV != 2) { print <= - # (stat "$db/$dir/$file")[9]; + # (stat "$gSpoolDir/$db/$dir/$file")[9]; print "Processing $bug ...\n" if $ENV{DEBBUGS_VERBOSE}; - open STATUS, "$db/$dir/$bug.status" or next; - for 1 .. 6; # done is field 7 - chomp (my $done = ); - ; # mergedwith is field 9 - chomp (my $mergedwith = ); - close STATUS; + my $status = readbug($bug, $db); + next unless defined $status; - my ($found_versions, $fixed_versions) = getbuginfo("$db/$dir/$file"); + my ($found_versions, $fixed_versions) = + getbuginfo("$gSpoolDir/$db/$dir/$file"); - if (length $mergedwith) { - for my $merge (split ' ', $mergedwith) { + if (length $status->{mergedwith}) { + for my $merge (split ' ', $status->{mergedwith}) { $merge =~ /(..)$/; my $mergehash = $1; my ($mfound, $mfixed) = - getbuginfo("$db/$mergehash/$merge.log"); + getbuginfo("$gSpoolDir/$db/$mergehash/$merge.log"); mergeinto($found_versions, $mfound); mergeinto($fixed_versions, $mfixed); } } - @$fixed_versions = () unless length $done; + @$fixed_versions = () unless length $status->{done}; - for my $out ($bug, (split ' ', $mergedwith)) { + for my $out ($bug, (split ' ', $status->{mergedwith})) { $out =~ /(..)$/; my $outhash = $1; -- 2.39.2