Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How are the patches in debian/patches obtained?

Is this

diff -Nurp folder/original folder1/new

enough?

share|improve this question

2 Answers 2

This usually depends on the type of patch system which the package uses.

There are 3 types of patch systems for Debian packages:

  1. Quilt (most widely used)

  2. Cdbs + Simple Patchsys

  3. dpatch

All patch systems store patches in debian/patches. You can use the what-patch command in package ubuntu-dev-tools Install ubuntu-dev-tools to find out which patch system a package is using.

Introduction of Quilt:

Quilt patches can be easily manipulated using the quilt command from a terminal. The quilt command is a part of package quilt Install quilt.

This page will help you getting along with quilt. Also check out the quilt manpage by running

man quilt

in a terminal.

Now for cdbs + simple-patchsys:

These patches are manipulated commonly by a script called cdbs-edit-patch in package cdbs Install cdbs. You can edit patches like this:

cdbs-edit-patch *PATCHNAME*

You can add new patches like this:

cdbs-edit-patch *NEW_PATCHNAME* *PREV_PATCHNAME*

Where *PREV_PATCHNAME* is the name of the patch after which *NEW_PATCHNAME* will apply.

dpatch:

dpatch Install dpatch patches can be manipulated using the script dpatch-edit-patch in package dpatch Install dpatch. The usage of dpatch-edit-patch is exactly the same as cdbs-edit-patch above.

share|improve this answer
    
Being an Ubuntu Developer I never had to create patches manually like you said. The above ways do the work all the time. –  Bilal Akhtar Mar 25 '11 at 13:17

The section "Modify upstream files" of http://raphaelhertzog.com/2011/07/04/how-to-prepare-patches-for-debian-packages/ explains how those patches are created when the patch system in use is quilt (which is the most common case thanks to the new source format "3.0 (quilt)").

share|improve this answer

Your Answer

 
discard

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