commit:     257871ffc14ffe4b8b72ef2df315f3f82ef96e9b
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 25 11:38:38 2015 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Thu Jun 25 11:38:38 2015 +0000
URL:        https://gitweb.gentoo.org/dev/mrueg.git/commit/?id=257871ff

[eclass] Add support for pull requests.

 eclass/github.eclass | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/eclass/github.eclass b/eclass/github.eclass
index 1099bf0..3885e18 100644
--- a/eclass/github.eclass
+++ b/eclass/github.eclass
@@ -45,6 +45,16 @@ esac
 # GH_PATCHES=( "b02c39fb8dec9043b0ac9d23d5caec19b8b0c337" )
 # @CODE
 
+# @ECLASS-VARIABLE: GH_PULLREQ
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Pull requests to be fetched and applied from Github by its id.
+# Example:
+# @CODE
+# GH_PULLREQ=( 17 19 )
+# @CODE
+
+
 # @ECLASS-VARIABLE: GH_TAG
 # @DESCRIPTION:
 # Tag/commit that is fetched from Github.
@@ -84,6 +94,12 @@ _calculate_patches_uri() {
                        _GH_PATCHES+=("${DISTDIR}"/${PN}-${gh_commit}.patch)
                done
        fi
+       if [[ -n $GH_PULLREQ ]]; then 
+                for gh_commit in "${GH_PULLREQ[@]}"; do
+                       SRC_URI+=" 
https://github.com/${GH_USER}/${GH_REPO}/pull//${gh_commit}.patch -> 
${PN}-pr-${gh_commit}.patch"
+                       _GH_PATCHES+=("${DISTDIR}"/${PN}-pr-${gh_commit}.patch)
+               done
+        fi
 }
 
 

Reply via email to