Skip to content

Commit

Permalink
Update readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
firephreek committed Jul 29, 2013
1 parent 0bbb56f commit a97f7db
Showing 1 changed file with 26 additions and 21 deletions.
47 changes: 26 additions & 21 deletions Source/README
Original file line number Diff line number Diff line change
Expand Up @@ -11,51 +11,56 @@ libraries using a unified diff file. Specifically, PyPatch is meant to be used i
have a 3rd party library that needs to be patched when being deployed. Instead of maintaining your own separate version
of the library, you can just issue your patch during the build process.

*****
Usage
---
```pypatch apply [libarary.package] custom_diff.patch```
*****

``pypatch apply [libarary.package] custom_diff.patch``

As a part of the work flow:
``c:\project\pip install django``

``c:\project\pip install pypatch``

```c:\project\pip install django
c:\project\pip install pypatch
c:\project\pypatch apply django.contrib.auth c:\project\patches\my_auth_fix.patch```
``c:\project\pypatch apply django.contrib.auth c:\project\patches\my_auth_fix.patch``

************
How it works
------------
************
PyPatch applies patches to files relative to the root directory of the named package. So it does have to be installed into the target environment.

For example, if the django package was installed to "C:\Python27\Lib\site-packages\django" and you needed to patch the auth contrib package (django.contrib.auth), your command might look like

```pypatch apply django.contrib.auth c:\project\patches\my_auth_fix.patch"```
``pypatch apply django.contrib.auth c:\project\patches\my_auth_fix.patch"``

and the files named in my_auth_fix.patch would use relative pathing from the package directory:

``--- models.py 2013-05-06 15:12:14.212220100 -0700``

```
--- models.py 2013-05-06 15:12:14.212220100 -0700
+++ models.py 2013-05-06 14:36:20.535220100 -0700
```
``+++ models.py 2013-05-06 14:36:20.535220100 -0700``

If you used

```pypatch apply django.contrib c:\project\patches\my_auth_fix.patch```
```pypatch apply django.contrib c:\project\patches\my_auth_fix.patch```

instead, your diff patch would read
```
--- auth/models.py 2013-05-06 15:12:14.212220100 -0700
+++ auth/models.py 2013-05-06 14:36:20.535220100 -0700
```

``--- auth/models.py 2013-05-06 15:12:14.212220100 -0700``

``+++ auth/models.py 2013-05-06 14:36:20.535220100 -0700``

*****
Build
-----
*****
To build the distributable python package, run 'sdist' from the Project Root Directory.
Recommended: setting the output directory to our Libraries folder

```sdist --dist-dir="C:\outputdir"```
``sdist --dist-dir="C:\outputdir"``

This will build the zipped python package that can be installed via pip or easy_install

*****
Other
-----
Information on the Unified Diff format can be found at
https://www.gnu.org/software/diffutils/manual/html_node/Unified-Format.html#Unified-Format
*****

Information on the Unified Diff format can be found at https://www.gnu.org/software/diffutils/manual/html_node/Unified-Format.html#Unified-Format

0 comments on commit a97f7db

Please sign in to comment.