LibreCat / Catmandu-BagIt

Catmandu module for working with BagIt packages
Other
1 stars 1 forks source link

support key "files" in Catmandu::Exporter::BagIt #7

Closed nicolasfranck closed 7 years ago

nicolasfranck commented 7 years ago

Now the Catmandu::Exporter::BagIt creates bagits from files that are referenced by url ( using the "fetch" option in bagit ).

Shouldn't there be also a key "files" for local files?

$exporter->add({
  _id => "/home/njfranck/bagit1",
  files => [
     "/tmp/file1.tif" => "data/file1.tif",
     "/tmp/file2.tif" => "data/file2.tif"
  ]
});

I"ll send a pull request when ok.

nicolasfranck commented 7 years ago

If you provide a file url:

$exporter->add({
  _id => "/home/njfranck/bagit1",
  fetch => [
    {
        "file:///tmp/test.tif" => "data/test.tif"
    }
  }
);

the file is downloaded, but cannot be mirrored:

failed to mirror file:///tmp/test.tif to /var/folders/bw/97qdtwtx4r5cyk7567bm1jj00000gn/T/RYe3HYyJXR.tmp : 304 GET /tmp/test.tif
phochste commented 7 years ago

Indeed, this is not yet supported. It would be a cool feature to be able to fetch also local files using the 'fetch' mechanism