Getting cmake to apply patches

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting cmake to apply patches

Hugh Sorby
So I am trying to get CMake to apply patches to third party source.

First off can someone confirm (, I'm hoping I haven't missed the
obvoius) that there isn't an inbuilt command to apply unified diffs.

Secondly can anyone tell me how to stop CMake consuming the "-i" in
following command:

cmake -E netgen patch -p0 -i netgen-4.9.11.patch

At the moment I am trying to achieve this on Windows Vista.
Ta.

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Getting cmake to apply patches

Eric Noulard
2009/11/24 Hugh Sorby <[hidden email]>:
> So I am trying to get CMake to apply patches to third party source.
> First off can someone confirm (, I'm hoping I haven't missed the obvoius)
> that there isn't an inbuilt command to apply unified diffs.
>
> Secondly can anyone tell me how to stop CMake consuming the "-i" in
> following command:
>
> cmake -E netgen patch -p0 -i netgen-4.9.11.patch

I cannot understand that cmake -E syntax?

Is supposed to apply "netgen-4.9.11.patch" patch file
on the "netgen" source tree?


--
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Getting cmake to apply patches

Hugh Sorby
Sorry about that missed a chdir should be

cmake -E chdir netgen patch -p0 -i netgen-4.9.11.patch

from following the documentation:

cmake -E chdir dir cmd [args]...



Eric Noulard wrote:

> 2009/11/24 Hugh Sorby <[hidden email]>:
>  
>> So I am trying to get CMake to apply patches to third party source.
>> First off can someone confirm (, I'm hoping I haven't missed the obvoius)
>> that there isn't an inbuilt command to apply unified diffs.
>>
>> Secondly can anyone tell me how to stop CMake consuming the "-i" in
>> following command:
>>
>> cmake -E netgen patch -p0 -i netgen-4.9.11.patch
>>    
>
> I cannot understand that cmake -E syntax?
>
> Is supposed to apply "netgen-4.9.11.patch" patch file
> on the "netgen" source tree?
>
>
>  
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Getting cmake to apply patches

Alan W. Irwin
On 2009-11-25 11:00+1200 Hugh Sorby wrote:

> Sorry about that missed a chdir should be
>
> cmake -E chdir netgen patch -p0 -i netgen-4.9.11.patch

I confirm that you have found a bug (at least with Debian stable Linux and a
bootstrapped cmake version 2.8.0-rc6).  Here is a simple demonstration
with "ls -i".

software@raven> ls -i config.h
4539478 config.h

software@raven> cmake -E chdir . ls -i config.h
config.h

In other words the ls -i option is consumed by CMake just like the patch -i
option is consumed for you.  Note that -i is an
option for CMake itself (wizard mode) so there is probably some screwup
in interpretation of the command line when cmake -E is being run.
If I change the flag from -i to -l, then the flag is not consumed and
you get the same results for

"ls -l config.h" and "cmake -E chdir . ls -l config.h".  That's consistent
with the idea that you will only have trouble with cmake consuming the
option when it is an option it recognizes.  ("-l" is not a cmake command
option while "-i" is).

I also confirm the bug occurs for cmake-2.6.0 (the Debian stable system
version) which makes it a bug that has been around for quite a while.  I
suggest you go ahead and put it in the bugtracker (if you cannot find
another report about the same issue there).

Until this cmake -E option consuming bug is fixed I suggest you could avoid
the -i option with patch by using, e.g.,

cmake -E chdir netgen patch -p0 <netgen-4.9.11.patch

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Getting cmake to apply patches

Hugh Sorby
Thanks Alan,

I will attempt to:

1) search the CMake bug tracker (not very good at this most never seem
to find anything relevant)
2) add new bug if 1) fails to bear any fruit.

Unfortunately the

cmake -E chdir netgen patch -p0 < netgen-4.9.11.patch

doesn't work so well on Windows Vista which is why I was trying to use
the -i option.


Alan W. Irwin wrote:

