From 0e63ce659593194a6ce8f271f5b2ceefeca50127 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 8 Jul 2009 14:49:28 +0000 Subject: [PATCH] Clifford Wolf: Fixed and improved misc/archive/git-send.sh diff --git a/misc/archive/git-send.sh b/misc/archive/git-send.sh index 924164a..5a29645 100644 [2009050707505915816] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@9441 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- misc/archive/git-send.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/misc/archive/git-send.sh b/misc/archive/git-send.sh index 924164a27..5a2964563 100644 --- a/misc/archive/git-send.sh +++ b/misc/archive/git-send.sh @@ -3,6 +3,9 @@ URL=https://www.rocklinux.net/submaster/ if [ $# -lt 3 ]; then + echo + echo "Usage: $0 { username password | - } file(s)" + echo echo echo "Usage example:" echo @@ -13,10 +16,17 @@ if [ $# -lt 3 ]; then fi username="$1"; shift -password="$1"; shift +if [ "$username" != "-" ]; then + password="$1"; shift +fi +i=0 for p; do - awk 'pass { print; next; } /^From:/ { gsub(/^From: /, ""); gsub(/<.*/, ""); name=$0; next; } /^Subject:/ { gsub(/^.*PATCH\] */, ""); message="\t" $0; next; } /^---/ { print "\n" name ":\n" message "\n"; next; } /^diff/ { print; pass=1; next; } /./ { message = message "\n\t" $0; }' < "$p" > git-send-tmp.txt - curl -k -F u="$username" -F p="$password" -F a=new -F q=1 -F f=\@git-send-tmp.txt "$URL/smadm.cgi" + fn=`printf "git-send-tmp%03d.txt" $i` + awk 'pass { print; next; } /^From:/ { gsub(/^From: /, ""); gsub(/ *<.*/, ""); name=$0; next; } /^Subject:/ { gsub(/^.*PATCH\] */, ""); message="\t" $0; next; } /^---/ { print "\n" name ":\n" message "\n"; next; } /^diff/ { print; pass=1; next; } /./ { message = message "\n\t" $0; }' < "$p" > $fn + if [ "$username" != "-" ]; then + curl -k -F u="$username" -F p="$password" -F a=new -F q=1 -F f=\@$fn "$URL/smadm.cgi" + fi + i=`expr $i + 1` done