applying patch

Posted on 2013-10-04
Medium Priority
Last Modified: 2013-10-25
I installed rpm and extracted it
rpm2cpio myrpmfile.rpm | cpio -idmv

there is a file call libXYZ.patch

I need to apply the patch to the source before I can compile the source code.
How to apply the patch?
Question by:perlperl
LVL 40

Accepted Solution

jlevie earned 2000 total points
ID: 39549217
Something along the lines of "patch -pN patch-file" with N being some number from 0 up. The value of N is the number of path elements that must be stripped from the file specs in the patch file to find the file to patch for the current environment. See "man patch" for a better explanation.
LVL 35

Expert Comment

by:Duncan Roe
ID: 39549950
Pretty much as jlevie said, if you plan to build libXYZ by hand. If you are in doubt about -pN, post the first few lines of the patch here and we can show you how to work it out.
This sounds like an SRPM. If you had extracted it with rpm (it goes to a fixed path in /usr/src/rpm if you do) then building with rpmbuild would probably have applied the patch for you. (If you eschewed that route I don't blame you;)

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article explains how to use the rsync command to create backups and sync data across hosts. Rsync is a very useful command that is often used to copy data, make backups, migrate hosts, and bridge the gap between site staging and production envi…
Can you run Linux on a Windows system?  Yep.  Here's how.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question