> On 2009-11-25 11:00+1200 Hugh Sorby wrote:
>
>> Sorry about that missed a chdir should be
>>
>> cmake -E chdir netgen patch -p0 -i netgen-4.9.11.patch
>
> I confirm that you have found a bug (at least with Debian stable Linux
> and a
> bootstrapped cmake version 2.8.0-rc6).  Here is a simple demonstration
> with "ls -i".
>
> software@raven> ls -i config.h
> 4539478 config.h
>
> software@raven> cmake -E chdir . ls -i config.h
> config.h
>
> In other words the ls -i option is consumed by CMake just like the
> patch -i
> option is consumed for you.  Note that -i is an
> option for CMake itself (wizard mode) so there is probably some screwup
> in interpretation of the command line when cmake -E is being run.
> If I change the flag from -i to -l, then the flag is not consumed and
> you get the same results for
>
> "ls -l config.h" and "cmake -E chdir . ls -l config.h".  That's
> consistent
> with the idea that you will only have trouble with cmake consuming the
> option when it is an option it recognizes.  ("-l" is not a cmake command
> option while "-i" is).
>
> I also confirm the bug occurs for cmake-2.6.0 (the Debian stable system
> version) which makes it a bug that has been around for quite a while.  I
> suggest you go ahead and put it in the bugtracker (if you cannot find
> another report about the same issue there).
>
> Until this cmake -E option consuming bug is fixed I suggest you could
> avoid
> the -i option with patch by using, e.g.,
>
> cmake -E chdir netgen patch -p0 <netgen-4.9.11.patch
>
> Alan
> __________________________
> Alan W. Irwin
>
> Astronomical research affiliation with Department of Physics and
> Astronomy,
> University of Victoria (astrowww.phys.uvic.ca).
>
> Programming affiliations with the FreeEOS equation-of-state
> implementation
> for stellar interiors (freeeos.sf.net); PLplot scientific plotting
> software
> package (plplot.org); the libLASi project (unifont.org/lasi); the
> Loads of
> Linux Links project (loll.sf.net); and the Linux Brochure Project
> (lbproject.sf.net).
> __________________________
>
> Linux-powered Science
> __________________________
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Getting cmake to apply patches

David Cole
For now, another workaround would be to write a script that calls patch with the -i argument and then invoke the script with execute_process or a different cmake -E command line...


On Tue, Nov 24, 2009 at 7:43 PM, Hugh Sorby <[hidden email]> wrote:
Thanks Alan,

I will attempt to:

1) search the CMake bug tracker (not very good at this most never seem to find anything relevant)
2) add new bug if 1) fails to bear any fruit.

Unfortunately the


cmake -E chdir netgen patch -p0 < netgen-4.9.11.patch

doesn't work so well on Windows Vista which is why I was trying to use the -i option.



Alan W. Irwin wrote:
On 2009-11-25 11:00+1200 Hugh Sorby wrote:

Sorry about that missed a chdir should be

cmake -E chdir netgen patch -p0 -i netgen-4.9.11.patch

I confirm that you have found a bug (at least with Debian stable Linux and a
bootstrapped cmake version 2.8.0-rc6).  Here is a simple demonstration
with "ls -i".

software@raven> ls -i config.h
4539478 config.h

software@raven> cmake -E chdir . ls -i config.h
config.h

In other words the ls -i option is consumed by CMake just like the patch -i
option is consumed for you.  Note that -i is an
option for CMake itself (wizard mode) so there is probably some screwup
in interpretation of the command line when cmake -E is being run.
If I change the flag from -i to -l, then the flag is not consumed and
you get the same results for

"ls -l config.h" and "cmake -E chdir . ls -l config.h".  That's consistent
with the idea that you will only have trouble with cmake consuming the
option when it is an option it recognizes.  ("-l" is not a cmake command
option while "-i" is).

I also confirm the bug occurs for cmake-2.6.0 (the Debian stable system
version) which makes it a bug that has been around for quite a while.  I
suggest you go ahead and put it in the bugtracker (if you cannot find
another report about the same issue there).

Until this cmake -E option consuming bug is fixed I suggest you could avoid
the -i option with patch by using, e.g.,

cmake -E chdir netgen patch -p0 <netgen-4.9.11.patch

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Getting cmake to apply patches

Hugh Sorby
In reply to this post by Alan W. Irwin

I found this

http://www.cmake.org/Bug/view.php?id=6945

but didn't manage to reopen it so I submitted this bug report

http://www.cmake.org/Bug/view.php?id=9965


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Getting cmake to apply patches

Alan W. Irwin
On 2009-11-25 13:11+1200 Hugh Sorby wrote:

>
> I found this
>
> http://www.cmake.org/Bug/view.php?id=6945
>
> but didn't manage to reopen it so I submitted this bug report
>
> http://www.cmake.org/Bug/view.php?id=9965

It is interesting that Bug 6945 was closed as fixed in CVS by Bill Hoffman
more than a year ago. So I suspect the trouble is this fix never made it
into a release (yet).

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Getting cmake to apply patches

Hugh Sorby
In reply to this post by David Cole

Thanks David,

Following your advice I did the following:

SET( PATCH_BATCH_FILE patch_wrap.bat )
FILE( WRITE ${PATCH_BATCH_FILE} "${PATCH_EXECUTABLE} -p0 -i
${LIB_DIR}.patch" )
EXECUTE_PROCESS( COMMAND cmake -E chdir ${PROJECT_SOURCE_DIR}
${PATCH_BATCH_FILE}
    RESULT_VARIABLE RESULT_PATCH )
MESSAGE( STATUS "Patch result: ${RESULT_PATCH}, PROF SOURCE DIR:
${PROJECT_SOURCE_DIR}" )
FILE( REMOVE ${PATCH_BATCH_FILE} )

This worked (add in your own Windows checks)

David Cole wrote:

> For now, another workaround would be to write a script that calls
> patch with the -i argument and then invoke the script with
> execute_process or a different cmake -E command line...
>
>
> On Tue, Nov 24, 2009 at 7:43 PM, Hugh Sorby <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Thanks Alan,
>
>     I will attempt to:
>
>     1) search the CMake bug tracker (not very good at this most never
>     seem to find anything relevant)
>     2) add new bug if 1) fails to bear any fruit.
>
>     Unfortunately the
>
>
>     cmake -E chdir netgen patch -p0 < netgen-4.9.11.patch
>
>     doesn't work so well on Windows Vista which is why I was trying to
>     use the -i option.
>
>
>
>     Alan W. Irwin wrote:
>
>         On 2009-11-25 11:00+1200 Hugh Sorby wrote:
>
>             Sorry about that missed a chdir should be
>
>             cmake -E chdir netgen patch -p0 -i netgen-4.9.11.patch
>
>
>         I confirm that you have found a bug (at least with Debian
>         stable Linux and a
>         bootstrapped cmake version 2.8.0-rc6).  Here is a simple
>         demonstration
>         with "ls -i".
>
>         software@raven> ls -i config.h
>         4539478 config.h
>
>         software@raven> cmake -E chdir . ls -i config.h
>         config.h
>
>         In other words the ls -i option is consumed by CMake just like
>         the patch -i
>         option is consumed for you.  Note that -i is an
>         option for CMake itself (wizard mode) so there is probably
>         some screwup
>         in interpretation of the command line when cmake -E is being run.
>         If I change the flag from -i to -l, then the flag is not
>         consumed and
>         you get the same results for
>
>         "ls -l config.h" and "cmake -E chdir . ls -l config.h".
>          That's consistent
>         with the idea that you will only have trouble with cmake
>         consuming the
>         option when it is an option it recognizes.  ("-l" is not a
>         cmake command
>         option while "-i" is).
>
>         I also confirm the bug occurs for cmake-2.6.0 (the Debian
>         stable system
>         version) which makes it a bug that has been around for quite a
>         while.  I
>         suggest you go ahead and put it in the bugtracker (if you
>         cannot find
>         another report about the same issue there).
>
>         Until this cmake -E option consuming bug is fixed I suggest
>         you could avoid
>         the -i option with patch by using, e.g.,
>
>         cmake -E chdir netgen patch -p0 <netgen-4.9.11.patch
>
>         Alan
>         __________________________
>         Alan W. Irwin
>
>         Astronomical research affiliation with Department of Physics
>         and Astronomy,
>         University of Victoria (astrowww.phys.uvic.ca
>         <http://astrowww.phys.uvic.ca>).
>
>         Programming affiliations with the FreeEOS equation-of-state
>         implementation
>         for stellar interiors (freeeos.sf.net
>         <http://freeeos.sf.net>); PLplot scientific plotting software
>         package (plplot.org <http://plplot.org>); the libLASi project
>         (unifont.org/lasi <http://unifont.org/lasi>); the Loads of
>         Linux Links project (loll.sf.net <http://loll.sf.net>); and
>         the Linux Brochure Project
>         (lbproject.sf.net <http://lbproject.sf.net>).
>         __________________________
>
>         Linux-powered Science
>         __________________________
>
>     _______________________________________________
>     Powered by www.kitware.com <http://www.kitware.com>
>
>     Visit other Kitware open-source projects at
>     http://www.kitware.com/opensource/opensource.html
>
>     Please keep messages on-topic and check the CMake FAQ at:
>     http://www.cmake.org/Wiki/CMake_FAQ
>
>     Follow this link to subscribe/unsubscribe:
>     http://www.cmake.org/mailman/listinfo/cmake
>
>
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Getting cmake to apply patches

Bill Hoffman
In reply to this post by Alan W. Irwin
Alan W. Irwin wrote:

> On 2009-11-25 13:11+1200 Hugh Sorby wrote:
>
>>
>> I found this
>>
>> http://www.cmake.org/Bug/view.php?id=6945
>>
>> but didn't manage to reopen it so I submitted this bug report
>>
>> http://www.cmake.org/Bug/view.php?id=9965
>
> It is interesting that Bug 6945 was closed as fixed in CVS by Bill Hoffman
> more than a year ago. So I suspect the trouble is this fix never made it
> into a release (yet).

Nope, just not fixed for this case....

Looks like -i and --system-information will not work with -E, both will
be consumed by CMake... :(


Should be easy to fix... Will have it fixed in 2.8.1.

-Bill
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake