public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] dev/mrueg:master commit in: eclass/
@ 2015-06-25 10:45 Manuel Rüger
  0 siblings, 0 replies; 16+ messages in thread
From: Manuel Rüger @ 2015-06-25 10:45 UTC (permalink / raw
  To: gentoo-commits

commit:     2df56853ddc8b2a627c0c6167b8b1c9a2073f135
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 25 10:44:07 2015 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Thu Jun 25 10:44:07 2015 +0000
URL:        https://gitweb.gentoo.org/dev/mrueg.git/commit/?id=2df56853

[eclass] Initial version of github.eclass.

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

diff --git a/eclass/github.eclass b/eclass/github.eclass
new file mode 100644
index 0000000..df0263d
--- /dev/null
+++ b/eclass/github.eclass
@@ -0,0 +1,135 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+# @ECLASS: github.eclass
+# @MAINTAINER:
+# mrueg@gentoo.org
+# @BLURB: Support eclass for packages hosted on Github.
+# @DESCRIPTION:
+# The github.eclass provides support for packages hosted on Github.
+
+if [[ -z ${_GH_ECLASS} ]]; then
+_GH_ECLASS=1
+
+case "${EAPI:-0}" in
+	5)
+		;;
+	*)
+		die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
+		;;
+esac
+
+# @ECLASS-VARIABLE: GH_USER
+# @DESCRIPTION:
+# Github user, usually a project or user.
+: ${GH_USER:=${PN}}
+
+# @ECLASS-VARIABLE: GH_REPO
+# @DESCRIPTION:
+# Github repository name.
+: ${GH_REPO:=${PN}}
+
+# @ECLASS-VARIABLE: GH_BUILD_TYPE
+# @DESCRIPTION:
+# Live ebuilds use "live" here.
+: ${GH_BUILD_TYPE:=default}
+
+# @ECLASS-VARIABLE: GH_PATCHES
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# Patches to be fetched and applied from Github by commit id.
+# Example:
+# @CODE
+# GH_PATCHES=( "b02c39fb8dec9043b0ac9d23d5caec19b8b0c337" )
+# @CODE
+
+# @ECLASS-VARIABLE: GH_TAG
+# @DESCRIPTION:
+# Tag/commit that is fetched from Github.
+: ${GH_TAG:=${PV}}
+
+
+inherit eutils
+
+if [[ ${PV} == *9999 ]]; then
+	GH_BUILD_TYPE=live
+fi
+
+if [[ ${GH_BUILD_TYPE} = live ]]; then
+	inherit git-r3
+fi
+
+if [[ ${GH_BUILD_TYPE} = default ]]; then
+	inherit vcs-snapshot
+fi
+
+HOMEPAGE="https://github.com/${GH_USER}/${GH_REPO}"
+
+EXPORT_FUNCTIONS src_prepare src_unpack
+
+# If patches are fetched, calculate their location
+_calculate_patches_uri() {
+	if [[ -n $GH_PATCHES ]]; then
+            _GH_PATCHES=
+            for gh_commit in "${GH_PATCHES[@]}"; do
+                SRC_URI=+" https://github.com/${GH_USER}/${GH_REPO}/commit/${gh_commit}.patch -> ${PN}-${gh_commit}.patch"
+                _GH_PATCHES+=( "${DISTDIR}"/${PN}-${gh_commit}.patch )
+            done
+    fi
+}
+
+
+# Determine fetch location for tarballs and patches
+_calculate_src_uri() {
+	debug-print-function ${FUNCNAME} "$@"
+	SRC_URI="https://github.com/${GH_USER}/${GH_REPO}/archive/${GH_TAG}.tar.gz -> ${P}.tar.gz"
+}
+
+# Determine fetch location for live sources
+_calculate_live_repo() {
+	debug-print-function ${FUNCNAME} "$@"
+
+	SRC_URI=""
+	# @ECLASS-VARIABLE: EGIT_MIRROR
+        # @DESCRIPTION:
+	# This variable allows easy overriding of default kde mirror service
+	# (anongit) with anything else you might want to use.
+	EGIT_MIRROR=${EGIT_MIRROR:=https://github.com}
+	
+	EGIT_REPO_URI="${EGIT_MIRROR}/${GH_USER}/${GH_REPO}.git"
+}
+
+
+case ${GH_BUILD_TYPE} in
+	live) _calculate_live_repo ;;
+	default) _calculate_src_uri ;;
+esac
+_calculate_patches_uri
+
+debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
+
+# @FUNCTION: github_src_unpack
+# @DESCRIPTION:
+# Function for unpacking Github packages.
+github_src_unpack() {
+	debug-print-function ${FUNCNAME} "$@"
+
+	if [[ ${GH_BUILD_TYPE} = live ]]; then
+		git-r3_src_unpack
+	else
+		vcs-snapshot_src_unpack
+	fi
+}
+
+
+# @FUNCTION: github_src_unpack
+# @DESCRIPTION:
+# Function for applying patches to Github packages.
+github_src_prepare() {
+    [[ $_GH_PATCHES ]] && epatch "${_GH_PATCHES[@]}"
+    epatch_user
+    default
+}
+
+fi


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] dev/mrueg:master commit in: eclass/
@ 2015-06-25 10:47 Manuel Rüger
  0 siblings, 0 replies; 16+ messages in thread
From: Manuel Rüger @ 2015-06-25 10:47 UTC (permalink / raw
  To: gentoo-commits

commit:     9de3d60c10c8cc33aa05c2a7fcd6d4b345c386a9
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 25 10:47:11 2015 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Thu Jun 25 10:47:11 2015 +0000
URL:        https://gitweb.gentoo.org/dev/mrueg.git/commit/?id=9de3d60c

[eclass] Fix function name.

 eclass/github.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/github.eclass b/eclass/github.eclass
index df0263d..d4691ef 100644
--- a/eclass/github.eclass
+++ b/eclass/github.eclass
@@ -123,7 +123,7 @@ github_src_unpack() {
 }
 
 
-# @FUNCTION: github_src_unpack
+# @FUNCTION: github_src_prepare
 # @DESCRIPTION:
 # Function for applying patches to Github packages.
 github_src_prepare() {


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] dev/mrueg:master commit in: eclass/
@ 2015-06-25 11:03 Manuel Rüger
  0 siblings, 0 replies; 16+ messages in thread
From: Manuel Rüger @ 2015-06-25 11:03 UTC (permalink / raw
  To: gentoo-commits

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

[eclass] Fix live ebuild logic.

 eclass/github.eclass | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/eclass/github.eclass b/eclass/github.eclass
index d4691ef..6c302f5 100644
--- a/eclass/github.eclass
+++ b/eclass/github.eclass
@@ -31,9 +31,10 @@ esac
 : ${GH_REPO:=${PN}}
 
 # @ECLASS-VARIABLE: GH_BUILD_TYPE
+# @DEFAULT-UNSET
 # @DESCRIPTION:
-# Live ebuilds use "live" here.
-: ${GH_BUILD_TYPE:=default}
+# Defines if fetched from git ("live") or tarball ("release")
+# Use if autodetection via PV fails.
 
 # @ECLASS-VARIABLE: GH_PATCHES
 # @DEFAULT_UNSET
@@ -52,15 +53,21 @@ esac
 
 inherit eutils
 
-if [[ ${PV} == *9999 ]]; then
-	GH_BUILD_TYPE=live
+if [[ -z ${GH_BUILD_TYPE}  ]]; then
+	if [[ ${PV} == *9999 ]]; then
+		_GH_BUILD_TYPE=live
+	else
+		_GH_BUILD_TYPE=release
+	fi
+else 
+	_GH_BUILD_TYPE=$GH_BUILD_TYPE
 fi
 
 if [[ ${GH_BUILD_TYPE} = live ]]; then
 	inherit git-r3
 fi
 
-if [[ ${GH_BUILD_TYPE} = default ]]; then
+if [[ ${GH_BUILD_TYPE} = release ]]; then
 	inherit vcs-snapshot
 fi
 
@@ -115,7 +122,7 @@ debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
 github_src_unpack() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	if [[ ${GH_BUILD_TYPE} = live ]]; then
+	if [[ ${_GH_BUILD_TYPE} = live ]]; then
 		git-r3_src_unpack
 	else
 		vcs-snapshot_src_unpack


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] dev/mrueg:master commit in: eclass/
@ 2015-06-25 11:07 Manuel Rüger
  0 siblings, 0 replies; 16+ messages in thread
From: Manuel Rüger @ 2015-06-25 11:07 UTC (permalink / raw
  To: gentoo-commits

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

[eclass] Fix patch SRC_URI creation.

 eclass/github.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/github.eclass b/eclass/github.eclass
index 6c302f5..7f33ab5 100644
--- a/eclass/github.eclass
+++ b/eclass/github.eclass
@@ -80,7 +80,7 @@ _calculate_patches_uri() {
 	if [[ -n $GH_PATCHES ]]; then
             _GH_PATCHES=
             for gh_commit in "${GH_PATCHES[@]}"; do
-                SRC_URI=+" https://github.com/${GH_USER}/${GH_REPO}/commit/${gh_commit}.patch -> ${PN}-${gh_commit}.patch"
+                SRC_URI+=" https://github.com/${GH_USER}/${GH_REPO}/commit/${gh_commit}.patch -> ${PN}-${gh_commit}.patch"
                 _GH_PATCHES+=( "${DISTDIR}"/${PN}-${gh_commit}.patch )
             done
     fi


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] dev/mrueg:master commit in: eclass/
@ 2015-06-25 11:09 Manuel Rüger
  0 siblings, 0 replies; 16+ messages in thread
From: Manuel Rüger @ 2015-06-25 11:09 UTC (permalink / raw
  To: gentoo-commits

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

[eclass] Fix live ebuild logic.

 eclass/github.eclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/eclass/github.eclass b/eclass/github.eclass
index 7f33ab5..f2ff0c0 100644
--- a/eclass/github.eclass
+++ b/eclass/github.eclass
@@ -63,11 +63,11 @@ else
 	_GH_BUILD_TYPE=$GH_BUILD_TYPE
 fi
 
-if [[ ${GH_BUILD_TYPE} = live ]]; then
+if [[ ${_GH_BUILD_TYPE} = live ]]; then
 	inherit git-r3
 fi
 
-if [[ ${GH_BUILD_TYPE} = release ]]; then
+if [[ ${_GH_BUILD_TYPE} = release ]]; then
 	inherit vcs-snapshot
 fi
 
@@ -108,9 +108,9 @@ _calculate_live_repo() {
 }
 
 
-case ${GH_BUILD_TYPE} in
+case ${_GH_BUILD_TYPE} in
 	live) _calculate_live_repo ;;
-	default) _calculate_src_uri ;;
+	release) _calculate_src_uri ;;
 esac
 _calculate_patches_uri
 


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] dev/mrueg:master commit in: eclass/
@ 2015-06-25 11:11 Manuel Rüger
  0 siblings, 0 replies; 16+ messages in thread
From: Manuel Rüger @ 2015-06-25 11:11 UTC (permalink / raw
  To: gentoo-commits

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

[eclass] Use tabs.

 eclass/github.eclass | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/eclass/github.eclass b/eclass/github.eclass
index f2ff0c0..7b83a99 100644
--- a/eclass/github.eclass
+++ b/eclass/github.eclass
@@ -78,12 +78,12 @@ EXPORT_FUNCTIONS src_prepare src_unpack
 # If patches are fetched, calculate their location
 _calculate_patches_uri() {
 	if [[ -n $GH_PATCHES ]]; then
-            _GH_PATCHES=
-            for gh_commit in "${GH_PATCHES[@]}"; do
-                SRC_URI+=" https://github.com/${GH_USER}/${GH_REPO}/commit/${gh_commit}.patch -> ${PN}-${gh_commit}.patch"
-                _GH_PATCHES+=( "${DISTDIR}"/${PN}-${gh_commit}.patch )
-            done
-    fi
+		GH_PATCHES=
+		for gh_commit in "${GH_PATCHES[@]}"; do
+			SRC_URI+=" https://github.com/${GH_USER}/${GH_REPO}/commit/${gh_commit}.patch -> ${PN}-${gh_commit}.patch"
+			_GH_PATCHES+=( "${DISTDIR}"/${PN}-${gh_commit}.patch )
+		done
+	fi
 }
 
 
@@ -134,9 +134,11 @@ github_src_unpack() {
 # @DESCRIPTION:
 # Function for applying patches to Github packages.
 github_src_prepare() {
-    [[ $_GH_PATCHES ]] && epatch "${_GH_PATCHES[@]}"
-    epatch_user
-    default
+	debug-print-function ${FUNCNAME} "$@"
+
+	[[ $_GH_PATCHES ]] && epatch "${_GH_PATCHES[@]}"
+	epatch_user
+	default
 }
 
 fi


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] dev/mrueg:master commit in: eclass/
@ 2015-06-25 11:18 Manuel Rüger
  0 siblings, 0 replies; 16+ messages in thread
From: Manuel Rüger @ 2015-06-25 11:18 UTC (permalink / raw
  To: gentoo-commits

commit:     8513b9d9116f022beee4db57a2bae394b236e47b
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 25 11:18:05 2015 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Thu Jun 25 11:18:05 2015 +0000
URL:        https://gitweb.gentoo.org/dev/mrueg.git/commit/?id=8513b9d9

[eclass] Fix patch logic.

 eclass/github.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/github.eclass b/eclass/github.eclass
index 7b83a99..1099bf0 100644
--- a/eclass/github.eclass
+++ b/eclass/github.eclass
@@ -75,13 +75,13 @@ HOMEPAGE="https://github.com/${GH_USER}/${GH_REPO}"
 
 EXPORT_FUNCTIONS src_prepare src_unpack
 
+
 # If patches are fetched, calculate their location
 _calculate_patches_uri() {
 	if [[ -n $GH_PATCHES ]]; then
-		GH_PATCHES=
 		for gh_commit in "${GH_PATCHES[@]}"; do
 			SRC_URI+=" https://github.com/${GH_USER}/${GH_REPO}/commit/${gh_commit}.patch -> ${PN}-${gh_commit}.patch"
-			_GH_PATCHES+=( "${DISTDIR}"/${PN}-${gh_commit}.patch )
+			_GH_PATCHES+=("${DISTDIR}"/${PN}-${gh_commit}.patch)
 		done
 	fi
 }


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] dev/mrueg:master commit in: eclass/
@ 2015-06-25 11:38 Manuel Rüger
  0 siblings, 0 replies; 16+ messages in thread
From: Manuel Rüger @ 2015-06-25 11:38 UTC (permalink / raw
  To: gentoo-commits

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
 }
 
 


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] dev/mrueg:master commit in: eclass/
@ 2015-06-25 11:45 Manuel Rüger
  0 siblings, 0 replies; 16+ messages in thread
