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

Makefile: Replace vbatts/pandoc with a PANDOC variable #428

Merged
merged 2 commits into from
May 7, 2016

Conversation

wking
Copy link
Contributor

@wking wking commented May 6, 2016

And use command -v instead of which. Details in the commit messages.

wking added 2 commits May 6, 2016 14:48
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)
Copy link
Member

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.

Copy link
Contributor

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?

@vbatts
Copy link
Member

vbatts commented May 7, 2016

LGTM

@vbatts vbatts merged commit 040712a into opencontainers:master May 7, 2016
@wking wking deleted the tk/system-pandoc branch May 13, 2016 17:32
@@ -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))
Copy link
Contributor

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?

Copy link
Contributor Author

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.

wking added a commit to wking/opencontainer-runtime-spec that referenced this pull request May 24, 2016
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>
Mashimiao pushed a commit to Mashimiao/specs that referenced this pull request Aug 19, 2016
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>
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

Successfully merging this pull request may close these issues.

None yet

4 participants