Fix create_exe_symlink.cmake for when DESTDIR is set

ABCD en.ABCD at gmail.com
Thu May 7 21:21:38 CEST 2009


Matthew Woehlke wrote:
> ABCD wrote:
>> First off, my apologies if I sent this to the wrong list.
>>
>> Currently, KDE/kdelibs/cmake/modules/create_exe_symlink.cmake calls
>> chmod on the previously installed version of a file when DESTDIR is
>> set, which is incorrect.  It should be calling chmod on the filename
>> under DESTDIR.  This patch (attached) fixes that.
> 
> -    EXECUTE_PROCESS(COMMAND chmod a+x ${abs_target})
> +    EXECUTE_PROCESS(COMMAND chmod a+x $ENV{DESTDIR}/${abs_target})
> 
> This looks wrong; I don't think you can safely add the / without 
> checking if $ENV{DESTDIR} is empty or not. (Remember that the absolute 
> paths /usr and //usr are not required to be the same!)
> 

I had forgotten about that (and I actually *have* used systems where
"/" != "//", namely cygwin).  The following version of the patch should
fix that, as because ${abs_target} is absolute, it will always begin
with a "/" (or "//"):
    EXECUTE_PROCESS(COMMAND chmod a+x $ENV{DESTDIR}${abs_target})

Attached is a modified version of the patch to take that change into
account.
-- 
ABCD
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: kdelibs-9999-create_exe_symlink.patch
Url: http://mail.kde.org/pipermail/kde-buildsystem/attachments/20090507/73cb05e1/attachment.bat 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20090507/73cb05e1/attachment.sig 


More information about the Kde-buildsystem mailing list