Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to not to move the payload into a subdirectory on bag create #67

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

RKrahl
Copy link

@RKrahl RKrahl commented Sep 19, 2016

When creating a new bag, make_bag() takes the bag directory as argument. It assumes the current content of this bag directory to be the payload. It creates a new subdirectory data and moves all content of the bag directory into this new subdirectory.

Now, I have a use case, where I must access the payload read only when creating a new bag. I cannot move the payload. But I can arrange the payload to be already in the right place from the beginning. So I need an option to tell make_bag(): "Do not move the payload, it's already right there where it should be."

This PR adds this option: it adds a new optional flag move_payload to make_bag(). If this flag is True, the default, make_bag() behaves exactly as before: it creates the payload directory and moves the current content of the bag dir into this subdirectory. If the flag is False, make_bag() assumes that the payload directory is already at its place and verifies that the bag dir does not contain anything else then this payload directory. The PR furthermore makes the new flag accessible by a new command line option to bagit.py.

@RKrahl
Copy link
Author

RKrahl commented Oct 4, 2016

ping

The PR has been submitted two weeks ago without any reaction so far. Shall I submit an Issue for it to get noticed?

@kieranjol
Copy link
Contributor

kieranjol commented Oct 22, 2016

Hi!

I think that this is a really good idea and to me, your use case sounds valid.

I've only used the command line option, but

I've found that the tag-manifest.txt is not forming correctly. It seems to be identical to the manifest-md5.txt.

I'm attaching two files, fakedata is the original directory, fakedata_bagged has been created by using bagit.py --no-move-payload.

fakedata.zip
fakedata_bagged.zip

@RKrahl
Copy link
Author

RKrahl commented Oct 23, 2016

Hi Kieran!

Thank you for your comment! I can reproduce the problem that you describe. However, I'm not sure whether it is related with my PR. If I do the following:

  1. take your fakedata.zip,
  2. remove the intermediate data directory, e.g. moving the aaaa directory one level up, directly to fakedata and remove the now empty data directory,
  3. run bagit.py from the master branch, without --no-move-payload,

I also get the very same result that you describe. Something weird happens here, I'll look into this. Maybe you discovered another bug, unrelated to this issue.

@RKrahl
Copy link
Author

RKrahl commented Oct 23, 2016

@kieranjol, it turns out that the issue you discovered is indeed unrelated to this PR, see Bug #75.

johnscancella added a commit to johnscancella/bagit-python that referenced this pull request Oct 24, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants