-
Notifications
You must be signed in to change notification settings - Fork 537
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
Makefile: Replace vbatts/pandoc with a PANDOC variable #428
Conversation
The former is in POSIX [1], but the latter is not [2]. [1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html [2]: http://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html Signed-off-by: W. Trevor King <wking@tremily.us>
Defaulting to whichever PANDOC is first in your path. This mirrors the existing DOCKER handling. Folks who want to use the old path can run: $ make PANDOC=vbatts/pandoc ... I'm not sure why 4ee036f (*: printable documents, 2015-12-09, opencontainers#263) went with a variable for 'docker' but a hard-coded path for 'pandoc'. I expect it was just oversight. Signed-off-by: W. Trevor King <wking@tremily.us>
@@ -1,5 +1,6 @@ | |||
|
|||
DOCKER ?= $(shell which docker) | |||
DOCKER ?= $(shell command -v docker) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wking It looks like it should work fine, but I got error make: command: Command not found
, I have to change it back to which
, any insight on this? Maybe related to bash version?
LGTM |
@@ -32,7 +33,7 @@ output/docs.pdf: $(DOC_FILES) | |||
-v $(shell pwd)/:/input/:ro \ | |||
-v $(shell pwd)/output/:/output/ \ | |||
-u $(shell id -u) \ | |||
vbatts/pandoc -f markdown_github -t latex -o /$@ $(patsubst %,/input/%,$(DOC_FILES)) | |||
$(PANDOC) -f markdown_github -t latex -o /$@ $(patsubst %,/input/%,$(DOC_FILES)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just curious before any test or investigation, $(PANDOC) is a path to the pandoc executive when default, but we expect pandoc image here, how this replacement works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Thu, May 19, 2016 at 08:40:21PM -0700, Lai Jiangshan wrote:
- vbatts/pandoc -f markdown_github -t latex -o /$@
$(patsubst %,/input/%,$ (DOC_FILES))$(PANDOC) -f markdown_github -t latex -o /$ @$(patsubst %,/input/%,$ (DOC_FILES))I'm just curious before any test or investigation, $(PANDOC) is a
path to the pandoc executive when default, but we expect
pandoc image here, how this replacement works?
Oops, I had missed this. See #440 for some paths forward.
In dc9daf9 (Makefile: Replace vbatts/pandoc with a PANDOC variable 2016-05-06, opencontainers#428) I'd misunderstood vbatts/pandoc as a call to a locally-installed pandoc, when it's actually the name of a Docker image [1,2]. With this commit, we prefer a local pandoc if one exists, fall back to Docker and vbatts/pandoc if a local 'docker' exists, and raise an error if neither 'pandoc' nor 'docker' exist. [1]: opencontainers#440 [2]: opencontainers#428 (comment) Reported-by: Qiang Huang <h.huangqiang@huawei.com> Reported-by: Lai Jiangshan <jiangshanlai@gmail.com> Signed-off-by: W. Trevor King <wking@tremily.us>
In dc9daf9 (Makefile: Replace vbatts/pandoc with a PANDOC variable 2016-05-06, opencontainers#428) I'd misunderstood vbatts/pandoc as a call to a locally-installed pandoc, when it's actually the name of a Docker image [1,2]. With this commit, we prefer a local pandoc if one exists, fall back to Docker and vbatts/pandoc if a local 'docker' exists, and raise an error if neither 'pandoc' nor 'docker' exist. [1]: opencontainers#440 [2]: opencontainers#428 (comment) Reported-by: Qiang Huang <h.huangqiang@huawei.com> Reported-by: Lai Jiangshan <jiangshanlai@gmail.com> Signed-off-by: W. Trevor King <wking@tremily.us>
And use
command -v
instead ofwhich
. Details in the commit messages.