]> git.cworth.org Git - sup/blobdiff - bin/sup-dump
sort labels in the dump
[sup] / bin / sup-dump
index 29f6d6ee7cb3ad4a3d95e3a381c77feca7b053a6..7b33be5d583b925da8241854f423f74f10bf0245 100755 (executable)
@@ -21,11 +21,10 @@ No options.
 EOS
 end
 
-index = Redwood::Index.new
+index = Redwood::Index.init
+Redwood::SourceManager.init
 index.load
 
-(1 ... index.index.reader.max_doc).each do |i|
-  next if index.index.deleted? i
-  d = index.index[i]
-  puts [d[:message_id], "(" + d[:label] + ")"] * " "
+index.each_message :load_spam => true, :load_deleted => true, :load_killed => true do |m|
+  puts "#{m.id} (#{m.labels.to_a.sort_by { |l| l.to_s } * ' '})"
 end