author | Junio C Hamano <gitster@pobox.com> | |
Thu, 5 Feb 2009 08:04:17 +0000 (00:04 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 5 Feb 2009 08:28:43 +0000 (00:28 -0800) | ||
commit | 0c0ead7e79559013d6f9eea6f7e55d1845c11171 | |
tree | 64ddba7d633286cabac844dd48beac4b14a06903 | tree | snapshot |
parent | 88ccb9f9745ff1f44bff7c6d6c17ad4b46870706 | commit | diff |
Makefile: fix misdetection of relative pathnames
The installation rules wanted to differentiate between a template_dir that
is given as an absolute path (e.g. /usr/share/git-core/templates) and a
relative one (e.g. share/git-core/templates) but it was done by checking
if $(abspath $(template_dir)) and $(template_dir) yield the same string.
This was wrong in at least two ways.
* The user can give template_dir with a trailing slash from the command
line to invoke make or from the included config.mak. A directory path
ought to mean the same thing with or without such a trailing slash but
use of $(abspath) means an absolute path with a trailing slash fails
the test.
* Versions of GNU make older than 3.81 do not have $(abspath) to begin
with.
This changes the detection logic to see if the given path begins with a
slash.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The installation rules wanted to differentiate between a template_dir that
is given as an absolute path (e.g. /usr/share/git-core/templates) and a
relative one (e.g. share/git-core/templates) but it was done by checking
if $(abspath $(template_dir)) and $(template_dir) yield the same string.
This was wrong in at least two ways.
* The user can give template_dir with a trailing slash from the command
line to invoke make or from the included config.mak. A directory path
ought to mean the same thing with or without such a trailing slash but
use of $(abspath) means an absolute path with a trailing slash fails
the test.
* Versions of GNU make older than 3.81 do not have $(abspath) to begin
with.
This changes the detection logic to see if the given path begins with a
slash.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile | diff | blob | history |