LibraryOfCongress / bagit-python

Work with BagIt packages from Python.
http://libraryofcongress.github.io/bagit-python
216 stars 85 forks source link

Updating Bag Manifests #61

Open ntallman opened 8 years ago

ntallman commented 8 years ago

Is it possible to use bagit-python from the command line to update bag manifests? Or is that only possible through a python script? My workflow involved adding additional information to bag-info.txt after bagging which causes a checksum mismatch with the tag manifest. I'd like to be able to re-generate the manifests after this step. Thanks!

ntallman commented 8 years ago

I solved the problem by changing the workflow, but I'd still be interested to know if this is doable. Thanks.

johnscancella commented 8 years ago

It does not currently have this ability in the command line. However, the save method in the library does update the tag manifests. see https://github.com/LibraryOfCongress/bagit-python/blob/master/bagit.py#L263-L319

acdha commented 7 years ago

One useful case for this: upgrading bags to add stronger manifests – ideally we could avoid reading the files more than once by doing something like calculating all of the hashes at the same time, verifying the existing ones, and saving the new ones.

stain commented 3 years ago

+1 to add the option to do an in-place update e.g. update manifests and bag-info.txt after some files have changed in existing bagit structure.

At least a warning should be printed if bagit.py is invoked on a folder already containing bagit.txt - of course a BagIt can contain a BagIt but it might not be what they meant.