Bug 686863 - ghostscript interpreter name hard coded in scripts
Summary: ghostscript interpreter name hard coded in scripts
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Build Process (show other bugs)
Version: master
Hardware: PC Linux
: P5 minor
Assignee: Ralph Giles
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-09 03:00 UTC by Joao P Matos
Modified: 2009-11-18 16:09 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
patch-686863 (665 bytes, patch)
2009-11-18 13:32 UTC, Vince Dean
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joao P Matos 2003-05-09 03:00:28 UTC
Although the configure script provides the --with-gs option to set the
interpreter name the 'gs' name is hard coded in scripts such as ps2pdf.

Additionally the 'gs' used by such scripts depends on the $PATH.

This is a minor annoyance if one tries the AFPL version installing it in
/usr/local and leaves the distribution version in /usr.
Comment 1 Ralph Giles 2004-06-17 11:15:03 UTC
Ok, raph and I had a smart idea for how to do this is a way that doesn't look
egregious from the point of the other builds.

Just add:

# This definition is changed on install to match the
# executable name set in the makefile
GS_EXECUTABLE=gs

And then just use sed to update then in unixinst.mak.
Comment 2 Ralph Giles 2004-09-08 00:01:03 UTC
I've committed the proposed fix to HEAD. It should be part of the 8.50 release,
or 8.32 if we do another beta between here and there.
Comment 3 Vince Dean 2009-11-18 13:29:52 UTC
I believe this is broken again.  When I build and install,
I see code fragments like the following at the beginning
of ps2pdfwr and similar scripts:

   # This definition is changed on install to match the
   # executable name set in the makefile
   GS_EXECUTABLE=gs
   gs="`dirname $0`/$GS_EXECUTABLE"
   if test ! -x "$gs"; then
           gs="$GS_EXECUTABLE"
   fi
   GS_EXECUTABLE=gs

The second assignment to GS_EXECUTABLE undoes the work of the
previous few lines, so that we will always use the version
of gs that is in the user's PATH, rather than preferring the
version of gs in the same directory as ps2pdfwr, as intended.

I think this is an interaction between two fixes:

686863 ghostscript interpreter name hard coded in scripts 

689318 Using full path in scripts like pdf2ps etc.?

The sed code in base/unixinst.mak incorrectly modifies
both of the assignments to GS_EXECUTABLE in the
code fragment above, where it should only modify the
first one.

I believe this can be fixed by modifying base/unixinst.mak,
according to the attached patch.
Comment 4 Vince Dean 2009-11-18 13:32:27 UTC
Created attachment 5684 [details]
patch-686863

Proposed fix.
Comment 5 Ralph Giles 2009-11-18 16:09:53 UTC
You're right. Thanks for the patch. I've applied in r10349.