Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005403OCamlOCaml generalpublic2011-11-19 23:072012-02-03 17:06
ReporterDrakken 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version3.12.1 
Target VersionFixed in Version3.13.0+dev 
Summary0005403: Bugfixes for emacs/Makefile
DescriptionThere are several problems with the Makefile in the emacs subdirectory of the ocaml distribution.

To reproduce the problem: Log in as root and run "make install" in the emacs directory.

General (targets "install" and "simple-install"):
* The script doesn't work if emacs isn't in root's path. (the search for site-lisp directories fails.)

In the "install" target:
* The "p" in the sed expression is an argument to the s command that deletes quotation marks, so any unquoted directory names would not be printed.
* The sed expression prints *all* matching directories, but "test -d" expects only one.
* The names are stored in variable xxx, but the test looks for them in the positional parameter $2 (which I don't think is set anyway).
* The "set" syntax for xxx is incorrect. (/bin/sh uses "=")
Additional InformationThis report replaces Ocamlbuild report 0005402.

See the attached file for the following changes:

> emacs:
> @if test "`which $(EMACS) 2>/dev/null`" = ""; then \
> echo `which $(EMACS) 2>&1`; \
> exit 2; \
> fi

< install:
> install: emacs

< simple-install:
> simple-install: emacs

< set xxx `($(EMACS) --batch --eval "(mapcar 'print load-path)") \
> emacsdir=`($(EMACS) --batch --eval "(mapcar 'print load-path)") \

< if test "$$2" = ""; then \
> if test "$$emacsdir" = ""; then \

< sed -n -e '/\/site-lisp/s/"//gp'`; \
> sed -n -e '/\/site-lisp/{s/"//g;p;q}'`; \

< $(MAKE) EMACSDIR="$$2" simple-install; \
> $(MAKE) EMACSDIR="$$emacsdir" simple-install; \
TagsNo tags attached.
Attached Files? file icon Makefile [^] (2,805 bytes) 2011-11-19 23:07 [Show Content]

- Relationships

-  Notes
(0006875)
doligez (administrator)
2012-02-03 17:06

Thanks for your report.

> * The script doesn't work if emacs isn't in root's path. (the search for site-lisp directories fails.)

OK, we should test for emacs's presence. But currently, if you "make install-el EMACSDIR=...", then emacs is not needed. I have changed the Makefile to give a better error message if emacs is needed and cannot be found in the path.

> * The "p" in the sed expression is an argument to the s command that deletes quotation marks, so any unquoted directory names would not be printed.

This is entirely theoretical because emacs quotes them all anyway.

> * The sed expression prints *all* matching directories, but "test -d" expects only one.

But we give only one to "test -d" : the result of the sed expression is not used as is.

> * The names are stored in variable xxx, but the test looks for them in the positional parameter $2 (which I don't think is set anyway).

The names are not stored in variable xxx. Please refer to the shell's documentation for information about the "set" command.

> * The "set" syntax for xxx is incorrect. (/bin/sh uses "=")

The syntax is correct. We are not trying to set the variable xxx here.


Fixed in trunk [3.13.0] (commit 12118)

- Issue History
Date Modified Username Field Change
2011-11-19 23:07 Drakken New Issue
2011-11-19 23:07 Drakken File Added: Makefile
2012-02-03 17:06 doligez Note Added: 0006875
2012-02-03 17:06 doligez Status new => closed
2012-02-03 17:06 doligez Resolution open => fixed
2012-02-03 17:06 doligez Fixed in Version => 3.13.0+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker