From: Greg Kroah-Hartman Date: Mon, 29 Oct 2012 21:43:16 +0000 (-0700) Subject: scripts/quilt-mail: create the diffstat and patch from the tree automatically X-Git-Tag: v3.0.50~1 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fkernel%2Fstable-queue.git;a=commitdiff_plain;h=6ee96ac1fcd79f3079434d8053e1e319a1a552fc scripts/quilt-mail: create the diffstat and patch from the tree automatically --- diff --git a/scripts/quilt-mail b/scripts/quilt-mail index 484b4b9ef2..b1cfeeaf4a 100755 --- a/scripts/quilt-mail +++ b/scripts/quilt-mail @@ -27,21 +27,16 @@ if [ ${FULL_VERSION} == ${BASE_VERSION} ] ; then exit fi -if [ ! -f "diffstat" ] ; then - echo "You forgot to create the 'diffstat' file, please do that first." - exit -fi # create a directory for everything to live in TMP_DIR=`mktemp -d ${TMP_DIR}/stable-${ROOT_VERSION}-XXXX` || exit 1 +# Generate the Makefile diff, with just the version number change in it +# relies on filterdiff from the wonderful patchutils package +git diff Makefile | filterdiff --hunks 1 > ${TMP_DIR}/Makefile.patch + # 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 @@ -50,10 +45,24 @@ git clone -s . ${TMP_TREE} cd ${TMP_TREE} git checkout -b temp_branch git quiltimport --patches=${STABLE_QUEUE}/queue-${ROOT_VERSION} + +# Apply the Makefile patch and commit it +patch -p1 < ${TMP_DIR}/Makefile.patch +git commit -a -m "Linux ${FULL_VERSION}" + +# Generate the diffstat and patch +git diff ${VERSION}..HEAD > ${TMP_DIR}/patch-${FULL_VERSION} +git diff --stat ${VERSION}..HEAD > ${TMP_DIR}/diffstat + +# sign the patch +gpg -a -b ${TMP_DIR}/patch-${FULL_VERSION} + +# generate the log file git log --abbrev=12 --format="%aN <%aE>%n %s%n" ${VERSION}..HEAD > ${TMP_LOG} + +# clean up the git tree by deleting it cd ${ORIGINAL_DIR} rm -rf ${TMP_TREE} -#exit echo "Creating the mailbox for kernel release ${FULL_VERSION}" @@ -88,7 +97,7 @@ echo "" echo "Diffstat:" echo "" -cat diffstat +cat ${TMP_DIR}/diffstat ) > ${TMPFILE} FROM="Greg Kroah-Hartman " @@ -110,9 +119,9 @@ rm ${TMPFILE} ${TMP_LOG} echo "mbox is now in ${TMP_DIR}/${MBOX}" -echo "Add:" -echo "Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org" -echo "to the first email." +#echo "Add:" +#echo "Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org" +#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" @@ -120,4 +129,15 @@ cd ${TMP_DIR} ${STABLE_QUEUE}../mbox2send ${ROOT_VERSION} ${MBOX} < ${MBOX}.new formail -ds sh -c 'cat > msg.$FILENO' +# Add Linus and Andrew to the first email only: +sed -i -e "s/Cc: alan@lxorguk\.ukuu\.org\.uk/Cc: torvalds@linux-foundation\.org, akpm@linux-foundation\.org, alan@lxorguk\.ukuu\.org\.uk/" ${TMP_DIR}/msg.000 + + +# Create a script to upload the patch to kernel.org and to send the patches out +echo "#!/bin/bash" > ${TMP_DIR}/send_it_off +echo "kup --host=gregkh@geb.kernel.org put patch-${FULL_VERSION} patch-${FULL_VERSION}.asc /pub/linux/kernel/v3.0/stable-review/patch-${FULL_VERSION}.gz" >> ${TMP_DIR}/send_it_off +echo "git send-email msg.*" >> ${TMP_DIR}/send_it_off +chmod 755 ${TMP_DIR}/send_it_off + echo "cd ${TMP_DIR}" +echo "./send_it_off"