summaryrefslogtreecommitdiff
path: root/Tools/scripts/README.getpatch
blob: 75501b6991796557007fbfdfb555aad84425caf8 (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
GETPATCH(1)		FreeBSD General Commands Manual 	 GETPATCH(1)

NAME
     getpatch - Utility to download patch attachments on Bug Tracking Systems

SYNOPSIS
     getpatch [-h] [--mode gnats|bz] [--last] [--stdout] <pr-id>

DESCRIPTION
     getpatch is a utility to download patch attachments from Bug Tracking
     Systems such Gnats and Bugzilla. It supports retrieving multiple
     attachments from the command line.

     It's written in python without any extra dependencies. In addition to the
     functionalities offered by other similar tools suchs as getpr, it does web
     scrapping on the BTS web interface in order to retrieve the patches attached
     to PR.

     The following command line options are supported:

	   -h	      Prints a multi-line help message and exits.

	   --mode     Specifies the BTS. Currently "gnats" and "bz" are
                      supported.

           --last     Only retrieves the latest iteration of a patch.

	   --stdout   Dumps the patch to stdout file descriptor.

     Options can be used after or before the <pr-id> argument on the command line.

FILES
     ${PORTSDIR}/Tools/scripts/getpatch

EXAMPLES
     Retrieve all patches attached to PR ports/166692 from Gnats BTS:

	   getpatch --mode gnats ports/166692

	   or

	   getpatch 166692

     Gnats is the default BTS and category isn't mandatory.

     Retrieve all patches attached to PR ports/166692 from Bugzilla BTS:

	   getpatch --mode bz ports/166692

     Retrieve only the latest iteration of the patch:

	   getpatch --last ports/166692

     Retrieve a patch and dump it to standard output

	   getpatch --stdout ports/166692

     From inside a port's directory, patching on the fly can be done as follows:

     For a diff

           cd ${PORTSDIR}/category/port
           patch -p0 < <(getpatch 166692 --stdout)

     For a shar

           cd ${PORTSDIR}/category/port
           sh <(getpatch 166692 --stdout)

     Redirection <() depends on the shell you're using; validated with zsh and bash.

DIAGNOSTICS
     getpatch exits 0 on success or 1 if a help message was displayed.

SEE ALSO
     getpr

AUTHORS
     Sofian Brabez <sbz@FreeBSD.org>

BUGS
     If you're using getpatch and you encounter a bug or want an improvement
     don't hesitate to mail me.

FreeBSD 			 14 August 2012	                         FreeBSD