From: Manuel Rüger @ 2015-06-25 11:45 UTC (permalink / raw
  To: gentoo-commits

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

[eclass] Fix examples. Rename vars. Pluralize.

 eclass/github.eclass | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/eclass/github.eclass b/eclass/github.eclass
index e14ac70..4b4ac68 100644
--- a/eclass/github.eclass
+++ b/eclass/github.eclass
@@ -42,16 +42,16 @@ esac
 # Patches to be fetched and applied from Github by commit id.
 # Example:
 # @CODE
-# GH_PATCHES=( "b02c39fb8dec9043b0ac9d23d5caec19b8b0c337" )
+# GH_PATCHES=("b02c39fb8dec9043b0ac9d23d5caec19b8b0c337" "b0c337b02c39fb8dec9043b0ac9d23d5caec19b8" )
 # @CODE
 
-# @ECLASS-VARIABLE: GH_PULLREQ
+# @ECLASS-VARIABLE: GH_PULLREQS
 # @DEFAULT_UNSET
 # @DESCRIPTION:
 # Pull requests to be fetched and applied from Github by its id.
 # Example:
 # @CODE
-# GH_PULLREQ=( 17 19 )
+# GH_PULLREQS=(17 19)
 # @CODE
 
 
@@ -95,9 +95,9 @@ _calculate_patches_uri() {
 		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)
+			for gh_pullreqid in "${GH_PULLREQS[@]}"; do
+			SRC_URI+=" https://github.com/${GH_USER}/${GH_REPO}/pull//${gh_pullreq}.patch -> ${PN}-pr-${gh_pullreq}.patch"
+			_GH_PATCHES+=("${DISTDIR}"/${PN}-pr-${gh_pullreqid}.patch)
 		done
         fi
 }


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] dev/mrueg:master commit in: eclass/
@ 2015-06-25 11:45 Manuel Rüger
  0 siblings, 0 replies; 16+ messages in thread
