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

Paths within checksum should be evaluated relative to the checksum file directory, not the current working directory #10

Open
mattalxndr opened this issue Dec 4, 2021 · 0 comments

Comments

@mattalxndr
Copy link

mattalxndr commented Dec 4, 2021

Changing directories before I verify is not a big deal when using a shell and verifying manually. But if I'm reaching for Python, chances are I'm either verifying a large number of multiple packages, or I'm writing a script to automate.

Either way, it seems like something a library should be handling for me.

Currently, this is required (I'm sure others could do it with less mess):

checksum_path = './relpath/package.md5'
orig = os.currdir
os.chdir(os.path.dirname(checksum_path))
filehash.verify_checksums(os.path.basename(checksum_path))
os.chdir(orig)

If checksums were always evaluated from the directory they're in, I could do this:

checksum_path = './relpath/package.md5'
filehash.verify_checksums(checksum_path)
@mattalxndr mattalxndr changed the title verify_checksums and verify_sfv methods require changing to the checksum file's directory manually Paths within checksum should be evaluated relative to the checksum file directory, not the current working directory Dec 4, 2021
mattalxndr added a commit to mattalxndr/filehash that referenced this issue Dec 4, 2021
mattalxndr added a commit to mattalxndr/filehash that referenced this issue Dec 4, 2021
mattalxndr added a commit to mattalxndr/filehash that referenced this issue Dec 4, 2021
mattalxndr added a commit to mattalxndr/filehash that referenced this issue Dec 4, 2021
mattalxndr added a commit to mattalxndr/filehash that referenced this issue Dec 4, 2021
cyanea-bt added a commit to cyanea-bt/filehash that referenced this issue Jun 5, 2024
fix issue leonidessaguisagjr#10: Evaluate file paths from checksum dir
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

1 participant