Thread: How to apply patch?

How to apply patch?

From
Andrew Klimov
Date:

Jason, many thanks to you for patch and comments!

But,I'm  not a cygwin "guru".So, how to apply the tcl.patch?I have placed it to /usr/src/postgresql-7.3.1 and then run:

patch -p1 < tcl.patch. And this gives me:

/*--------------------------------- patch output begin here ------------------------------------------------*/

can't find file to patch at input line 8
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Index: interfaces/libpgtcl/Makefile
|===================================================================
|RCS file: /projects/cvsroot/pgsql-server/src/interfaces/libpgtcl/Makefile,v
|retrieving revision 1.30
|diff -u -p -r1.30 Makefile
|--- interfaces/libpgtcl/Makefile       2002/12/30 17:19:52     1.30
|+++ interfaces/libpgtcl/Makefile       2003/01/14 19:40:46
--------------------------
File to patch:

/*-------------------------------- patch output end here ---------------------------------------------------*/

You wrote:

>Attached is a *work-in-progress* patch that enables PostgreSQL CVS to
>build "cleanly" when configured as follows:

  >  $ configure --with-tcl --with-tclconfig=/usr/lib ...

>Note that I needed to configure --with-tclconfig, but I did *not* have
>to
>do the following:

  >  $ ln -s /bin/tclsh83 /bin/tclsh
  >  $ ln -s /bin/wish83.exe /bin/wish

My Question : should I place tclConfig.sh (and tkConfig.sh) which is originally in /cygwin/lib directory to /cygwin/usr/lib directory?

Next, on my snip->

/* This is my snip -begin */

>> include   -c -o pltcl.o pltcl.c
>>
>> In file included from pltcl.c:40:
>> /usr/include/tcl.h:234: warning: `DLLIMPORT' redefined
>> ../../../src/include/pg_config_os.h:26: warning: this is the location
>>of the
>> previous definition

/* This is my snip -end */

You wrote:

>gcc 3.2 did not produce the above warning!

I've configured this by using CC=gcc-2.So ,gcc-2 produces this output.

But,I'm not so experienced with cygwin and with such a cygwin stuff as "patch" program!

So ,please give me an instruction on how to apply the patch! My environment:WinNT4(SP5) , latest cygwin, and postgresql7.3 source not from CVS , but from postgresql site .

Any help would be very appreciated.

Andrew.



Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

Re: How to apply patch?

From
Jason Tishler
Date:
Andrew,

On Thu, Jan 16, 2003 at 08:47:52AM -0800, Andrew Klimov wrote:
> Jason, many thanks to you for patch and comments!

You are welcome.

> But,I'm  not a cygwin "guru".So, how to apply the tcl.patch?I have
> placed it to /usr/src/postgresql-7.3.1 and then run:
>
> patch -p1 < tcl.patch. And this gives me:

Since the patch is against CVS, you need to supply the -p0 option:

    $ cd /usr/src/postgresql-7.3.1/src
    $ patch -p0 </usr/src/postgresql-7.3.1/tcl.patch
    patching file interfaces/libpgtcl/Makefile
    patching file makefiles/Makefile.win
    patching file pl/tcl/Makefile
    Hunk #1 succeeded at 40 (offset -3 lines).
    patching file pl/tcl/pltcl.c

> My Question : should I place tclConfig.sh (and tkConfig.sh) which is
> originally in /cygwin/lib directory to /cygwin/usr/lib directory?

No.  The /lib and /usr/lib directories are actually the same (e.g.,
C:\cygwin\lib) but appear to be two due to a mount point:

    $ mount
    C:\cygwin on / type system (binmode)
**> C:\cygwin\lib on /usr/lib type system (binmode) <**
    ...

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6