From: Manuel Rüger @ 2015-06-25 11:45 UTC (permalink / raw
  To: gentoo-commits

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

[eclass] Use tabs.

 eclass/github.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/github.eclass b/eclass/github.eclass
index 3885e18..e14ac70 100644
--- a/eclass/github.eclass
+++ b/eclass/github.eclass
@@ -95,7 +95,7 @@ _calculate_patches_uri() {
 		done
 	fi
 	if [[ -n $GH_PULLREQ ]]; then 
-                for gh_commit in "${GH_PULLREQ[@]}"; do
+			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


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] dev/mrueg:master commit in: eclass/
@ 2015-06-25 11:46 Manuel Rüger
  0 siblings, 0 replies; 16+ messages in thread
From: Manuel Rüger @ 2015-06-25 11:46 UTC (permalink / raw
  To: gentoo-commits

commit:     513b4eb21f56a56cb6b363ed0fb690240330cabe
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 25 11:46:19 2015 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Thu Jun 25 11:46:19 2015 +0000
URL:        https://gitweb.gentoo.org/dev/mrueg.git/commit/?id=513b4eb2

[eclass] Fix incomplete renaming.

 eclass/github.eclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eclass/github.eclass b/eclass/github.eclass
index 4b4ac68..3b06e06 100644
--- a/eclass/github.eclass
+++ b/eclass/github.eclass
@@ -95,9 +95,9 @@ _calculate_patches_uri() {
 		done
 	fi
 	if [[ -n $GH_PULLREQ ]]; then 
-			for gh_pullreqid in "${GH_PULLREQS[@]}"; do
+			for gh_pullreq in "${GH_PULLREQS[@]}"; do
 			SRC_URI+=" https://github.com/${GH_USER}/${GH_REPO}/pull//${gh_pullreq}.patch -> ${PN}-pr-${gh_pullreq}.patch"
-			_GH_PATCHES+=("${DISTDIR}"/${PN}-pr-${gh_pullreqid}.patch)
+			_GH_PATCHES+=("${DISTDIR}"/${PN}-pr-${gh_pullreq}.patch)
 		done
         fi
 }


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] dev/mrueg:master commit in: eclass/
@ 2015-06-25 11:47 Manuel Rüger
  0 siblings, 0 replies; 16+ messages in thread
From: Manuel Rüger @ 2015-06-25 11:47 UTC (permalink / raw
  To: gentoo-commits

commit:     102cd13c63c02f8b9515079549deffe7364b105b
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 25 11:47:07 2015 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Thu Jun 25 11:47:07 2015 +0000
URL:        https://gitweb.gentoo.org/dev/mrueg.git/commit/?id=102cd13c

[eclass] Drop superfluous /

 eclass/github.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/github.eclass b/eclass/github.eclass
index 3b06e06..1f2b4b1 100644
--- a/eclass/github.eclass
+++ b/eclass/github.eclass
@@ -96,7 +96,7 @@ _calculate_patches_uri() {
 	fi
 	if [[ -n $GH_PULLREQ ]]; then 
 			for gh_pullreq in "${GH_PULLREQS[@]}"; do
-			SRC_URI+=" https://github.com/${GH_USER}/${GH_REPO}/pull//${gh_pullreq}.patch -> ${PN}-pr-${gh_pullreq}.patch"
+			SRC_URI+=" https://github.com/${GH_USER}/${GH_REPO}/pull/${gh_pullreq}.patch -> ${PN}-pr-${gh_pullreq}.patch"
 			_GH_PATCHES+=("${DISTDIR}"/${PN}-pr-${gh_pullreq}.patch)
 		done
         fi


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] dev/mrueg:master commit in: eclass/
@ 2015-06-25 11:50 Manuel Rüger
  0 siblings, 0 replies; 16+ messages in thread
From: Manuel Rüger @ 2015-06-25 11:50 UTC (permalink / raw
  To: gentoo-commits

commit:     297b2be87e49cea04048b474bda94d2086803f16
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 25 11:50:04 2015 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Thu Jun 25 11:50:04 2015 +0000
URL:        https://gitweb.gentoo.org/dev/mrueg.git/commit/?id=297b2be8

[eclass] Fix tabs.

 eclass/github.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/github.eclass b/eclass/github.eclass
index 1f2b4b1..a80d03d 100644
--- a/eclass/github.eclass
+++ b/eclass/github.eclass
@@ -95,7 +95,7 @@ _calculate_patches_uri() {
 		done
 	fi
 	if [[ -n $GH_PULLREQ ]]; then 
-			for gh_pullreq in "${GH_PULLREQS[@]}"; do
+		for gh_pullreq in "${GH_PULLREQS[@]}"; do
 			SRC_URI+=" https://github.com/${GH_USER}/${GH_REPO}/pull/${gh_pullreq}.patch -> ${PN}-pr-${gh_pullreq}.patch"
 			_GH_PATCHES+=("${DISTDIR}"/${PN}-pr-${gh_pullreq}.patch)
 		done


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] dev/mrueg:master commit in: eclass/
@ 2015-06-25 15:39 Manuel Rüger
  0 siblings, 0 replies; 16+ messages in thread
From: Manuel Rüger @ 2015-06-25 15:39 UTC (permalink / raw
  To: gentoo-commits

commit:     b65dc4182faa8eddf83fc679855d54443db60049
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 25 15:39:03 2015 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Thu Jun 25 15:39:03 2015 +0000
URL:        https://gitweb.gentoo.org/dev/mrueg.git/commit/?id=b65dc418

[eclass] Rework patches. Add support for forks.

 eclass/github.eclass | 85 ++++++++++++++++++++++++++++++++++++++--------------
 1 file changed, 62 insertions(+), 23 deletions(-)

diff --git a/eclass/github.eclass b/eclass/github.eclass
index a80d03d..ab5a66f 100644
--- a/eclass/github.eclass
+++ b/eclass/github.eclass
@@ -39,22 +39,16 @@ esac
 # @ECLASS-VARIABLE: GH_PATCHES
 # @DEFAULT_UNSET
 # @DESCRIPTION:
-# Patches to be fetched and applied from Github by commit id.
+# Patches, pull requests, patches from forks to be fetched and applied.
+# Prefix:
+# f: - Regular patch from FILESDIR
+# c: - Patch identified by commit, optional: fork name
+# p: - Patch identified by pull request id, optional: fork name
 # Example:
 # @CODE
-# GH_PATCHES=("b02c39fb8dec9043b0ac9d23d5caec19b8b0c337" "b0c337b02c39fb8dec9043b0ac9d23d5caec19b8" )
+# GH_PATCHES=("c:b02c39fb8dec9043b0ac9d23d5caec19b8b0c337" "c:gentoo/b0c337b02c39fb8dec9043b0ac9d23d5caec19b8" "foo.patch" "p:1" "p:gentoo/17" )
 # @CODE
 
-# @ECLASS-VARIABLE: GH_PULLREQS
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# Pull requests to be fetched and applied from Github by its id.
-# Example:
-# @CODE
-# GH_PULLREQS=(17 19)
-# @CODE
-
-
 # @ECLASS-VARIABLE: GH_TAG
 # @DESCRIPTION:
 # Tag/commit that is fetched from Github.
@@ -63,6 +57,10 @@ esac
 
 inherit eutils
 
+if [[ ${PV} != *9999 && ${GH_BUILD_TYPE} == live ]]; then
+    eqawarn "Uncommon package version for a live ebuild."
+fi 
+
 if [[ -z ${GH_BUILD_TYPE}  ]]; then
 	if [[ ${PV} == *9999 ]]; then
 		_GH_BUILD_TYPE=live
@@ -85,27 +83,68 @@ HOMEPAGE="https://github.com/${GH_USER}/${GH_REPO}"
 
 EXPORT_FUNCTIONS src_prepare src_unpack
 
+_patch_calc_commit() {
+	debug-print-function ${FUNCNAME} "$@"
+
+	local gh_filepatch="$1"
+	_GH_PATCHES+=($gh_filepatch)
+}
+
+_patch_calc_commit() {
+	debug-print-function ${FUNCNAME} "$@"
+
+	local gh_patch="$1"
+	local gh_commit=${gh_patch##*/}
+	local gh_fork=${GH_USER}
+	local gh_forkedby=""
+	if [[ "${gh_patch}" == */* ]]; then 
+		gh_fork=${gh_patch%%/*}
+		gh_forkedby=${gh_fork}-
+	fi
+	SRC_URI+=" https://github.com/${GH_USER}/${GH_REPO}/commit/${gh_commit}.patch -> ${PN}-${gh_forkedby}${gh_commit}.patch"
+	_GH_PATCHES+=("${DISTDIR}"/${PN}-${gh_forkedby}${gh_commit}.patch)
+}
+
+_patch_calc_pull-request() {
+	debug-print-function ${FUNCNAME} "$@"
+
+	local gh_patch="$1"
+	local gh_pullreq=${gh_patch##*/}
+	local gh_fork=${GH_USER}
+	local gh_forkedby=""
+
+	if [[ "${gh_patch}" == */* ]]; then 
+		gh_fork=${gh_patch%%/*}
+		gh_forkedby=${gh_fork}-
+	fi
+ 
+	SRC_URI+=" https://github.com/${gh_fork}/${GH_REPO}/pull/${gh_pullreq}.patch -> ${PN}-pr${gh_forkedby}-${gh_pullreq}.patch"
+	_GH_PATCHES+=("${DISTDIR}"/${PN}-pr-${gh_forkedby}${gh_pullreq}.patch)
+}
 
 # If patches are fetched, calculate their location
 _calculate_patches_uri() {
 	if [[ -n $GH_PATCHES ]]; then
 		for gh_commit in "${GH_PATCHES[@]}"; do
-			SRC_URI+=" https://github.com/${GH_USER}/${GH_REPO}/commit/${gh_commit}.patch -> ${PN}-${gh_commit}.patch"
-			_GH_PATCHES+=("${DISTDIR}"/${PN}-${gh_commit}.patch)
+			case ${gh_commit:0:1} in
+				f) _patch_calc_filesdir "${gh_commit:2}"
+				;;
+				c) _patch_calc_commit "${gh_commit:2}"
+				;;
+				p) _patch_calc-pull_request "${gh_commit:2}"
+				;;
+				*) die "Wrong patch pattern: ${gh_commit}"
+				;;
+			esac
 		done
 	fi
-	if [[ -n $GH_PULLREQ ]]; then 
-		for gh_pullreq in "${GH_PULLREQS[@]}"; do
-			SRC_URI+=" https://github.com/${GH_USER}/${GH_REPO}/pull/${gh_pullreq}.patch -> ${PN}-pr-${gh_pullreq}.patch"
-			_GH_PATCHES+=("${DISTDIR}"/${PN}-pr-${gh_pullreq}.patch)
-		done
-        fi
 }
 
 
 # Determine fetch location for tarballs and patches
 _calculate_src_uri() {
 	debug-print-function ${FUNCNAME} "$@"
+
 	SRC_URI="https://github.com/${GH_USER}/${GH_REPO}/archive/${GH_TAG}.tar.gz -> ${P}.tar.gz"
 }
 
@@ -115,9 +154,9 @@ _calculate_live_repo() {
 
 	SRC_URI=""
 	# @ECLASS-VARIABLE: EGIT_MIRROR
-        # @DESCRIPTION:
-	# This variable allows easy overriding of default kde mirror service
-	# (anongit) with anything else you might want to use.
+	# @DESCRIPTION:
+	# This variable allows easy overriding of github uri.
+	# (uses https) with anything else you might want to use.
 	EGIT_MIRROR=${EGIT_MIRROR:=https://github.com}
 	
 	EGIT_REPO_URI="${EGIT_MIRROR}/${GH_USER}/${GH_REPO}.git"


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] dev/mrueg:master commit in: eclass/
@ 2015-06-25 16:55 Manuel Rüger
  0 siblings, 0 replies; 16+ messages in thread
From: Manuel Rüger @ 2015-06-25 16:55 UTC (permalink / raw
  To: gentoo-commits

commit:     bce9e5d6475b8aebbdd5cdf8add8fab29e9d4316
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 25 16:35:47 2015 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Thu Jun 25 16:35:47 2015 +0000
URL:        https://gitweb.gentoo.org/dev/mrueg.git/commit/?id=bce9e5d6

[eclass] Drop live ebuild detection.

 eclass/github.eclass | 28 +++++++---------------------
 1 file changed, 7 insertions(+), 21 deletions(-)

diff --git a/eclass/github.eclass b/eclass/github.eclass
index ab5a66f..bb6ff35 100644
--- a/eclass/github.eclass
+++ b/eclass/github.eclass
@@ -34,7 +34,7 @@ esac
 # @DEFAULT-UNSET
 # @DESCRIPTION:
 # Defines if fetched from git ("live") or tarball ("release")
-# Use if autodetection via PV fails.
+: ${GH_BUILD_TYPE:=release}
 
 # @ECLASS-VARIABLE: GH_PATCHES
 # @DEFAULT_UNSET
@@ -57,25 +57,11 @@ esac
 
 inherit eutils
 
-if [[ ${PV} != *9999 && ${GH_BUILD_TYPE} == live ]]; then
-    eqawarn "Uncommon package version for a live ebuild."
-fi 
-
-if [[ -z ${GH_BUILD_TYPE}  ]]; then
-	if [[ ${PV} == *9999 ]]; then
-		_GH_BUILD_TYPE=live
-	else
-		_GH_BUILD_TYPE=release
-	fi
-else 
-	_GH_BUILD_TYPE=$GH_BUILD_TYPE
-fi
-
-if [[ ${_GH_BUILD_TYPE} = live ]]; then
+if [[ ${GH_BUILD_TYPE} = live ]]; then
 	inherit git-r3
 fi
 
-if [[ ${_GH_BUILD_TYPE} = release ]]; then
+if [[ ${GH_BUILD_TYPE} = release ]]; then
 	inherit vcs-snapshot
 fi
 
@@ -83,7 +69,7 @@ HOMEPAGE="https://github.com/${GH_USER}/${GH_REPO}"
 
 EXPORT_FUNCTIONS src_prepare src_unpack
 
-_patch_calc_commit() {
+_patch_calc_filesdir() {
 	debug-print-function ${FUNCNAME} "$@"
 
 	local gh_filepatch="$1"
@@ -131,7 +117,7 @@ _calculate_patches_uri() {
 				;;
 				c) _patch_calc_commit "${gh_commit:2}"
 				;;
-				p) _patch_calc-pull_request "${gh_commit:2}"
+				p) _patch_calc_pull-request "${gh_commit:2}"
 				;;
 				*) die "Wrong patch pattern: ${gh_commit}"
 				;;
@@ -163,7 +149,7 @@ _calculate_live_repo() {
 }
 
 
-case ${_GH_BUILD_TYPE} in
+case ${GH_BUILD_TYPE} in
 	live) _calculate_live_repo ;;
 	release) _calculate_src_uri ;;
 esac
@@ -177,7 +163,7 @@ debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
 github_src_unpack() {
 	debug-print-function ${FUNCNAME} "$@"
 
-	if [[ ${_GH_BUILD_TYPE} = live ]]; then
+	if [[ ${GH_BUILD_TYPE} = live ]]; then
 		git-r3_src_unpack
 	else
 		vcs-snapshot_src_unpack


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [gentoo-commits] dev/mrueg:master commit in: eclass/
@ 2015-12-31 11:42 Manuel Rüger
  0 siblings, 0 replies; 16+ messages in thread
From: Manuel Rüger @ 2015-12-31 11:42 UTC (permalink / raw
  To: gentoo-commits

commit:     5c2e26f6095b13dde5ebbd1a2e072b64edc4704d
Author:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 31 11:42:01 2015 +0000
Commit:     Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Thu Dec 31 11:42:01 2015 +0000
URL:        https://gitweb.gentoo.org/dev/mrueg.git/commit/?id=5c2e26f6

eclass: Fix typo

 eclass/github.eclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/eclass/github.eclass b/eclass/github.eclass
index bb6ff35..2f0a45f 100644
--- a/eclass/github.eclass
+++ b/eclass/github.eclass
@@ -31,7 +31,7 @@ esac
 : ${GH_REPO:=${PN}}
 
 # @ECLASS-VARIABLE: GH_BUILD_TYPE
-# @DEFAULT-UNSET
+# @DEFAULT_UNSET
 # @DESCRIPTION:
 # Defines if fetched from git ("live") or tarball ("release")
 : ${GH_BUILD_TYPE:=release}


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-12-31 11:42 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-25 10:47 [gentoo-commits] dev/mrueg:master commit in: eclass/ Manuel Rüger
  -- strict thread matches above, loose matches on Subject: below --
2015-12-31 11:42 Manuel Rüger
2015-06-25 16:55 Manuel Rüger
2015-06-25 15:39 Manuel Rüger
2015-06-25 11:50 Manuel Rüger
2015-06-25 11:47 Manuel Rüger
2015-06-25 11:46 Manuel Rüger
2015-06-25 11:45 Manuel Rüger
2015-06-25 11:45 Manuel Rüger
2015-06-25 11:38 Manuel Rüger
2015-06-25 11:18 Manuel Rüger
2015-06-25 11:11 Manuel Rüger
2015-06-25 11:09 Manuel Rüger
2015-06-25 11:07 Manuel Rüger
2015-06-25 11:03 Manuel Rüger
2015-06-25 10:45 Manuel Rüger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox