-
Notifications
You must be signed in to change notification settings - Fork 83
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
missing path to file #121
Comments
This works because the assumption is that For the bagit-profiles-validator code, for the same/similar purpose, there's this code, which checks paths relative to # Return true if any of the pattern fnmatches a file path
def fnmatch_any(f, pats):
for pat in pats:
if fnmatch(f, pat):
return True
return False
# Find tag files
def find_tag_files(bag_dir):
for root, _, basenames in walk(bag_dir):
reldir = relpath(root, bag_dir)
for basename in basenames:
if fnmatch(reldir, 'data*') or (reldir == '.' and fnmatch_any(basename,
['manifest-*.txt', 'bag-info.txt', 'tagmanifest-*.txt', 'bagit.txt', 'fetch.txt'])):
continue
fpath = join(root, basename)
if isfile(fpath):
yield fpath |
Note also that I want to change this as part of the upcoming work @edsu and I are planning so the code can be used with non-POSIX filesystems where the notion of current directory doesn't exist. |
Thanks for the response. I'll have to check my code, because I use bagit as an imported module, usually with cwd != bagdir, so that may lead to unexpected results. IMHO, this behavior should be changed. |
In this line:
bagit-python/bagit.py
Line 1315 in c39b650
I didn't test this, but shouldn't the argument to
os.path.filename
be prefixed withbag_dir
?The text was updated successfully, but these errors were encountered: