{ "info": { "author": "Rok Garbas", "author_email": "rok.garbas@gmail.com", "bugtrack_url": null, "classifiers": [ "Framework :: Buildout", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": ".. contents::\n\n- Code repository: http://github.com/garbas/collective.recipe.patch\n- Report bugs at http://github.com/garbas/collective.recipe.patch/issues\n\nDetailed Documentation\n**********************\n\nSupported options\n=================\n\nThe recipe supports the following options:\n\npath\n Define a directory in which the patch should be applied. For\n example::\n\n path = src/some/directory/\n\negg\n Define which egg should be patched. You can also pin to a specific\n version. For example::\n\n egg = some.egg<=1.1.1\n\npatches\n Paths to patch files. These patches are applied in order. For\n example::\n\n patches = patches/my_very_sprecial.patch\n patches/another_loverly.patch\n\nExample usage\n=============\n\nOur demo package which we will patch:\n\n >>> mkdir(sample_buildout, 'demo')\n >>> write(sample_buildout, 'demo', 'README.txt', \" \")\n >>> write(sample_buildout, 'demo', 'demo.py',\n ... \"\"\"# demo egg\n ... \"\"\")\n >>> write(sample_buildout, 'demo', 'setup.py',\n ... \"\"\"\n ... from setuptools import setup\n ...\n ... setup(\n ... name = \"demo\",\n ... version='1.0',\n ... py_modules=['demo']\n ... )\n ... \"\"\")\n >>> print system(buildout+' setup demo bdist_egg'), # doctest: +ELLIPSIS\n Running setup script 'demo/setup.py'.\n ...\n\nCreate our patch:\n\n >>> write(sample_buildout, 'demo.patch',\n ... \"\"\"diff --git demo.py demo.py\n ... --- demo.py\n ... +++ demo.py\n ... @@ -1 +1,2 @@\n ... # demo egg\n ... +# patching\n ... \"\"\")\n\nLet's write out buildout.cfg to patch our demo package:\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = demo-patch\n ... index = demo/dist/\n ...\n ... [demo-patch]\n ... recipe = collective.recipe.patch\n ... egg = demo==1.0\n ... patches = demo.patch\n ... \"\"\")\n\nOur final egg name depends on current python version:\n\n >>> import sys\n >>> demoegg = 'demo-1.0-py%d.%d.egg' % sys.version_info[:2]\n\nRunning the buildout gives us:\n\n >>> print system(buildout)\n Not found: demo/dist/...\n ...\n Installing demo-patch.\n ...\n Getting distribution for 'demo==1.0'.\n Got demo 1.0.\n patch: reading patch .../demo.patch\n ...\n patch: successfully patched ...develop-eggs/demo-1.0-py...egg/demo.py\n\n >>> ls(sample_buildout, 'develop-eggs', demoegg)\n d EGG-INFO\n - demo.py\n - demo.pyc\n - demo.pyo\n >>> cat(sample_buildout, 'demo', 'demo.py')\n # demo egg\n >>> cat(sample_buildout, 'develop-eggs', demoegg, 'demo.py')\n # demo egg\n # patching\n\nMultiple patches\n----------------\n\nIf you have more than one patch to apply:\n\n >>> write(sample_buildout, 'another.patch',\n ... \"\"\"diff --git demo.py demo.py\n ... --- demo.py\n ... +++ demo.py\n ... @@ -1,2 +1 @@\n ... -# demo egg\n ... # patching\n ... \"\"\")\n\nUpdate your buildout.cfg to list the new patch. In this case,\nanother.patch should be applied after demo.patch:\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = demo-patch\n ... index = demo/dist/\n ...\n ... [demo-patch]\n ... recipe = collective.recipe.patch\n ... egg = demo==1.0\n ... patches = demo.patch\n ... another.patch\n ... \"\"\")\n\nRunning the buildout gives us:\n\n >>> print system(buildout)\n Not found: demo/dist/...\n ...\n Installing demo-patch.\n ...\n Getting distribution for 'demo==1.0'.\n Got demo 1.0.\n patch: reading patch .../demo.patch\n ...\n patch: successfully patched ...develop-eggs/demo-1.0-py...egg/demo.py\n patch: reading patch .../another.patch\n ...\n patch: successfully patched ...develop-eggs/demo-1.0-py...egg/demo.py\n\n >>> cat(sample_buildout, 'develop-eggs', demoegg, 'demo.py')\n # patching\n\nExternal binaries\n-----------------\n\nWe can also set an external binary to use for patching:\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = demo-patch\n ... index = demo/dist/\n ...\n ... [demo-patch]\n ... recipe = collective.recipe.patch\n ... patch-binary = patch\n ... egg = demo==1.0\n ... patches = demo.patch\n ... \"\"\")\n\nRunning the buildout gives us:\n\n >>> print system(buildout)\n Not found: demo/dist/...\n ...\n Installing demo-patch.\n ...\n Getting distribution for 'demo==1.0'.\n Got demo 1.0.\n patch: reading patch .../demo.patch\n ...\n patch: patching file demo.py\n\n >>> ls(sample_buildout, 'develop-eggs', demoegg)\n d EGG-INFO\n - demo.py\n - demo.pyc\n - demo.pyo\n >>> cat(sample_buildout, 'demo', 'demo.py')\n # demo egg\n >>> cat(sample_buildout, 'develop-eggs', demoegg, 'demo.py')\n # demo egg\n # patching\n\nPatching an egg installed in another part\n-----------------------------------------\n\nAnother possibility is to install an egg with zc.recipe.egg (or\nprobably any other recipe) and patch it afterwards. However, it is\nnecessary to install the egg unzipped, and the egg may end up in the\neggs-folder instead the develop-eggs folder.\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = demo-egg demo-patch\n ... index = demo/dist/\n ...\n ... [demo-egg]\n ... recipe = zc.recipe.egg\n ... eggs = demo==1.0\n ... unzip = true\n ...\n ... [demo-patch]\n ... recipe = collective.recipe.patch\n ... egg = ${demo-egg:eggs}\n ... patches = demo.patch\n ... \"\"\")\n\nRunning the buildout gives us:\n\n >>> print system(buildout)\n Not found: demo/dist/...\n ...\n Installing demo-egg.\n ...\n Getting distribution for 'demo==1.0'.\n Got demo 1.0.\n Installing demo-patch.\n ...\n patch: successfully patched ...eggs/demo-1.0-py...egg/demo.py\n\n >>> ls(sample_buildout, 'eggs', demoegg)\n d EGG-INFO\n - demo.py\n - demo.pyc\n - demo.pyo\n >>> cat(sample_buildout, 'demo', 'demo.py')\n # demo egg\n >>> cat(sample_buildout, 'eggs', demoegg, 'demo.py')\n # demo egg\n # patching\n\nBroken patches\n----------------\n\nIf one of the patches is broken:\n\n >>> write(sample_buildout, 'missing-file.patch',\n ... \"\"\"diff --git missing-file.py missing-file.py\n ... --- missing-file.py\n ... +++ missing-file.py\n ... @@ -1,2 +0 @@\n ... -# BROKEN\n ... -# PATCH\n ... \"\"\")\n\nWhen you try to apply multiple patches, it will fail to apply any\nsubsequent patches, letting you fix the problem:\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = demo-patch\n ... index = demo/dist/\n ...\n ... [demo-patch]\n ... recipe = collective.recipe.patch\n ... egg = demo==1.0\n ... patches = missing-file.patch\n ... demo.patch\n ... \"\"\")\n\nRunning the buildout gives us:\n\n >>> print system(buildout)\n Not found: demo/dist/...\n ...\n Installing demo-patch.\n ...\n Getting distribution for 'demo==1.0'.\n Got demo 1.0.\n patch: reading patch .../missing-file.patch\n ...\n patch: source/target file does not exist\n --- .../missing-file.py\n +++ .../missing-file.py\n While:\n Installing demo-patch.\n Error: could not apply .../missing-file.patch\n\n >>> cat(sample_buildout, 'develop-eggs', demoegg, 'demo.py')\n # demo egg\n\nOr when using an external binary:\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = demo-patch\n ... index = demo/dist/\n ...\n ... [demo-patch]\n ... recipe = collective.recipe.patch\n ... patch-binary = patch\n ... egg = demo==1.0\n ... patches = missing-file.patch\n ... demo.patch\n ... \"\"\")\n >>> print system(buildout)\n Not found: demo/dist/...\n ...\n Installing demo-patch.\n patch: reading patch .../missing-file.patch\n ...\n patch: patch: **** malformed patch at line 6:\n While:\n Installing demo-patch.\n Error: could not apply .../missing-file.patch\n\n >>> cat(sample_buildout, 'develop-eggs', demoegg, 'demo.py')\n # demo egg\n\nContributors\n************\n\n- Rok Garbas, Author\n- Dylan Jay\n- Gerhard Weis\n- Simon Law\n\nChange history\n**************\n\n0.2.2 (2009-12-14)\n==================\n\n- make tests pass again [garbas]\n\n\n0.2.1 (2009-12-14)\n==================\n\n- made tests independent of python version\n- bring back python2.4 compatibility\n\n\n0.2 (2009-11-20)\n================\n\n- Added option to use external patch binary instead of bundled python-patch\n- Lets you specify multiple patches.\n- Reapplies patches if any of them have changed.\n- Aborts if any of the patches are broken.\n\n\n0.1 (2008-10-27)\n==================\n\n- Created recipe with ZopeSkel [garbas]\n\nDownload\n********", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/garbas/collective.recipe.patch", "keywords": "buildout recipe patch", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "collective.recipe.patch", "package_url": "https://pypi.org/project/collective.recipe.patch/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/collective.recipe.patch/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/garbas/collective.recipe.patch" }, "release_url": "https://pypi.org/project/collective.recipe.patch/0.2.2/", "requires_dist": null, "requires_python": null, "summary": "recipe for patching eggs", "version": "0.2.2" }, "last_serial": 703145, "releases": { "0.1b1": [ { "comment_text": "", "digests": { "md5": "5a97fc0c91c1a4b9197f814115013bf2", "sha256": "2a02bd365bbb8105f38116760249fa569254af55cee59141e418688283bd8d04" }, "downloads": -1, "filename": "collective.recipe.patch-0.1b1-py2.4.egg", "has_sig": false, "md5_digest": "5a97fc0c91c1a4b9197f814115013bf2", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 7914, "upload_time": "2008-10-27T16:48:14", "url": "https://files.pythonhosted.org/packages/be/d5/b92767cfae519f759af3cfefc956a2132f581d137596a8fed825aaa39283/collective.recipe.patch-0.1b1-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "8179a870a24c18482a79f6f516263aea", "sha256": "68226301e76d758b616c289413bf96b782e8e1c7241f81f00b7f9b78523db5d4" }, "downloads": -1, "filename": "collective.recipe.patch-0.1b1.tar.gz", "has_sig": false, "md5_digest": "8179a870a24c18482a79f6f516263aea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3938, "upload_time": "2008-10-27T16:48:02", "url": "https://files.pythonhosted.org/packages/0f/53/cf9e18dd3f50596f67b198a09ec25f2ffad303e1d39a90de4b5897bf5ee9/collective.recipe.patch-0.1b1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "82dd52cd545be0c3f8c0f72d611d047c", "sha256": "e6a7f9042595d492461abb153a55ca2f252cdae05206b7d531299ed1a09c7ca0" }, "downloads": -1, "filename": "collective.recipe.patch-0.2.tar.gz", "has_sig": false, "md5_digest": "82dd52cd545be0c3f8c0f72d611d047c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 253491, "upload_time": "2009-11-20T20:51:02", "url": "https://files.pythonhosted.org/packages/40/fd/e34cf8858f4d6bcfcca6b48db1377693a38cd5b4eea7eb04dff25ab1225c/collective.recipe.patch-0.2.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "0cde3c249daa05fc4479e06880f22744", "sha256": "262498a92d57a1dd658c7794ca6cb0b61cb52411aa765c0e527fa8380700733d" }, "downloads": -1, "filename": "collective.recipe.patch-0.2.2.tar.gz", "has_sig": false, "md5_digest": "0cde3c249daa05fc4479e06880f22744", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10744, "upload_time": "2009-12-14T18:10:20", "url": "https://files.pythonhosted.org/packages/9f/2e/d89753b9c70d2f7c905df8ee2ace059b782d7b8711e9ef319bdff08ad48d/collective.recipe.patch-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0cde3c249daa05fc4479e06880f22744", "sha256": "262498a92d57a1dd658c7794ca6cb0b61cb52411aa765c0e527fa8380700733d" }, "downloads": -1, "filename": "collective.recipe.patch-0.2.2.tar.gz", "has_sig": false, "md5_digest": "0cde3c249daa05fc4479e06880f22744", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10744, "upload_time": "2009-12-14T18:10:20", "url": "https://files.pythonhosted.org/packages/9f/2e/d89753b9c70d2f7c905df8ee2ace059b782d7b8711e9ef319bdff08ad48d/collective.recipe.patch-0.2.2.tar.gz" } ] }