Skip to content

Commit

Permalink
work trees
Browse files Browse the repository at this point in the history
  • Loading branch information
gregkh committed Nov 9, 2010
1 parent 3310c19 commit 276690a
Show file tree
Hide file tree
Showing 3 changed files with 389 additions and 0 deletions.
7 changes: 7 additions & 0 deletions work/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
s
s1
s2
usb-2.6
tty-2.6
driver-core-2.6
staging-2.6
191 changes: 191 additions & 0 deletions work/added-to-staging-next
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
#!/bin/bash

#. patchfns 2>/dev/null ||
#. /usr/lib/patch-scripts/patchfns 2>/dev/null ||
#. $PATCHSCRIPTS_LIBDIR/patchfns 2>/dev/null ||
#{
# echo "Impossible to find my library 'patchfns'."
# echo "Check your install, or go to the right directory"
# exit 1
#}

EMAIL_ADDRESS='<gregkh@suse.de>'

extract_addr()
{
read l
read l
read l
read l
a=$(echo "$l" | sed -n -e 's/.*<\(.*@[^>]*\).*/\1/p')
echo $a
}

if [ x"$SMTP_SERVER" = x ]
then
SMTP_SERVER=localhost:25
fi

if [ x"$EMAIL_ADDRESS" = x ]
then
echo "You must set the EMAIL_ADDRESS environment variable to your email address"
exit 1
fi
FROM=$EMAIL_ADDRESS

TO=""
CC=""

author()
{
first_author=""
TXT=$2
if [ ! -f $TXT ]
then
echo "$TXT is missing"
exit 1
fi
author=""
while read l
do
# skip the Message-ID: line so we don't send email to the wrong place
echo "$l"
reply=$(echo "$l" | grep -i Message-ID:)
if [ x"$reply" != x ]
then
continue
fi

# if this is the start of the diff, then it's time to stop looking
diff=$(echo "$l" | grep "^---")
if [ x"$diff" != x ]
then
echo "diffstart!!!!!"
break
fi

for x in $l
do
a=$(echo "$x" | sed -n -e 's/.*<\(.*@[^>]*\).*/\1/p')
if [ x"$a" != x ]
then
if [ x"$author" == x ]
then
author=$a
first_author=$a
else
author="$author $a"
fi
fi
done
done < $TXT
author=$(echo "$author" | tr ' ' '\n' | grep -v "$first_author" |
sort | uniq)
author="$first_author $author"
eval $1=$(echo $author | sed -e 's/ /,/g')
if [ x"$3" != x ]
then
eval $3=$first_author
fi
}



reply()
{
PATCH=$1
# patch_name=$(stripit $1)
# PATCH=$P/patches/$patch_name.patch
# TXT=$P/txt/$patch_name.txt
# if [ ! -f $TXT ]
# then
# echo $TXT is missing
# exit 1
# fi
echo "PATCH=$PATCH"
# SUBJECT=`grep "Subject:" $PATCH`
SUBJECT=`grep "Subject:" $PATCH | sed s/Subject\:\ //`
# SUBJECT=$(head -n 2 $PATCH | tail -n 1)
MESSAGE_ID=`grep -i "^Message-ID:" $PATCH | cut -f 2 -d ' ' | cut -f 2 -d '<' | cut -f 1 -d '>'`
author AUTHOR $1 FIRST_AUTHOR
echo "author said $AUTHOR"
echo "first_author said $FIRST_AUTHOR"
if [ x"$AUTHOR" == "x" ]
then
echo "nobody to notify"
exit 0
fi
to=""
for i in $(echo "$AUTHOR" | sed -e 's/,/ /g')
do
if ! echo "$TO" | grep "$i"
then
to=$to" -to $i"
fi
done
if [ x"$cc" != x ]
then
cc="-cc $cc"
fi

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=\"patch $PATCH added to gregkh tree\" -date=\"$(date -R)\" -reply_to=$MESSAGE_ID -message=$ID $CHARCMD"
# echo "smtpsend -server=$SMTP_SERVER $to -from=$FROM"


(
echo
echo "This is a note to let you know that I've just added the patch titled"
echo
echo " $SUBJECT"
echo
echo "to my staging-next git tree which can be found at"
echo " git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6.git"
echo "in the staging-next branch."
echo
echo "The patch will show up in the next release of the linux-next tree"
echo "(usually sometime within the next 24 hours during the week.)"
echo
echo "The patch will also will be merged in the next major kernel release"
echo "during the merge window."
echo
echo "If you have any questions about this process, please let me know."
echo
echo
cat $PATCH
echo
# echo
# echo -n "Patches currently in gregkh-2.6 which might be from "
# echo "$FIRST_AUTHOR are"
# echo
# grep -lR $FIRST_AUTHOR /home/gregkh/linux/patches/ 2> /dev/null |
# sed -e 's/\/home\/gregkh\/linux\/patches\///'
) |
makemail -to "$AUTHOR" -from="$FROM" \
-subject="patch \"$SUBJECT\" added to staging tree" \
-date="$(date -R)" \
-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
# ~/bin/msmtp-enqueue.sh -a suse $to
~/bin/msmtp-enqueue.sh -a coco $to
}

for patch_file in $*
do
reply $patch_file
echo "acknowledged $patch_file"
echo "-----------------------------------------------"
echo
done
191 changes: 191 additions & 0 deletions work/added-to-usb
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
#!/bin/bash

#. patchfns 2>/dev/null ||
#. /usr/lib/patch-scripts/patchfns 2>/dev/null ||
#. $PATCHSCRIPTS_LIBDIR/patchfns 2>/dev/null ||
#{
# echo "Impossible to find my library 'patchfns'."
# echo "Check your install, or go to the right directory"
# exit 1
#}

EMAIL_ADDRESS='<gregkh@suse.de>'

extract_addr()
{
read l
read l
read l
read l
a=$(echo "$l" | sed -n -e 's/.*<\(.*@[^>]*\).*/\1/p')
echo $a
}

if [ x"$SMTP_SERVER" = x ]
then
SMTP_SERVER=localhost:25
fi

if [ x"$EMAIL_ADDRESS" = x ]
then
echo "You must set the EMAIL_ADDRESS environment variable to your email address"
exit 1
fi
FROM=$EMAIL_ADDRESS

TO=""
CC=""

author()
{
first_author=""
TXT=$2
if [ ! -f $TXT ]
then
echo "$TXT is missing"
exit 1
fi
author=""
while read l
do
# skip the Message-ID: line so we don't send email to the wrong place
echo "$l"
reply=$(echo "$l" | grep -i Message-ID:)
if [ x"$reply" != x ]
then
continue
fi

# if this is the start of the diff, then it's time to stop looking
diff=$(echo "$l" | grep "^---")
if [ x"$diff" != x ]
then
echo "diffstart!!!!!"
break
fi

for x in $l
do
a=$(echo "$x" | sed -n -e 's/.*<\(.*@[^>]*\).*/\1/p')
if [ x"$a" != x ]
then
if [ x"$author" == x ]
then
author=$a
first_author=$a
else
author="$author $a"
fi
fi
done
done < $TXT
author=$(echo "$author" | tr ' ' '\n' | grep -v "$first_author" |
sort | uniq)
author="$first_author $author"
eval $1=$(echo $author | sed -e 's/ /,/g')
if [ x"$3" != x ]
then
eval $3=$first_author
fi
}



reply()
{
PATCH=$1
# patch_name=$(stripit $1)
# PATCH=$P/patches/$patch_name.patch
# TXT=$P/txt/$patch_name.txt
# if [ ! -f $TXT ]
# then
# echo $TXT is missing
# exit 1
# fi
echo "PATCH=$PATCH"
# SUBJECT=`grep "Subject:" $PATCH`
SUBJECT=`grep "Subject:" $PATCH | sed s/Subject\:\ //`
# SUBJECT=$(head -n 2 $PATCH | tail -n 1)
MESSAGE_ID=`grep -i "^Message-ID:" $PATCH | cut -f 2 -d ' ' | cut -f 2 -d '<' | cut -f 1 -d '>'`
author AUTHOR $1 FIRST_AUTHOR
echo "author said $AUTHOR"
echo "first_author said $FIRST_AUTHOR"
if [ x"$AUTHOR" == "x" ]
then
echo "nobody to notify"
exit 0
fi
to=""
for i in $(echo "$AUTHOR" | sed -e 's/,/ /g')
do
if ! echo "$TO" | grep "$i"
then
to=$to" -to $i"
fi
done
if [ x"$cc" != x ]
then
cc="-cc $cc"
fi

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=\"patch $PATCH added to gregkh tree\" -date=\"$(date -R)\" -reply_to=$MESSAGE_ID -message=$ID $CHARCMD"
# echo "smtpsend -server=$SMTP_SERVER $to -from=$FROM"


(
echo
echo "This is a note to let you know that I've just added the patch titled"
echo
echo " $SUBJECT"
echo
echo "to my usb git tree which can be found at"
echo " git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6.git"
echo "in the usb-linus branch."
echo
echo "The patch will show up in the next release of the linux-next tree"
echo "(usually sometime within the next 24 hours during the week.)"
echo
echo "The patch will hopefully also will be merged in Linus's tree for the"
echo "next -rc kernel release."
echo
echo "If you have any questions about this process, please let me know."
echo
echo
cat $PATCH
echo
# echo
# echo -n "Patches currently in gregkh-2.6 which might be from "
# echo "$FIRST_AUTHOR are"
# echo
# grep -lR $FIRST_AUTHOR /home/gregkh/linux/patches/ 2> /dev/null |
# sed -e 's/\/home\/gregkh\/linux\/patches\///'
) |
makemail -to "$AUTHOR" -from="$FROM" \
-subject="patch \"$SUBJECT\" added to usb tree" \
-date="$(date -R)" \
-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
# ~/bin/msmtp-enqueue.sh -a suse $to
~/bin/msmtp-enqueue.sh -a coco $to
}

for patch_file in $*
do
reply $patch_file
echo "acknowledged $patch_file"
echo "-----------------------------------------------"
echo
done

0 comments on commit 276690a

Please sign in to comment.