]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
scripts/quilt-mail: major changes
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Sep 2012 20:27:00 +0000 (13:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Sep 2012 20:27:00 +0000 (13:27 -0700)
Now checks out a git tree of the patches, generates the short-log, and
the individual emails all at once.

scripts/quilt-mail

index eeb16f9845b80d2f21fa853708bd92702abdd703..484b4b9ef227b83ac70096ff8359cafee5f5c331 100755 (executable)
@@ -1,5 +1,11 @@
 #!/bin/bash
 
+# locations of some things that you might want to override if you are a
+# different developer than gregkh
+STABLE_QUEUE="/home/gregkh/linux/stable/stable-queue/"
+TMP_DIR="/home/gregkh/linux/tmp/"
+
+
 SCRIPT_NAME=`basename ${0}`
 MBOX="$1"
 if [ "${MBOX}" == "" ] ; then
@@ -11,6 +17,9 @@ fi
 
 FULL_VERSION=`ketchup -m`
 BASE_VERSION=${FULL_VERSION/-rc?/}
+VERSION=`basename \`pwd\``
+ROOT_VERSION=${VERSION/\.y/}
+ROOT_VERSION=${ROOT_VERSION/linux-/}
 DATE=`date -u --date="2 days"`
 
 if [ ${FULL_VERSION} == ${BASE_VERSION} ] ; then
@@ -23,9 +32,32 @@ if [ ! -f "diffstat" ] ; then
        exit
 fi
 
-echo "Creating the mailbox for kernel release ${FULL_VERSION}"
+# create a directory for everything to live in
+TMP_DIR=`mktemp -d ${TMP_DIR}/stable-${ROOT_VERSION}-XXXX` || exit 1
+
+
+# make a git tree to create the log file in the format that Linus likes.
+#
+# note, we could be getting the diffstat here as well, which might be a nice
+# thing, but currently we create it from the make_diff script, and sign it
+# there, but the next time someone adds a file to the tree with a patch, I'll
+# rewrite this to create it here, no need to do things in two different stages.
+echo "Creating a git tree of the commits..."
+ORIGINAL_DIR=`pwd`
+TMP_TREE=`mktemp -d ${TMP_DIR}/stable-${ROOT_VERSION}-XXXX` || exit 1
+TMP_LOG=`mktemp ${TMP_DIR}/stable-log-XXXX` || exit 1
+git clone -s . ${TMP_TREE}
+cd ${TMP_TREE}
+git checkout -b temp_branch
+git quiltimport --patches=${STABLE_QUEUE}/queue-${ROOT_VERSION}
+git log --abbrev=12 --format="%aN <%aE>%n    %s%n" ${VERSION}..HEAD > ${TMP_LOG}
+cd ${ORIGINAL_DIR}
+rm -rf ${TMP_TREE}
+#exit
 
-TMPFILE=`mktemp stable_header.XXXXXX` || exit 1
+
+echo "Creating the mailbox for kernel release ${FULL_VERSION}"
+TMPFILE=`mktemp ${TMP_DIR}/stable_header.XXXXXX` || exit 1
 NUM_PATCHES=`quilt series | wc -l`
 
 (
@@ -46,9 +78,10 @@ echo ""
 echo "greg k-h"
 echo ""
 echo "-------------"
-echo "Shortlog of commits:"
+echo "Pseudo-Shortlog of commits:"
 echo ""
-stable-shortlog
+cat ${TMP_LOG}
+#stable-shortlog
 echo ""
 echo "-------------"
 echo ""
@@ -58,13 +91,13 @@ echo ""
 cat diffstat
 ) > ${TMPFILE}
 
-FROM="Greg KH <gregkh@linuxfoundation.org>"
+FROM="Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
 TO="linux-kernel@vger.kernel.org, stable@vger.kernel.org"
 #CC="torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk"
 CC="alan@lxorguk.ukuu.org.uk"
 SUBJECT="${BASE_VERSION}-stable review"
 
-quilt mail --mbox ${MBOX}      \
+quilt mail --mbox ${TMP_DIR}/${MBOX}   \
        -m "$(cat ${TMPFILE})"  \
        --sender "${FROM}"      \
        --from "${FROM}"        \
@@ -73,8 +106,9 @@ quilt mail --mbox ${MBOX}    \
        --prefix ""             \
        --subject "${SUBJECT}"
 
-rm ${TMPFILE}
-echo "mbox is now in ${MBOX}"
+rm ${TMPFILE} ${TMP_LOG}
+
+echo "mbox is now in ${TMP_DIR}/${MBOX}"
 
 echo "Add:"
 echo "Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org"
@@ -82,3 +116,8 @@ echo "to the first email."
 
 #q mail --mbox x -m "$(cat ../stable-queue/00)" --sender gregkh@lf.org --from gregkh@lf.org --to foo@foo --subject "This is the subject"
 
+cd ${TMP_DIR}
+${STABLE_QUEUE}../mbox2send ${ROOT_VERSION} ${MBOX}
+< ${MBOX}.new formail -ds sh -c 'cat > msg.$FILENO'
+
+echo "cd ${TMP_DIR}"