Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 193 lines (171 sloc) 4.531 kb
cebfd88f »
2010-08-04 stable scripts
1 #!/bin/bash
2
0e26fa86 »
2011-08-01 lots of 3.0 changes needed to the scripts
3 KERNEL=$1
cebfd88f »
2010-08-04 stable scripts
4 shift
0e26fa86 »
2011-08-01 lots of 3.0 changes needed to the scripts
5 echo "VERSION=$KERNEL"
cebfd88f »
2010-08-04 stable scripts
6
0e26fa86 »
2011-08-01 lots of 3.0 changes needed to the scripts
7 #KERNEL="2.6.$KERNEL_MINOR_VERSION"
cebfd88f »
2010-08-04 stable scripts
8
4c167992 »
2012-02-02 change my email address to be linuxfoundation.org instead of suse.de
9 EMAIL_ADDRESS='<gregkh@linuxfoundation.org>'
cebfd88f »
2010-08-04 stable scripts
10
c598ba10 »
2011-10-20 fix up stable@ email addresses now that it has moved to vger.
11 STABLE='<stable@vger.kernel.org>'
cebfd88f »
2010-08-04 stable scripts
12 STABLE_COMMITS='<stable-commits@vger.kernel.org>'
13
14 extract_addr()
15 {
16 read l
17 read l
18 read l
19 read l
20 a=$(echo "$l" | sed -n -e 's/.*<\(.*@[^>]*\).*/\1/p')
21 echo $a
22 }
23
24 if [ x"$SMTP_SERVER" = x ]
25 then
26 SMTP_SERVER=localhost:25
27 fi
28
29 if [ x"$EMAIL_ADDRESS" = x ]
30 then
31 echo "You must set the EMAIL_ADDRESS environment variable to your email address"
32 exit 1
33 fi
34 FROM=$EMAIL_ADDRESS
35
36 TO=""
37 CC=""
38
39 author()
40 {
41 first_author=""
42 TXT=$2
43 if [ ! -f $TXT ]
44 then
45 echo "$TXT is missing"
46 exit 1
47 fi
48 author=""
49 while read l
50 do
51 # skip the Message-ID: line so we don't send email to the wrong place
929caef7 »
2010-08-13 made added-to-stable-version a bit quieter
52 ## echo "$l"
cebfd88f »
2010-08-04 stable scripts
53 reply=$(echo "$l" | grep -i Message-ID:)
54 if [ x"$reply" != x ]
55 then
56 continue
57 fi
58
59 # if this is the start of the diff, then it's time to stop looking
60 diff=$(echo "$l" | grep "^---")
61 if [ x"$diff" != x ]
62 then
929caef7 »
2010-08-13 made added-to-stable-version a bit quieter
63 ## echo "diffstart!!!!!"
cebfd88f »
2010-08-04 stable scripts
64 break
65 fi
66
67 for x in $l
68 do
69 a=$(echo "$x" | sed -n -e 's/.*<\(.*@[^>]*\).*/\1/p')
70 if [ x"$a" != x ]
71 then
72 if [ x"$author" == x ]
73 then
74 author=$a
75 first_author=$a
76 else
77 author="$author $a"
78 fi
79 fi
80 done
81 done < $TXT
82 author=$(echo "$author" | tr ' ' '\n' | grep -v "$first_author" |
83 sort | uniq)
84 author="$first_author $author"
85 eval $1=$(echo $author | sed -e 's/ /,/g')
86 if [ x"$3" != x ]
87 then
88 eval $3=$first_author
89 fi
90 }
91
92
93
94 reply()
95 {
96 PATCH=$1
97 # patch_name=$(stripit $1)
98 # PATCH=$P/patches/$patch_name.patch
99 # TXT=$P/txt/$patch_name.txt
100 # if [ ! -f $TXT ]
101 # then
102 # echo $TXT is missing
103 # exit 1
104 # fi
105 echo "PATCH=$PATCH"
106 # SUBJECT=`grep "Subject:" $PATCH`
107 SUBJECT=`grep "Subject:" $PATCH | sed s/Subject\:\ //`
108 # SUBJECT=$(head -n 2 $PATCH | tail -n 1)
109 MESSAGE_ID=`grep -i "^Message-ID:" $PATCH | cut -f 2 -d ' ' | cut -f 2 -d '<' | cut -f 1 -d '>'`
110 author AUTHOR $1 FIRST_AUTHOR
929caef7 »
2010-08-13 made added-to-stable-version a bit quieter
111 ## echo "author said $AUTHOR"
112 ## echo "first_author said $FIRST_AUTHOR"
cebfd88f »
2010-08-04 stable scripts
113 if [ x"$AUTHOR" == "x" ]
114 then
115 echo "nobody to notify"
116 exit 0
117 fi
118 to=""
119 for i in $(echo "$AUTHOR" | sed -e 's/,/ /g')
120 do
121 if ! echo "$TO" | grep "$i"
122 then
123 to=$to" -to $i"
124 fi
125 done
126 if [ x"$cc" != x ]
127 then
128 cc="-cc $cc"
129 fi
130
131 # SUBJECT="patch $PATCH added to $KERNEL-stable tree"
132
133 CHARSET=$(guess-charset "$PATCH")
134 if test "x$CHARSET" = "ANSI_X3.4-1968"; then
135 CHARSET=
136 else
137 CHARCMD="-charset=$CHARSET"
138 fi
139
140 ID=`make_message_id`
141
929caef7 »
2010-08-13 made added-to-stable-version a bit quieter
142 ## echo "makemail -to $AUTHOR -from=$FROM -subject=\"$SUBJECT\" -date=\"$(date -R)\" -reply_to=$MESSAGE_ID --message=$ID $CHARCMD"
cebfd88f »
2010-08-04 stable scripts
143 # echo "smtpsend -server=$SMTP_SERVER $to -from=$FROM"
144
145
146 (
147 echo
148 echo "This is a note to let you know that I've just added the patch titled"
149 echo
150 echo " $SUBJECT"
151 echo
152 echo "to the $KERNEL-stable tree which can be found at:"
153 echo " http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary"
154 echo
155 echo "The filename of the patch is:"
be27dcec »
2010-09-05 make added-to-stable handle the name of the patch correctly
156 echo " " `basename "$PATCH"`
cebfd88f »
2010-08-04 stable scripts
157 echo "and it can be found in the queue-$KERNEL subdirectory."
158 echo
159 echo "If you, or anyone else, feels it should not be added to the stable tree,"
c598ba10 »
2011-10-20 fix up stable@ email addresses now that it has moved to vger.
160 echo "please let <stable@vger.kernel.org> know about it."
cebfd88f »
2010-08-04 stable scripts
161 echo
162 echo
163 cat $PATCH
164 echo
165 echo
166 echo -n "Patches currently in stable-queue which might be from "
167 echo "$FIRST_AUTHOR are"
168 echo
169 grep -lR $FIRST_AUTHOR /home/gregkh/linux/stable/stable-queue/queue-$KERNEL/ 2> /dev/null |
170 sed -e 's/\/home\/gregkh\/linux\/stable\/stable-queue\///'
171 ) |
172 makemail -to "$AUTHOR" \
173 -from="$FROM" \
174 -cc="$STABLE, $STABLE_COMMITS" \
175 -subject="Patch \"$SUBJECT\" has been added to the $KERNEL-stable tree" \
176 -date="$(date -R)" \
177 -reply_to="$MESSAGE_ID" \
178 -message_id="$ID" \
179 "$CHARCMD" \
180 | \
b1e54931 »
2012-03-08 stable fixes for default email server
181 ~/bin/msmtp-enqueue.sh "$to"
182 #~/bin/msmtp-enqueue.sh -a coco "$to"
cebfd88f »
2010-08-04 stable scripts
183 #msmtp $to
184 }
185
186 for patch_file in $*
187 do
188 reply $patch_file
189 echo "acknowledged $patch_file"
929caef7 »
2010-08-13 made added-to-stable-version a bit quieter
190 ## echo "-----------------------------------------------"
191 ## echo
cebfd88f »
2010-08-04 stable scripts
192 done
Something went wrong with that request. Please try again.