summaryrefslogtreecommitdiff
path: root/meta/packages/guilt/files/improve_auto_header_gen.patch
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2010-08-10 15:01:37 -0400
committerRichard Purdie <rpurdie@linux.intel.com>2010-08-20 16:35:39 +0100
commit2cf104f7e09d620b9c04122d15ce347db34f9577 (patch)
tree173af7dc87afd8e96ef694807bb1080ab2718591 /meta/packages/guilt/files/improve_auto_header_gen.patch
parent15543017ec044b1b072a50335a6fd0a036def47e (diff)
downloadopenembedded-core-2cf104f7e09d620b9c04122d15ce347db34f9577.tar.gz
openembedded-core-2cf104f7e09d620b9c04122d15ce347db34f9577.tar.bz2
openembedded-core-2cf104f7e09d620b9c04122d15ce347db34f9577.tar.xz
openembedded-core-2cf104f7e09d620b9c04122d15ce347db34f9577.zip
guilt: import guilt for kernel patch management
The Wind River kernel is "patched" via guilt to provide both git integration and quilt like patch management (if that is of interest). This is a modified 0.33 guilt with some changes to streamline interactions with the way that the Wind River kernel is constructed. That being said, the common semantics of guilt are not changed, and it can be used for other purposes. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta/packages/guilt/files/improve_auto_header_gen.patch')
-rw-r--r--meta/packages/guilt/files/improve_auto_header_gen.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/meta/packages/guilt/files/improve_auto_header_gen.patch b/meta/packages/guilt/files/improve_auto_header_gen.patch
new file mode 100644
index 000000000..b98ec5e9f
--- /dev/null
+++ b/meta/packages/guilt/files/improve_auto_header_gen.patch
@@ -0,0 +1,69 @@
+guilt: improve the generation of an automatic header
+
+Patches that do not have a proper header are encountered when generating
+a tree. This improves the detection of these patches and generates a sane
+header so the eventual commit will be coherent
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
+
+---
+
+ guilt | 24 ++++++++++++++++++------
+ 1 file changed, 18 insertions(+), 6 deletions(-)
+
+--- a/guilt
++++ b/guilt
+@@ -591,7 +591,12 @@ commit()
+ fi
+
+ # last try: make a default commit message if patch doesn't contain one
+- [ ! -s "$TMP_MSG" ] && echo "auto_msg: patch $pname" > "$TMP_MSG"
++ if [ ! -s "$TMP_MSG" ]; then
++ echo "auto_msg: importing `basename $pname`" > "$TMP_MSG"
++ echo "" >> "$TMP_MSG"
++ echo "This is an automatic import of patch $pname, no headers were" >> "$TMP_MSG"
++ echo "detected and a default message was constructed" >> "$TMP_MSG"
++ fi
+
+
+ if [ "$header_type" = "guilt" ]; then
+@@ -599,12 +604,14 @@ commit()
+ # extract a From line from the patch header, and set
+ # GIT_AUTHOR_{NAME,EMAIL}
+ author_str=`sed -n -e '/^From:/ { s/^From: //; p; q }; /^(diff |---)/ q' "$p"`
+- if [ ! -z "$author_str" ]; then
+- GIT_AUTHOR_NAME=`echo $author_str | sed -e 's/ *<.*$//'`
+- export GIT_AUTHOR_NAME="${GIT_AUTHOR_NAME:-" "}"
+- export GIT_AUTHOR_EMAIL="`echo $author_str | sed -e 's/[^<]*//'`"
++ if [ -z "$author_str" ]; then
++ author_str="auto commit <unknown@unknown>"
+ fi
+
++ GIT_AUTHOR_NAME=`echo $author_str | sed -e 's/ *<.*$//'`
++ export GIT_AUTHOR_NAME="${GIT_AUTHOR_NAME:-" "}"
++ export GIT_AUTHOR_EMAIL="`echo $author_str | sed -e 's/[^<]*//'`"
++
+
+ # check in the patch for a subject
+ SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$p")"
+@@ -615,6 +622,11 @@ commit()
+ if [ ${#SUBJECT} -gt 60 ]; then
+ SUBJECT=${SUBJECT: -60}
+ fi
++
++ # remove the line from the tmp msg
++ mv "$TMP_MSG" "$TMP_MSG.work"
++ cat "$TMP_MSG.work" | grep -v -E ".*$SUBJECT.*" > "$TMP_MSG"
++ rm "$TMP_MSG.work"
+ fi
+
+ if [ -z "$SUBJECT" ]; then
+@@ -629,7 +641,7 @@ commit()
+
+ SUBJECT=`echo $SUBJECT | sed s'%^ *%%'`
+
+- if [ ! -z "$SUBJECT" ]; then
++ if [ -n "$SUBJECT" ]; then
+ echo "$SUBJECT" >> $TMP_MSG.subject
+ echo "" >> $TMP_MSG.subject
+ cat "$TMP_MSG" >> $TMP_MSG.subject