Skip to content

The selection of tag files is broken #75

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

Closed
RKrahl opened this issue Oct 23, 2016 · 2 comments
Closed

The selection of tag files is broken #75

RKrahl opened this issue Oct 23, 2016 · 2 comments

Comments

@RKrahl
Copy link

RKrahl commented Oct 23, 2016

The function _find_tag_files() that selects files to be added to tagmanifest files as added by PR #69 is broken. The intention of this function was to select all files in the bag directory excluding only the payload directory and the tagmanifest files. What the logic in this function actually does, is to select all files excluding files in any directory whose name ends with "data". This is broken in two different ways:

  1. if the bag directory itself ends with "data", all files in this bag directory are excluded, although bag-info.txt, bagit.txt, and manifest-*.txt should in particular be added.
  2. if the payload directory contains any subdirectories not ending with "data", files in this subdirectories are selected for inclusion to the tagmanifest files, although these files, being part of the payload, should not be added.

This bug has been discovered by Kieran O'Leary in the discussion of PR #67.

RKrahl added a commit to RKrahl/bagit-python that referenced this issue Oct 24, 2016
RKrahl added a commit to RKrahl/bagit-python that referenced this issue Oct 24, 2016
@RKrahl RKrahl mentioned this issue Oct 24, 2016
@johnscancella
Copy link
Contributor

johnscancella commented Oct 24, 2016

It is only half broken since 2 is incorrect. https://tools.ietf.org/html/draft-kunze-bagit-14#section-2 clearly shows that other directories are allowed in the bag root directory and are to be treated as tags.

@RKrahl
Copy link
Author

RKrahl commented Oct 24, 2016

Sure, but only if they are not subdirectories of the payload directory. In this case, they are not to be considered as tag files, but rather being part of the payload.

@johnscancella johnscancella changed the title The selection of tag files is thoroughly broken The selection of tag files is broken Oct 24, 2016
@johnscancella johnscancella mentioned this issue Oct 24, 2016
johnscancella added a commit that referenced this issue 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

No branches or pull requests

2 participants