Opened 7 years ago

Closed 6 years ago

#55805 closed defect (fixed)

multimarkdown: Wrong path in markdown script

Reported by: angelog0 (Angelo Graziosi) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: multimarkdown

Description

I have installed the 'multimarkdown' port to be used with Emacs.

When I define the markdown-command in Emacs

(setq markdown-command "/opt/local/bin/markdown")

it fails with

multimarkdown not found...

Indeed the shell script, 'markdown', sets the wrong path

[...]
# Be sure to include multimarkdown in our PATH
export PATH="$PWD:/usr/local/bin:$PATH"

it assumes that the 'multimarkdown' executable is installed in '/usr/local/bin'.

I think that for MacPorts you should patch it so that the PATH points to the MacPorts PATH

--- markdown.bkp	2017-11-20 20:47:17.000000000 +0100
+++ markdown	2018-02-11 17:44:30.000000000 +0100
@@ -8,7 +8,7 @@
 #

 # Be sure to include multimarkdown in our PATH
-export PATH="$PWD:/usr/local/bin:$PATH"
+export PATH="$PWD:/opt/local/bin:$PATH"

 which multimarkdown > /dev/null
 if [ $? = 1 ]

Ciao, Angelo.

Change History (5)

comment:1 Changed 7 years ago by mf2k (Frank Schima)

Keywords: PATH usr opt removed

comment:2 in reply to:  description Changed 7 years ago by angelog0 (Angelo Graziosi)

Replying to angelog0:

I think that for MacPorts you should patch it so that the PATH points to the MacPorts PATH

--- markdown.bkp	2017-11-20 20:47:17.000000000 +0100
+++ markdown	2018-02-11 17:44:30.000000000 +0100
@@ -8,7 +8,7 @@
 #

 # Be sure to include multimarkdown in our PATH
-export PATH="$PWD:/usr/local/bin:$PATH"
+export PATH="$PWD:/opt/local/bin:$PATH"

 which multimarkdown > /dev/null
 if [ $? = 1 ]

Also this works

--- markdown.bkp	2017-11-20 20:47:17.000000000 +0100
+++ markdown	2018-02-11 22:15:57.000000000 +0100
@@ -7,8 +7,10 @@
 # Pass arguments on to the binary to convert text to XHTML
 #

+pwd="${0%/*}"
+
 # Be sure to include multimarkdown in our PATH
-export PATH="$PWD:/usr/local/bin:$PATH"
+export PATH="$pwd:/usr/local/bin:$PATH"

 which multimarkdown > /dev/null
 if [ $? = 1 ]

Ciao, Angelo.

comment:3 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: Wrong path in markdown scriptmultimarkdown: Wrong path in markdown script

comment:4 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to ryandesign
Status: newaccepted

This is not a MacPorts-specific problem, so I've reported it to the developers with a fix. I'll add the fix to the port when I update it to 6.4.0.

comment:5 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In 20826cc94f6d58f09e63da6e1b8462fc26ceabb4/macports-ports (master):

multimarkdown: Update to 6.4.0

Closes: #57106

Fix PATH in convenience scripts.

Closes: #55805

Use "command -v" instead of "which" because it is POSIX.

Report bugs upstream and add upstream URLs as comments.

Note: See TracTickets for help on using tickets.