Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Aug 2012 10:23:02 +0000 (UTC)
From:      Sofian Brabez <sbz@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r303367 - head/Tools/scripts
Message-ID:  <201208301023.q7UAN2Z3022776@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sbz
Date: Thu Aug 30 10:23:01 2012
New Revision: 303367
URL: http://svn.freebsd.org/changeset/ports/303367

Log:
  - Fix documentation
  
  Submitted by:	culot, gahr

Modified:
  head/Tools/scripts/README
  head/Tools/scripts/README.getpatch
  head/Tools/scripts/getpatch

Modified: head/Tools/scripts/README
==============================================================================
--- head/Tools/scripts/README	Thu Aug 30 09:45:55 2012	(r303366)
+++ head/Tools/scripts/README	Thu Aug 30 10:23:01 2012	(r303367)
@@ -24,7 +24,7 @@ distclean - compare md5 sums of distfile
             unmatched entries
 explicit_lib_depends.sh - shows the current explicit dependency list of libs
                           for a given installed port
-getpatch - downloads patch attachments on Bug Tracking Systems
+getpatch - downloads patch attachments from a Bug Tracking Systems
 getpr   - downloads a problem report from GNATS and attempts to extract
           the patch, shar, uuencoded file from it.
           this probably needs to be checked for potential security problems.

Modified: head/Tools/scripts/README.getpatch
==============================================================================
--- head/Tools/scripts/README.getpatch	Thu Aug 30 09:45:55 2012	(r303366)
+++ head/Tools/scripts/README.getpatch	Thu Aug 30 10:23:01 2012	(r303367)
@@ -1,37 +1,39 @@
 GETPATCH(1)		FreeBSD General Commands Manual 	 GETPATCH(1)
 
 NAME
-     getpatch - An utility to download patch attachments on Bug Tracking Systems
+     getpatch - A utility to download patch attachments on Bug Tracking Systems
 
 SYNOPSIS
      getpatch [-h] [--mode gnats|bz] [--last] [--stdout] <pr-id>
 
 DESCRIPTION
-     getpatch is an utility to download patch attachments on Bug Tracking
-     Systems such Gnats and Bugzilla. It currently supports retrieving multiple
+     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.
 
-     Its written in python witout any extra dependencies. Compare to getpr
-     utility it does web scrapping on BTS web interface in order to retrieve
-     patchs attached.
+     It's written in python witout 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
+	   -h	      Prints a multi-line help message and exits.
 
-	   --mode     Specify BTS mode. Supported are "gnats" or "bz".
+	   --mode     Specifies the BTS. Currently "gnats" and "bz" are.
+                      supported.
 
-           --last     Only retrieve last iteration patch attached.
+           --last     Only retrieves the latest iteration of a patch.
 
-	   --stdout   Output patch to stdout file descriptor.
+	   --stdout   Dumps the patch to stdout file descriptor.
 
-     Options can be used after or before the <pr-id> on the command line.
+     Options can be used after or before the <pr-id> argument on the command line.
 
 FILES
      ${PORTSDIR}/Tools/scripts/getpatch
 
 EXAMPLES
-     Retrieve all patchs attached on pr ports/166692 on a Gnats BTS:
+     Retrieve all patches attached to PR ports/166692 from a Gnats BTS:
 
 	   getpatch --mode gnats ports/166692
 
@@ -39,21 +41,21 @@ EXAMPLES
 
 	   getpatch 166692
 
-     Gnats is the default mode and category isn't mandatory.
+     Gnats is the default BTS and category isn't mandatory.
 
-     Retrieve all patchs on a Bugzilla BTS:
+     Retrieve all patches attached to PR ports/166692 from a Bugzilla BTS:
 
 	   getpatch --mode bz ports/166692
 
-     Retrieve only last iteration of the patch:
+     Retrieve only the latest iteration of the patch:
 
 	   getpatch --last ports/166692
 
-     Retrieve patch on standard output
+     Retrieve a patch on dump it to standard output
 
 	   getpatch --stdout ports/166692
 
-     On fly patching can be done in a port directory this way:
+     From inside a port's directory, patching on the fly can be done as follows:
 
      For a diff
 
@@ -65,16 +67,16 @@ EXAMPLES
            cd ${PORTSDIR}/category/port
            sh <(getpatch 166692 --stdout)
 
-     Redirection <() depends on the shell you're using, validated with zsh and bash.
+     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 output.
+     getpatch exits 0 on success or 1 if a help message was displayed.
 
 SEE ALSO
      getpr, prpatch
 
 AUTHORS
-     Sofian Brabez <sbz@freebsd.org>
+     Sofian Brabez <sbz@FreeBSD.org>
 
 BUGS
      If you're using getpatch and you encounter a bug or want an improvement

Modified: head/Tools/scripts/getpatch
==============================================================================
--- head/Tools/scripts/getpatch	Thu Aug 30 09:45:55 2012	(r303366)
+++ head/Tools/scripts/getpatch	Thu Aug 30 10:23:01 2012	(r303367)
@@ -158,16 +158,16 @@ class BzGetPatch(GetPatch):
 def main():
 
     parser = argparse.ArgumentParser(
-            description='Gets patch attachments from Bug Tracking System'
+            description='Gets patch attachments from a Bug Tracking System'
     )
     parser.add_argument('pr', metavar='pr', type=str, nargs=1,
             help='Pr id number')
     parser.add_argument('--mode', type=str, choices=['gnats','bz'],
             default='gnats', help='available modes to retrieve patch')
     parser.add_argument('--last', action='store_true',
-            help='only retrieve last iteration of the patch')
+            help='only retrieve the latest iteration of a patch')
     parser.add_argument('--stdout', action='store_true',
-            help='output patch on stdout')
+            help='dump patch on stdout')
 
     if len(sys.argv) == 1:
         parser.print_help()
@@ -179,13 +179,11 @@ def main():
     pr = str(args.pr[0])
 
     if '/' in pr and pr is not None:
-        category = pr.split('/')[0]
-        pr = pr.split('/')[1]
+        category, pr = pr.split('/')
 
     Clazz = globals()['%sGetPatch' % args.mode.capitalize()]
     gp = Clazz(pr, category)
     gp.get(only_last=args.last, output_stdout=args.stdout)
 
 if __name__ == '__main__':
-
     main()



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208301023.q7UAN2Z3022776>