Giter VIP home page Giter VIP logo

ferrypick's Introduction

ferrypick

Apply patches from Fedora dist git to different components.

This simple tool does 3 steps:

  1. download patch file from src.fedoraproject.org
  2. replaces package name with current dist-git work dir package name
  3. runs git am --reject on the product

Usage:

[python36 (f32 %)]$ git switch -c f32-backport
Switched to a new branch 'f32-backport'

[python36 (f32-backport %)]$ ferrypick https://src.fedoraproject.org/rpms/python3.6/pull-request/2
Downloading https://src.fedoraproject.org/rpms/python3.6/pull-request/2.patch
$ git am --reject /tmp/tmp7pa062j6.patch
Applying: Fix python3-config --configdir
Checking patch 00102-lib64.patch...
.git/rebase-apply/patch:26: new blank line at EOF.
+
Checking patch 00205-make-libpl-respect-lib64.patch...
Checking patch python36.spec...
error: while searching for:
#global prerel ...
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
Release: 4%{?dist}
License: Python



error: patch failed: python36.spec:17
error: while searching for:
# ======================================================

%changelog
* Wed May 06 2020 Miro Hrončok <[email protected]> - 3.6.10-4
- Rename from python36 to python3.6


error: patch failed: python36.spec:1535
Applied patch 00102-lib64.patch cleanly.
Applied patch 00205-make-libpl-respect-lib64.patch cleanly.
Applying patch python36.spec with 2 rejects...
Rejected hunk #1.
Hunk #2 applied cleanly.
Hunk #3 applied cleanly.
Rejected hunk #4.
Patch failed at 0001 Fix python3-config --configdir
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

[python36 (f32-backport *%|AM 1/1)]$ cat python36.spec.rej
diff a/python36.spec b/python36.spec	(rejected hunks)
@@ -17,7 +17,7 @@ URL: https://www.python.org/
 #global prerel ...
 %global upstream_version %{general_version}%{?prerel}
 Version: %{general_version}%{?prerel:~%{prerel}}
-Release: 4%{?dist}
+Release: 5%{?dist}
 License: Python
 
 
@@ -1535,6 +1529,9 @@ CheckPython optimized
 # ======================================================
 
 %changelog
+* Thu May 28 2020 Victor Stinner <[email protected]> - 3.6.10-5
+- Fix python3-config --configdir (rhbz#1772988).
+
 * Wed May 06 2020 Miro Hrončok <[email protected]> - 3.6.10-4
 - Rename from python36 to python3.6

Enjoy.

Beware of non-utf-8 patches

Pagure has a bug with patches containing non-utf-8 content. Hence if a commit contains such characters, always generate the patch file locally (git format-patch) and use ferrypick with local patch file, until the problem is fixed.

ferrypick's People

Contributors

frenzymadness avatar hroncok avatar vstinner avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ferrypick's Issues

Users on Python 3.7 only find unusable `dev1` version and can't update

Hi,
ferrypick installed (--user) from PyPI doesn't work. It fails with:

$ ferrypick --help
Traceback (most recent call last):
  File "/home/torsava/.local/bin/ferrypick", line 5, in <module>
    from ferrypick import main
ModuleNotFoundError: No module named 'ferrypick'

Steps to reproduce:

$ pip install --user ferrypick
$ ferrypick --help

It seems the module actually isn't there. When uninstalling ferrypick, only the binary and dist-info are listed:

$ pip uninstall ferrypick
Found existing installation: ferrypick 0.1.dev1
Uninstalling ferrypick-0.1.dev1:
  Would remove:
    /home/torsava/.local/bin/ferrypick
    /home/torsava/.local/lib/python3.7/site-packages/ferrypick-0.1.dev1.dist-info/*
Proceed (y/n)? 

RFE: Accept arbitrary Pagure instances URLs

COMMIT_RE = re.compile(r"^https://src\.fedoraproject\.org/\S+/([^/\s]+)/c/([0-9a-f]+)")
PR_RE = re.compile(r"^https://src\.fedoraproject\.org/\S+/([^/\s]+)/pull-request/\d+")

This prevents using the tool for other instances of Pagure. It would be better if that was not the case.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.