Merge lp:~vorlon/linaro-image-tools/hwpack-always-from-PATH into lp:linaro-image-tools/11.11
Proposed by
Steve Langasek
Status: | Merged |
---|---|
Merged at revision: | 140 |
Proposed branch: | lp:~vorlon/linaro-image-tools/hwpack-always-from-PATH |
Merge into: | lp:linaro-image-tools/11.11 |
Diff against target: |
23 lines (+3/-3) 1 file modified
linaro-media-create (+3/-3) |
To merge this branch: | bzr merge lp:~vorlon/linaro-image-tools/hwpack-always-from-PATH |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Linaro Maintainers | Pending | ||
Review via email:
|
Description of the change
Handling of the hwpack stage is wrong when the tools are on the path instead of being invoked as /path/to/
To post a comment you must log in.
It seems a bit ugly to put the directory on the path just so we can say 'which linaro- hwpack- install' later. Wouldn't it be better to say at the start of the script "$(dirname "$(readlink -f "$0")")"
SCRIPTPATH=
and then HWPACK_ INSTALL= "$SCRIPTPATH/ linaro- hwpack- install"
LINARO_
?
(This should work whether linaro-media-create is on the PATH or not.)
PS: I think that "when the tools are on the path [...] because dirname returns '.' in this case" is only true when "." is on your PATH and that is where the tools were found. The use of readlink is what handles this case in my proposal. (This avoids creating an implicit requirement not to change current working directory between starting the script and setting LINARO_ HWPACK_ INSTALL, incidentally.)
If you do prefer your approach then this line needs quotes: HWPACK_ INSTALL= $(which linaro- hwpack- install)
LINARO_