Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have 3 files (from here)that I have been given to install in an attempt to upgrade the compiler:

binutils-2.13.2.1-1.mipsel.rpm
binutils-2.13.2.1-1.src.rpm
binutils-2.13.2.1-r5900-7.diff.gz

I'm kinda fumbling around with this.

What I've done is:

rpm -i mipsel -vv
rpm -i src -vv

I have no idea what to do with the .diff.gz I understand its a patch but dont really know how to deal with it.

share|improve this question
add comment

1 Answer

Change to the toplevel source directory (the one containing the files COPYING, bfd and so on) and apply the patch:

zcat ../binutils-2.13.2.1-r5900-7.diff.gz | patch -p1

You almost always need to pass either -p0 or -p1 when applying a patch. The number is the number of path components to strip from the file names in the patch. Check the first few lines of the patch. Here, they are

diff -urN binutils-2.13.2.1.orig/ChangeLog.PS2 binutils-2.13.2.1/ChangeLog.PS2
--- binutils-2.13.2.1.orig/ChangeLog.PS2        1969-12-31 18:00:00.000000000 -0
+++ binutils-2.13.2.1/ChangeLog.PS2     2003-01-20 17:48:29.000000000 -0600

Since all paths have a leading directory, you need to pass -p1. If the first line was something like diff -urN ../binutils-2.13.2.1.orig/ChangeLog.PS2 ChangeLog.PS2 or diff -urN ChangeLog.PS2.orig ChangeLog.PS2, you would use -p0.

Once you've applied the patch, run rpmbuild -bb to build a new binary package.

share|improve this answer
    
ah thanks, sorry my linux is not so hot, I dont really have a source directory. I assume I have to somehow unpack the .src.rpm –  PhilCK Jul 25 '11 at 18:25
    
@PhilCK Ah, yes, my rpm is a bit rusty. I think that's rpmbuild -bp /usr/src/rpm/SPECS/binutils-2.13.2.1-1.spec, and the source will be unpacked in /usr/src/rpm/SOURCES/binutils-2.13.2.1-1. –  Gilles Jul 25 '11 at 18:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.