Merge lp:~mabac/linaro-image-tools/chdir-for-hashverify into lp:linaro-image-tools/11.11
Proposed by
Mattias Backman
Status: | Merged |
---|---|
Approved by: | James Westby |
Approved revision: | 362 |
Merged at revision: | 360 |
Proposed branch: | lp:~mabac/linaro-image-tools/chdir-for-hashverify |
Merge into: | lp:linaro-image-tools/11.11 |
Diff against target: |
175 lines (+73/-13) 5 files modified
linaro-media-create (+6/-9) linaro_image_tools/cmd_runner.py (+2/-2) linaro_image_tools/tests/test_pyflakes.py (+2/-2) linaro_image_tools/tests/test_utils.py (+37/-0) linaro_image_tools/utils.py (+26/-0) |
To merge this branch: | bzr merge lp:~mabac/linaro-image-tools/chdir-for-hashverify |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Westby (community) | Approve | ||
Review via email: mp+65221@code.launchpad.net |
Description of the change
Hi,
This change makes sure that the sha1sums command in linaro-media-create is run from the directory of the hash file to be verified.
This is needed for instance for FetchImage which will pass the full path of the hash file to l-m-c. I have found no way to make sha1sums check for the files in anything but the current working dir.
The change is implemented by adding a WorkingDirChanger object that acts as a context manager (the thing with the __enter__ and __exit__ methods which should make sure that the old wd is restored just after the call to sha1sums.
Thanks,
Mattias
To post a comment you must log in.
Hi Mattias,
Are you aware of the cwd argument to cmd_runner.run (via subprocess)?
Would that be suitable for changing the directory here?
Thanks,
James