Skip to contentSkip to conversation

kern-tools: re-enable scc merge command

PATCH In review Bruce Ashfield 3 participants 3 messages Feb 8, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kern-tools: re-enable scc merge command

The ability to merge two branches directly from a .scc file was dropped during the streamlining of the tools.

As was pointed out by David Vincent <[email protected]>, there is once again a valid use case for this functionality, so we restore the capability.

---

Armin,

This restores old functionality that was dropped due to kern-tools streamlining. It was reported as missing on morty, and this doesn't impact other functionality .. so it is worth restoring this, and of course, this also carries forward into master.

Bruce

 meta/classes/kernel-yocto.bbclass                       | 16 +++++++++++++++-
 meta/recipes-kernel/kern-tools/kern-tools-native_git.bb |  3 ++-
 2 files changed, 17 insertions(+), 2 deletions(-)
meta/classes/kernel-yocto.bbclass +15 -1
index a60327a..eb35dce 100644
@@ -148,7 +148,7 @@ do_kernel_metadata() {
 	# run1: pull all the configuration fragments, no matter where they come from
 	elements="`echo -n ${bsp_definition} ${sccs} ${patches} ${KERNEL_FEATURES}`"
 	if [ -n "${elements}" ]; then
-		scc --force -o ${S}/${meta_dir}:cfg,meta ${includes} ${bsp_definition} ${sccs} ${patches} ${KERNEL_FEATURES}
+		scc --force -o ${S}/${meta_dir}:cfg,merge,meta ${includes} ${bsp_definition} ${sccs} ${patches} ${KERNEL_FEATURES}
 		if [ $? -ne 0 ]; then
 			bbfatal_log "Could not generate configuration queue for ${KMACHINE}."
 		fi
@@ -165,6 +165,7 @@ do_kernel_metadata() {
 }
 
 do_patch() {
+	set +e
 	cd ${S}
 
 	check_git_config
@@ -177,6 +178,19 @@ do_patch() {
 			bbfatal_log "Patch failures can be resolved in the linux source directory ${S})"
 		fi
 	fi
+
+	if [ -f "${meta_dir}/merge.queue" ]; then
+		# we need to merge all these branches
+		for b in $(cat ${meta_dir}/merge.queue); do
+			git show-ref --verify --quiet refs/heads/${b}
+			if [ $? -eq 0 ]; then
+				bbnote "Merging branch ${b}"
+				git merge -q --no-ff -m "Merge branch ${b}" ${b}
+			else
+				bbfatal "branch ${b} does not exist, cannot merge"
+			fi
+		done
+	fi
 }
 
 do_kernel_checkout() {
meta/recipes-kernel/kern-tools/kern-tools-native_git.bb +2 -1
index 8af0155..aa27ec8 100644
@@ -4,7 +4,8 @@ LIC_FILES_CHKSUM = "file://git/tools/kgit;beginline=5;endline=9;md5=a6c2fa8aef1b
 
 DEPENDS = "git-native"
 
-SRCREV = "85564e69555b713c2759d58ec5ade54424d051d8"
+SRCREV = "c14440d4e7ae0160c260ed65c3e123be5dc97ae8"
+
 PR = "r12"
 PV = "0.2+git${SRCPV}"
 
Signature · 1 line
2.7.4
#1 lore raw

This should have had [morty] in the subject. Sorry about that.

The explanation of the change is in the patch itself in the temporary area.

Cheers,

Bruce

Quoted 102 lines · Bruce Ashfield

The ability to merge two branches directly from a .scc file was dropped during the streamlining of the tools.

As was pointed out by David Vincent <[email protected]>, there is once again a valid use case for this functionality, so we restore the capability.

---

Armin,

This restores old functionality that was dropped due to kern-tools streamlining.
It was reported as missing on morty, and this doesn't impact other functionality
.. so it is worth restoring this, and of course, this also carries forward into
master.

Bruce

 meta/classes/kernel-yocto.bbclass                       | 16
+++++++++++++++-
 meta/recipes-kernel/kern-tools/kern-tools-native_git.bb |  3 ++-
 2 files changed, 17 insertions(+), 2 deletions(-)
meta/classes/kernel-yocto.bbclass +0 -0
index a60327a..eb35dce 100644
@@ -148,7 +148,7 @@ do_kernel_metadata() {
        # run1: pull all the configuration fragments, no matter where they

come from

        elements="`echo -n ${bsp_definition} ${sccs} ${patches}
${KERNEL_FEATURES}`"
        if [ -n "${elements}" ]; then

- scc --force -o ${S}/${meta_dir}:cfg,meta ${includes}
${bsp_definition} ${sccs} ${patches} ${KERNEL_FEATURES}
+ scc --force -o ${S}/${meta_dir}:cfg,merge,meta
${includes} ${bsp_definition} ${sccs} ${patches} ${KERNEL_FEATURES}
if [ $? -ne 0 ]; then
bbfatal_log "Could not generate configuration
queue for ${KMACHINE}."
fi

meta/classes/kernel-yocto.bbclass +1 -0
@@ -165,6 +165,7 @@ do_kernel_metadata() {
 }
 
 do_patch() {
+       set +e
        cd ${S}
 
        check_git_config
@@ -177,6 +178,19 @@ do_patch() {
                        bbfatal_log "Patch failures can be resolved in the

linux source directory ${S})"
fi
fi

meta/classes/kernel-yocto.bbclass +8 -0
+
+       if [ -f "${meta_dir}/merge.queue" ]; then
+               # we need to merge all these branches
+               for b in $(cat ${meta_dir}/merge.queue); do
+                       git show-ref --verify --quiet refs/heads/${b}
+                       if [ $? -eq 0 ]; then
+                               bbnote "Merging branch ${b}"
+                               git merge -q --no-ff -m "Merge branch

${b}" ${b}

meta/classes/kernel-yocto.bbclass +2 -0
+                       else
+                               bbfatal "branch ${b} does not exist,

cannot merge"

meta/classes/kernel-yocto.bbclass +3 -0
+                       fi
+               done
+       fi
 }
 
 do_kernel_checkout() {
meta/recipes-kernel/kern-tools/kern-tools-native_git.bb +0 -0
index 8af0155..aa27ec8 100644
@@ -4,7 +4,8 @@ LIC_FILES_CHKSUM = "file://git/tools/kgit;

beginline=5;endline=9;md5=a6c2fa8aef1b

DEPENDS = "git-native"

meta/recipes-kernel/kern-tools/kern-tools-native_git.bb +2 -2
-SRCREV = "85564e69555b713c2759d58ec5ade54424d051d8"
+SRCREV = "c14440d4e7ae0160c260ed65c3e123be5dc97ae8"
+
 PR = "r12"
 PV = "0.2+git${SRCPV}"
 
--

2.7.4

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"
#2 lore raw

✗ patchtest: failure for kern-tools: re-enable scc merge command

In reply to Bruce Ashfield

== Series Details ==

Series: kern-tools: re-enable scc merge command
Revision: 1
URL : https://patchwork.openembedded.org/series/5201/
State : failure

== Summary ==

Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures:

* Issue Series does not apply on top of target branch [test_series_merge_on_head]
Suggested fix Rebase your series on top of targeted branch
Targeted branch master (currently at 68da6c9884)

If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...).

---

Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe