summaryrefslogtreecommitdiffstats
path: root/README.in
blob: 872d9b06b743cc031768ec127b3c265c17c38910 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
The scripts in this package simplify working with a series of patches.
The usual tasks like applying, refreshing and reversing are supported.

docco.txt contains Adrew Morton's description of his suite of patch
scripts. These scripts are based on Andrew's scripts, but include many
changes. Please keep this in mind when reading Andrew's documentation.


Concepts
========

(Please see docco.txt.)

The scripts maintain a stack of patches, on top of which additional
patches can be applied, and from with patches can be removed. The list of
patches is kept in a file (searched for in this order in
.pc/series, series, patches/series).

The scripts keep meta information in the .pc/ directory. The .pc/
directory contains:

	.pc/applied-patches
		The list of currently applied patches.

	.pc/patch/.pc (for each applied patch)
		A list of files modified by the patch.

	.pc/patch/ (for each applied patch)
		Copies of the files that the patch modifies,
		before modifying. The original versions of
		the files are needed for refreshing patches,
		and for ensuring that removing a patch does
		recreate the original file contents.


Operation
=========

Patches to be applied must be listed in the series file.

Patches are applied with pushpatch, and are removed with poppatch.

Refpatch refreshes a patch.

New patches can be added at the current position in the patch sequence
with newpatch.

Additional files to be modified can be added to a patch with patchadd.


Installation
============

To start using the scripts the working directory must contain:

	patches/
		Patches to work with.

	series (or patches/series)
		List of patches in order of applying.

The scripts will create the .pc/ directory that contains the meta
information needed for managing the patches automatically.


Series file
===========

The patches that are relevant for a project must be listed in the file
series, which is searched for in .pc/, ./ and patches/ in this order.
The patches will be applied in the order given. The series file has
the following format:

	# Comment
	subdir/patch-file-name.patch [-pN]

The location of patches is specified relative to the patches/ directory.
Optionally a strip level (-p0, -p1, etc.) can be specified. When
refreshing a patch, only levels 0 and 1 are supported.


Command reference
=================
@REFERENCE@

Helper files/scripts
====================

patchfns
	A collection of functions.

apatch
	Add a patch. Used by pushpatch.

rpatch
	Remove a patch. Used by poppatch.

parse-patch {-s|-u} section file [< replacement]
	Select a %section from a patch (-s) or replace a
	%section with the text from standard input (-u).

touched-by-patch filename
	Print a list of files modified by a patch file.

backup-files
	A simple utility that creates / restores / removes
	backup files; this works around a patch bug (see BUGS).