commit 4b9385ed38a426bbfda833ae5993d36e36582a2f
parent 54d02b877755ee295d34556aa3c310290759e062
Author: William Morgan <wmorgan-sup@masanjin.net>
Date: Mon, 18 Jan 2010 11:53:21 -0500
add --force option to sup-convert-ferret-index
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/bin/sup-convert-ferret-index b/bin/sup-convert-ferret-index
@@ -25,6 +25,7 @@ Options:
EOS
opt :verbose, "Be verbose", :short => "-v"
opt :dry_run, "Don't actually do anything, just print out what would happen.", :short => "-n"
+ opt :force, "Force overwrite of an old Xapian index"
opt :version, "Show version information", :short => :none
end
@@ -50,7 +51,7 @@ end
Redwood::start
index = Redwood::Index.init
-Trollop::die "you appear to already have a Xapian index--delete #{File.join(Redwood::BASE_DIR, "xapian")} if you really want to do this" unless Redwood::Index.is_a_deprecated_ferret_index?
+Trollop::die "you appear to already have a Xapian index--delete #{File.join(Redwood::BASE_DIR, "xapian")} or use --force if you really want to do this" unless Redwood::Index.is_a_deprecated_ferret_index? || $opts[:force]
puts "## Step one: back up all message state to #{STATE_BACKUP_FN}"
run "#{build_cmd 'sup-dump'} --index ferret > #{STATE_BACKUP_FN}"