Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: How to patch?

  1. #1

    Default How to patch?

    Please tell me how to patch. I cannot patch anything :-(

    For example:

    anixx@anixx-desktop:~> diff -u '/home/anixx/Загрузки/kalgebra/src/qexp.cpp.orig' '/home/anixx/Загрузки/kalgebra/src/qexp.cpp' > '/home/anixx/Desktop/cpppatch.diff'
    anixx@anixx-desktop:~> patch /home/anixx/Загрузки/kalgebra/src/qexp.cpp.orig '/home/anixx/Desktop/cpppatch.diff'
    patch: **** Only garbage was found in the patch input.

    Code:
    --- /home/anixx/Загрузки/kalgebra/src/qexp.cpp.orig	2006-04-29 19:23:29.000000000 +0400
    +++ /home/anixx/Загрузки/kalgebra/src/qexp.cpp	2010-09-19 15:50:50.486781883 +0400
    @@ -114,7 +114,7 @@
     			err += i18n("Too much comma in %1<br />\n").arg(ret.val);
     		}
     		
    -		ret.val = QString::QString("<cn>%1</cn>").arg(ret.val);
    +		ret.val = QString("<cn>%1</cn>").arg(ret.val);
     		ret.tipus= tVal;
     	} else if(a[0].isLetter()) {//es una variable o func
     		ret.val += a[0];
    @@ -124,7 +124,7 @@
     		if(a[i]=='('){
     			ret.tipus=tFunc;
     		} else {
    -			ret.val = QString::QString("<ci>%1</ci>").arg(ret.val);
    +			ret.val = QString("<ci>%1</ci>").arg(ret.val);
     			ret.tipus= tVal;
     		}
     	} else if(a[0]=='-' && a[1] == '>') {
    Also sometimes a patch works well in OBS for 11.1 but does not for 11.2 (with macro %patch). If to use patch utility (without macro) then all works. Why?

  2. #2

    Default Re: How to patch?

    I'm not sure I understand your question. Is it about diff/patch usage ?

    For example :

    diff -u /kalgebra/src/qexp.cpp.orig /kalgebra/src/qexp.cpp > /home/anixx/qexp.ccp.diff

    and :

    patch -p0 < /home/anixx/qexp.cpp.diff

  3. #3
    Join Date
    Jan 2009
    Location
    Switzerland
    Posts
    1,529

    Default Re: How to patch?

    Code:
    --- /home/anixx/Загрузки/kalgebra/src/qexp.cpp.orig	2006-04-29 19:23:29.000000000 +0400
    +++ /home/anixx/Загрузки/kalgebra/src/qexp.cpp	2010-09-19 15:50:50.486781883 +0400
    Having my screen set to iso-8859-1 (latin1) charset I see some strange characters including a comma in your path. Perhaps patch doesn't like this.
    Technology is 'stuff that doesn't work yet.' -- Bran Ferren

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,670
    Blog Entries
    15

    Default Re: How to patch?

    Quote Originally Posted by Ansus
    Please tell me how to patch. I cannot patch anything :-(
    Hi
    I use diff -Naur somefile somefile.orig hasn't failed me yet....

    --
    Cheers Malcolm (Linux Counter #276890)
    SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.32.19-0.2-default
    up 3 days 1:55, 3 users, load average: 0.33, 0.45, 0.25
    GPU GeForce 8600 GTS Silent - Driver Version: 256.53


  5. #5

    Default Re: How to patch?

    Once I started using quilt I never looked back. I think there was a good post in planetsuse, but now I can only find openSUSE:Junior jobs - openSUSE

    Also, in newer RPM versions you can't
    Code:
    Patch0: XXX
    ...
    %patch
    You need to use also "%patch0".

  6. #6

    Default Re: How to patch?

    Quote Originally Posted by RedDwarf View Post
    Also, in newer RPM versions you can't
    Code:
    Patch0: XXX
    ...
    %patch
    You need to use also "%patch0".
    This does not work either. Only direct use of the patch utility works. For example, in this package:

    https://build.opensuse.org/package/f...ect=KDE%3AKDE3

  7. #7
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,670
    Blog Entries
    15

    Default Re: How to patch?

    Quote Originally Posted by Ansus
    RedDwarf;2225017 Wrote:
    >
    > Also, in newer RPM versions you can't
    > >

    Code:
    --------------------
    > > Patch0: XXX

    > ...
    > %patch

    --------------------
    > >

    >
    > You need to use also "%patch0".


    This does not work either. Only direct use of the patch utility works.
    For example, in this package:

    http://tinyurl.com/2ccw5al
    2ccw5al ->
    https://build.opensuse.org/package/f...ect=KDE%3AKDE3

    Hi
    That's because of your patches??? Your patches start at the source tree
    when it's unpacked. In your cpppatch1.diff it should be src/<somefile>

    For each patch you use %patch(n), you also better to combine all your
    patches if their similar... (just my preference) using > and >> to
    append.

    --
    Cheers Malcolm (Linux Counter #276890)
    SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.32.19-0.2-default
    up 3 days 7:21, 2 users, load average: 0.13, 0.22, 0.25
    GPU GeForce 8600 GTS Silent - Driver Version: 256.53


  8. #8
    Join Date
    Jan 2009
    Location
    Switzerland
    Posts
    1,529

    Default Re: How to patch?

    In the %prep section this should be:

    Code:
    %patch0 -p0
    %patch1 -p0
    ...
    and the paths in the patchfiles should be relative to the kalgebra directory:

    Code:
    --- src/kfunctionedit.cpp.orig    2006-05-01 15:56:59.000000000 +0400  
    +++ src/kfunctionedit.cpp 2010-09-19 16:44:32.780780999 +0400
    @@ -30,7 +30,7 @@
        topLayout->addWidget(raro);
          
        m_graph = new QGraph(raro);
    -   m_graph->setViewPort(QRect::QRect(QPoint::QPoint(-9, 5), QPoint::QPoint(9, -5)));
    +   m_graph->setViewPort(QRect(QPoint(-9, 5), QPoint(9, -5)));
        m_graph->setResolution(400);
        m_graph->setMouseTracking(false);
        m_graph->setFocusPolicy(NoFocus);
    Technology is 'stuff that doesn't work yet.' -- Bran Ferren

  9. #9

    Default Re: How to patch?

    Quote Originally Posted by malcolmlewis View Post
    Hi
    That's because of your patches??? Your patches start at the source tree
    when it's unpacked. In your cpppatch1.diff it should be src/<somefile>
    No, the initial patch from Fedora also did not work through %patch macro in 11.2 and 11.3. Only in 11.1 it worked well. So I changed it to the call to patch utility directly (and after this it worked). Other patches which I made myself I even did not try to call with %patch.

    In the %prep section this should be:
    and the paths in the patchfiles should be relative to the kalgebra directory:
    Yes, this is what exacty was with the first patch. But it worked only for 11.1

  10. #10
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    26,670
    Blog Entries
    15

    Default Re: How to patch?

    Quote Originally Posted by Ansus
    malcolmlewis;2225123 Wrote:
    > Hi
    > That's because of your patches??? Your patches start at the source
    > tree when it's unpacked. In your cpppatch1.diff it should be
    > src/<somefile>
    >


    No, the initial patch from Fedora also did not work through %patch
    macro in 11.2 and 11.3. Only in 11.1 it worked well. So I changed it to
    the call to patch utility directly (and after this it worked). Other
    patches which I made myself I even did not try to call with %patch.

    >
    > In the %prep section this should be:
    > and the paths in the patchfiles should be relative to the kalgebra
    > directory:


    Yes, this is what exacty was with the first patch. But it worked only
    for 11.1

    Hi
    That to me would indicate either a) the source was changed (ie not
    original) or b) it's an old patch used on a later source. Best to review
    the patches and redo so the work how they should....

    --
    Cheers Malcolm (Linux Counter #276890)
    SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.32.19-0.2-default
    up 3 days 10:42, 2 users, load average: 0.40, 0.42, 0.27
    GPU GeForce 8600 GTS Silent - Driver Version: 256.53


Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •