]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - scripts/quilt-mail
add another email to the -rc announcements.
[thirdparty/kernel/stable-queue.git] / scripts / quilt-mail
1 #!/bin/bash
2
3 # locations of some things that you might want to override if you are a
4 # different developer than gregkh
5 STABLE_QUEUE="/home/gregkh/linux/stable/stable-queue/"
6 TMP_DIR="/home/gregkh/linux/tmp/"
7
8
9 SCRIPT_NAME=`basename ${0}`
10 MBOX="$1"
11 if [ "${MBOX}" == "" ] ; then
12 echo "ERROR, you must specify a mailbox name."
13 echo "usage:"
14 echo " ${SCRIPT_NAME} mailbox_name"
15 exit
16 fi
17
18 FULL_VERSION=`kv`
19 BASE_VERSION=${FULL_VERSION/-rc?/}
20 VERSION=`basename \`pwd\``
21 ROOT_VERSION=${VERSION/\.y/}
22 ROOT_VERSION=${ROOT_VERSION/linux-/}
23
24 REL_ARRAY=(${FULL_VERSION//./ })
25 MAJOR=${REL_ARRAY[0]}
26 VER="${MAJOR}.x"
27
28 DATE=`date -u --date="2 days"`
29
30 if [ ${FULL_VERSION} == ${BASE_VERSION} ] ; then
31 echo "Makefile says the version is ${FULL_VERSION}, did you forget to set the -rc version?"
32 exit
33 fi
34
35
36 # create a directory for everything to live in
37 TMP_DIR=`mktemp -d ${TMP_DIR}/stable-${ROOT_VERSION}-XXXX` || exit 1
38
39 # Generate the Makefile diff, with just the version number change in it
40 # relies on filterdiff from the wonderful patchutils package
41 git diff Makefile | filterdiff --hunks 1 > ${TMP_DIR}/Makefile.patch
42
43
44 # make a git tree to create the log file in the format that Linus likes.
45 echo "Creating a git tree of the commits..."
46 ORIGINAL_DIR=`pwd`
47 TMP_TREE=`mktemp -d ${TMP_DIR}/stable-${ROOT_VERSION}-XXXX` || exit 1
48 TMP_LOG=`mktemp ${TMP_DIR}/stable-log-XXXX` || exit 1
49 git clone -s . ${TMP_TREE}
50 cd ${TMP_TREE}
51 git checkout -b temp_branch
52 git quiltimport --patches=${STABLE_QUEUE}/queue-${ROOT_VERSION}
53
54 # Apply the Makefile patch and commit it
55 patch -p1 < ${TMP_DIR}/Makefile.patch
56 git commit -a -m "Linux ${FULL_VERSION}"
57
58 # Generate the diffstat and patch
59 git diff ${VERSION}..HEAD > ${TMP_DIR}/patch-${FULL_VERSION}
60 git diff --stat ${VERSION}..HEAD > ${TMP_DIR}/diffstat
61
62 # sign the patch
63 gpg -a -b ${TMP_DIR}/patch-${FULL_VERSION}
64
65 # generate the log file
66 git log --abbrev=12 --format="%aN <%aE>%n %s%n" ${VERSION}..HEAD > ${TMP_LOG}
67
68 # clean up the git tree by deleting it
69 cd ${ORIGINAL_DIR}
70 rm -rf ${TMP_TREE}
71
72
73 echo "Creating the mailbox for kernel release ${FULL_VERSION}"
74 TMPFILE=`mktemp ${TMP_DIR}/stable_header.XXXXXX` || exit 1
75 NUM_PATCHES=`quilt series | wc -l`
76
77 (
78 echo "This is the start of the stable review cycle for the ${BASE_VERSION} release."
79 echo "There are ${NUM_PATCHES} patches in this series, all will be posted as a response"
80 echo "to this one. If anyone has any issues with these being applied, please"
81 echo "let me know."
82 echo ""
83 echo "Responses should be made by ${DATE}."
84 echo "Anything received after that time might be too late."
85 echo ""
86 echo "The whole patch series can be found in one patch at:"
87 echo " kernel.org/pub/linux/kernel/v${VER}/stable-review/patch-${FULL_VERSION}.gz"
88 echo "and the diffstat can be found below."
89 echo ""
90 echo "thanks,"
91 echo ""
92 echo "greg k-h"
93 echo ""
94 echo "-------------"
95 echo "Pseudo-Shortlog of commits:"
96 echo ""
97 cat ${TMP_LOG}
98 #stable-shortlog
99 echo ""
100 echo "-------------"
101 echo ""
102 echo "Diffstat:"
103 echo ""
104
105 cat ${TMP_DIR}/diffstat
106 ) > ${TMPFILE}
107
108 FROM="Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
109 TO="linux-kernel@vger.kernel.org"
110 #CC="torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk"
111 #CC="alan@lxorguk.ukuu.org.uk"
112 CC="stable@vger.kernel.org"
113 SUBJECT="${BASE_VERSION}-stable review"
114
115 quilt mail --mbox ${TMP_DIR}/${MBOX} \
116 -m "$(cat ${TMPFILE})" \
117 --sender "${FROM}" \
118 --from "${FROM}" \
119 --to "${TO}" \
120 --cc "${CC}" \
121 --prefix "PATCH ${ROOT_VERSION}" \
122 --subject "${SUBJECT}"
123
124 rm ${TMPFILE} ${TMP_LOG}
125
126 echo "mbox is now in ${TMP_DIR}/${MBOX}"
127
128 #echo "Add:"
129 #echo "Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org"
130 #echo "to the first email."
131
132 #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"
133
134 cd ${TMP_DIR}
135 ${STABLE_QUEUE}../mbox2send ${ROOT_VERSION} ${MBOX}
136 #< ${MBOX}.new formail -ds sh -c 'cat > msg.$FILENO'
137 splitmbox.py ${MBOX}.new .
138
139 # Add Linus and Andrew to the first email only:
140 #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
141 #sed -i -e "s/Cc: stable@vger\.kernel\.org/Cc: torvalds@linux-foundation\.org, akpm@linux-foundation\.org, stable@vger\.kernel\.org/" ${TMP_DIR}/msg.000
142 #sed -i -e "s/Cc: stable@vger\.kernel\.org/Cc: torvalds@linux-foundation\.org, akpm@linux-foundation\.org, linux@roeck-us\.net, shuah\.kh@samsung\.com, stable@vger\.kernel\.org/" ${TMP_DIR}/msg.000
143 sed -i -e "s/Cc: stable@vger\.kernel\.org/Cc: torvalds@linux-foundation\.org, akpm@linux-foundation\.org, linux@roeck-us\.net, shuah\.kh@samsung\.com, info@kernelci\.org stable@vger\.kernel\.org/" ${TMP_DIR}/msg.000
144
145
146 # Create a script to upload the patch to kernel.org and to send the patches out
147 echo "#!/bin/bash" > ${TMP_DIR}/send_it_off
148 echo "kup --host=gregkh@geb.kernel.org put patch-${FULL_VERSION} patch-${FULL_VERSION}.asc /pub/linux/kernel/v${VER}/stable-review/patch-${FULL_VERSION}.gz" >> ${TMP_DIR}/send_it_off
149 echo "git send-email msg.*" >> ${TMP_DIR}/send_it_off
150 chmod 755 ${TMP_DIR}/send_it_off
151
152 echo "cd ${TMP_DIR}"
153 echo "./send_it_off"