public inbox for gentoo-kernel@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-kernel] [PATCH] kernel-2.eclass: Add support for experimental genpatches.
@ 2013-09-03  0:02 Tom Wijsman
  0 siblings, 0 replies; only message in thread
From: Tom Wijsman @ 2013-09-03  0:02 UTC (permalink / raw
  To: gentoo-dev; +Cc: gentoo-kernel


[-- Attachment #1.1: Type: text/plain, Size: 3157 bytes --]

Hello everyone


Please only respond on the gentoo-dev ML.

Attached you will find a patch for kernel-2.eclass that adds support
for experimental genpatches; a response to the positive feedback on the
previous discussion [1], with subject "Proper distribution integration
of kernel *-sources, patches and configuration.". We also came up with
solutions for the negative feedback to get the best from both worlds.

 [1]: http://thread.gmane.org/gmane.linux.gentoo.kernel/740
      which starts in message ID <20130701164149.131490f8@TOMWIJ-GENTOO>

Its default functionality adds an USE flag which the users can use to
choose whether they want experimental patches or not; this behavior can
be further adjusted using three variables we provide, allowing the
ebuild writer to selectively decide how the patches are handled.

All possible combinations these variables as well as the USE flag can
be set in have been tested; so, in terms of functionality I think there
is nothing broken. mpagano and I have been using this during our recent
bumps as well; so, we are sure it doesn't break the default behavior.

The user can use both K_EXP_GENPATCHES_LIST and UNIPATCH_EXCLUDE to
respectively opt-in and opt-out control which experimental patches get
applied; this allows users to control them as they see fit.

Please note that we will check the patches to ensure they are guarded
by config checks; so, the sole reason the user has for doing the above
is to deal with possible collisions the user may have with user patches.

Please review the attached patch and let me know what you think...

Thank you in advance.


The rest of this mail are FAQ to attempt to answer common questions:

=== How are the genpatches affected? ===

As for genpatches, patches in the 5000-5099 range will be stored in an
experimental tarball; so, they are distributed separately and are not
part of the base and extra tarballs. If the user or ebuild writer does
not explicitly choose for experimental, it will thus not be fetched.

=== Are users that don't want experimental patches affected? ===

No, we will stay as stable and reliable as before; if users don't
explicitly opt in, they will not be affected by it on at least the
vanilla and gentoo sources. Other ebuild writers can see for themselves
if they want to defer from the defaults, but we encourage them not to.

Remember that with this change we try to deduplicate work; while doing
this, we do not force these patches on any user, there will be guards in
two places: The experimental USE flag and menuconfig. The new variables
in the eclass permit configuring which patches get applied as well.

=== How will the users be aware of this? ===

We plan to write a news article to document this as well as create a
sub project page explaining the experimental patches and everything
that comes along (their status, how to enable, pick them, etc ...).

-- 
With kind regards,

Tom Wijsman (TomWij)
Gentoo Developer

E-mail address  : TomWij@gentoo.org
GPG Public Key  : 6D34E57D
GPG Fingerprint : C165 AF18 AB4C 400B C3D2  ABF0 95B2 1FCD 6D34 E57D

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: kernel-2.eclass.patch --]
[-- Type: text/x-patch, Size: 3185 bytes --]

--- a/kernel-2.eclass
+++ b/kernel-2.eclass
@@ -40,7 +40,13 @@
 # K_DEFCONFIG			- Allow specifying a different defconfig target.
 #						  If length zero, defaults to "defconfig".
 # K_WANT_GENPATCHES		- Apply genpatches to kernel source. Provide any
-# 						  combination of "base" and "extras"
+# 						  combination of "base", "extras" or "experimental".
+# K_EXP_GENPATCHES_PULL	- If set, we pull "experimental" regardless of the USE FLAG
+#						  but expect the ebuild maintainer to use K_EXP_GENPATCHES_LIST.
+# K_EXP_GENPATCHES_NOUSE	- If set, no USE flag will be provided for "experimental";
+# 						  as a result the user cannot choose to apply those patches.
+# K_EXP_GENPATCHES_LIST	- A list of patches to pick from "experimental" to apply when
+# 						  the USE flag is unset and K_EXP_GENPATCHES_PULL is set.
 # K_GENPATCHES_VER		- The version of the genpatches tarball(s) to apply.
 #						  A value of "5" would apply genpatches-2.6.12-5 to
 #						  my-sources-2.6.12.ebuild
@@ -130,18 +136,32 @@
 	# respectively.  Handle this.
 
 	for i in ${K_WANT_GENPATCHES} ; do
-	if [[ ${KV_MAJOR} -ge 3 ]]; then
-		if [[ ${#OKV_ARRAY[@]} -ge 3 ]]; then
-			tarball="genpatches-${KV_MAJOR}.${KV_MINOR}-${K_GENPATCHES_VER}.${i}.tar.xz"
+		if [[ ${KV_MAJOR} -ge 3 ]]; then
+			if [[ ${#OKV_ARRAY[@]} -ge 3 ]]; then
+				tarball="genpatches-${KV_MAJOR}.${KV_MINOR}-${K_GENPATCHES_VER}.${i}.tar.xz"
+			else
+				tarball="genpatches-${KV_MAJOR}.${KV_PATCH}-${K_GENPATCHES_VER}.${i}.tar.xz"
+			fi
 		else
-			tarball="genpatches-${KV_MAJOR}.${KV_PATCH}-${K_GENPATCHES_VER}.${i}.tar.xz"
+			tarball="genpatches-${OKV}-${K_GENPATCHES_VER}.${i}.tar.xz"
 		fi
-	else
-		tarball="genpatches-${OKV}-${K_GENPATCHES_VER}.${i}.tar.xz"
-	fi
-	debug-print "genpatches tarball: $tarball"
-	GENPATCHES_URI="${GENPATCHES_URI} mirror://gentoo/${tarball}"
-	UNIPATCH_LIST_GENPATCHES="${UNIPATCH_LIST_GENPATCHES} ${DISTDIR}/${tarball}"
+
+		local use_cond_start="" use_cond_end=""
+
+		if [[ "${i}" == "experimental" && -z ${K_EXP_GENPATCHES_PULL} && -z ${K_EXP_GENPATCHES_NOUSE} ]] ; then
+			use_cond_start="experimental? ( "
+			use_cond_end=" )"
+
+			if use experimental ; then
+				UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}"
+				debug-print "genpatches tarball: $tarball"
+			fi
+		else
+			UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}"
+			debug-print "genpatches tarball: $tarball"
+		fi
+
+		GENPATCHES_URI+=" ${use_cond_start}mirror://gentoo/${tarball}${use_cond_end}"
 	done
 }
 
@@ -955,6 +975,20 @@
 				fi
 			fi
 		fi
+
+		# If experimental was not chosen by the user, drop experimental patches not in K_EXP_GENPATCHES_LIST.
+		if [[ "${i}" == *"genpatches-"*".experimental."* && -n ${K_EXP_GENPATCHES_PULL} ]] ; then
+			if [[ -z ${K_EXP_GENPATCHES_NOUSE} ]] && use experimental; then
+				continue
+			fi
+
+			local j
+			for j in ${KPATCH_DIR}/*/50*_*.patch*; do
+				if [[ ! "${K_EXP_GENPATCHES_LIST}" == *"$(basename ${j})"* ]] ; then
+					UNIPATCH_DROP+=" $(basename ${j})"
+				fi
+			done
+		fi
 	done
 
 	#populate KPATCH_DIRS so we know where to look to remove the excludes

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-09-03  0:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-03  0:02 [gentoo-kernel] [PATCH] kernel-2.eclass: Add support for experimental genpatches Tom Wijsman

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