3 # Take two input parameters: a collection uuid and reason
4 # Get "src_collection" with the given uuid
5 # Create a new collection with:
6 # src_collection.manifest_text as "invalid_manifest_text.txt"
7 # Locators from src_collection.manifest_text as "salvaged_data"
8 # Update src_collection:
9 # Set src_collection.manifest_text to: ""
10 # Append to src_collection.name: " (reason; salvaged data at new_collection.uuid)"
11 # Set portable_data_hash to "d41d8cd98f00b204e9800998ecf8427e+0"
14 require './lib/salvage_collection'
16 opts = Trollop::options do
18 banner "Usage: salvage_collection.rb " +
21 opt :uuid, "uuid of the collection to be salvaged.", type: :string, required: true
22 opt :reason, "Reason for salvaging.", type: :string, required: false
25 # Salvage the collection with the given uuid
26 SalvageCollection.salvage_collection opts.uuid, opts.reason