# exit 1
#}
-KERNEL_MINOR_VERSION='25'
+KERNEL_MINOR_VERSION='31'
KERNEL="2.6.$KERNEL_MINOR_VERSION"
EMAIL_ADDRESS='<gregkh@suse.de>'
SUBJECT="patch $PATCH added to $KERNEL-stable tree"
- echo "makemail -to $AUTHOR -from=$FROM -subject=\"$SUBJECT\" -date=\"$(date -R)\" -reply_to=$MESSAGE_ID"
- echo "smtpsend -server=$SMTP_SERVER $to -from=$FROM"
+ CHARSET=$(guess-charset "$PATCH")
+ if test "x$CHARSET" = "ANSI_X3.4-1968"; then
+ CHARSET=
+ else
+ CHARCMD="-charset=$CHARSET"
+ fi
+
+ ID=`make_message_id`
+
+ echo "makemail -to $AUTHOR -from=$FROM -subject=\"$SUBJECT\" -date=\"$(date -R)\" -reply_to=$MESSAGE_ID --message=$ID $CHARCMD"
+# echo "smtpsend -server=$SMTP_SERVER $to -from=$FROM"
(
grep -lR $FIRST_AUTHOR /home/gregkh/linux/stable/stable-queue/queue-$KERNEL/ 2> /dev/null |
sed -e 's/\/home\/gregkh\/linux\/stable\/stable-queue\///'
) |
- makemail -to "$AUTHOR" -from="$FROM" -cc="$STABLE, $STABLE_COMMITS" \
+ makemail -to "$AUTHOR" \
+ -from="$FROM" \
+ -cc="$STABLE, $STABLE_COMMITS" \
-subject="$SUBJECT" \
-date="$(date -R)" \
- -reply_to="$MESSAGE_ID" | \
+ -reply_to="$MESSAGE_ID" \
+ -message_id="$ID" \
+ "$CHARCMD" \
+ | \
# talk to the suse network instead of localhost (due to the way suse.de now handles email...)
# smtpsend -server=$SMTP_SERVER $to -from=$FROM
msmtp $to
--- /dev/null
+#! /usr/bin/env python
+# vim: set fileencoding=utf-8
+# (c) Uwe Kleine-König <ukleine@strlen.de>
+# GPLv2
+
+import locale
+import sys
+
+f = file(sys.argv[1])
+data = f.read()
+
+def len_utf8_char(data):
+ def check_cont(num):
+ if all(map(lambda c: ord(c) >= 0x80 and ord(c) <= 0xbf, data[1:num])):
+ return num
+ else:
+ return -1
+
+ if ord(data[0]) < 128:
+ # ASCII char
+ return 1
+ elif ord(data[0]) & 0xe0 == 0xc0:
+ return check_cont(2)
+ elif ord(data[0]) & 0xf0 == 0xe0:
+ return check_cont(3)
+ elif ord(data[0]) & 0xf8 == 0xf0:
+ return check_cont(4)
+ elif ord(data[0]) & 0xfc == 0xf8:
+ return check_cont(5)
+ elif ord(data[0]) & 0xfe == 0xfc:
+ return check_cont(6)
+
+i = 0
+maxl = 0
+while i < len(data):
+ l = len_utf8_char(data[i:])
+ if l < 0:
+ prefenc = locale.getpreferredencoding()
+ if prefenc not in ('UTF-8', 'ANSI_X3.4-1968'):
+ print prefenc
+ else:
+ print 'ISO-8859-1'
+ sys.exit(0)
+
+ if maxl < l:
+ maxl = l
+ i += l
+
+if maxl > 1:
+ print 'UTF-8'
+else:
+ print 'ANSI_X3.4-1968'
--- /dev/null
+#!/usr/bin/perl
+
+# we make a "fake" message id by taking the current number
+# of seconds since the beginning of Unix time and tacking on
+# a random number to the end, in case we are called quicker than
+# 1 second since the last time we were called.
+
+my $date = `date "+\%s"`;
+my $hostname = `hostname -d`;
+chomp($date);
+my $pseudo_rand = int (rand(4200));
+$message_id = "$date$pseudo_rand\@$hostname";
+print "$message_id";
"subject=s",
"date=s",
"reply_to=s",
- "message_id=s"
+ "message_id=s",
+ "charset=s"
);
if (defined($options{"subject"})) {
if (defined($options{"message_id"})) {
print("Message-ID: <" . $options{"message_id"} . ">\n");
}
+if (defined($options{"charset"})) {
+ print("MIME-Version: 1.0\nContent-Type: text/plain; charset=" . $options{"charset"} . "\nContent-Transfer-Encoding: 8bit\n");
+}
print("\n");