r77664 - /scripts/forward-patch

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Thu Jul 21 09:58:13 UTC 2011


Author: gregoa
Date: Thu Jul 21 09:58:11 2011
New Revision: 77664

URL: http://svn.debian.org/wsvn/?sc=1&rev=77664
Log:
re-order the steps

Modified:
    scripts/forward-patch

Modified: scripts/forward-patch
URL: http://svn.debian.org/wsvn/scripts/forward-patch?rev=77664&op=diff
==============================================================================
--- scripts/forward-patch (original)
+++ scripts/forward-patch Thu Jul 21 09:58:11 2011
@@ -37,15 +37,6 @@
 
 die 'Err: Provide a valid patch file' if !$patch;
 
-my $term = new Term::ReadLine 'forward-patch';
-my $subject = $term->readline('Subject>', '[PATCH] ');
-
-if ($subject eq '[PATCH] ') {
-	$subject .= basename($patch);
-	$subject =~ s/(\_|\-)/\ /g;
-	$subject =~ s/(\.patch|\.diff)//;
-}
-
 if (!$dist) {
 	open my $dctrl, '<', 'debian/control'
 		or die "Err: Can't open debain/control for reading: $!";
@@ -72,12 +63,30 @@
 
 die 'Err: Provide valid distribution name' if !$dist;
 
-# read patch header
+# prepare subject
+my $term = new Term::ReadLine 'forward-patch';
+my $subject = $term->readline('Subject>', '[PATCH] ');
+if ($subject eq '[PATCH] ') {
+	$subject .= basename($patch);
+	$subject =~ s/(\_|\-)/\ /g;
+	$subject =~ s/(\.patch|\.diff)//;
+}
+
+# RT::Client::REST does not support attachments, we need to use the email interface
+my $name = $ENV{'DEBFULLNAME'};
+my $email = $ENV{'DEBEMAIL'} || $ENV{'EMAIL'} || die "Err: Set a valid email address";
+
+if (!$name) {
+	$name = (getpwuid($<))[6];
+	$name =~ s/,.*//;
+}
+
+# prepare body
+my $body = "In Debian we are currently applying the attached patch to $dist.\n";
+$body .= "We thought you might be interested in it, too.\n\n";
+
 open my $patch_fh, '<', $patch
 	or die "Err: Can't open $patch for reading: $!";
-
-my $body = "In Debian we are currently applying the attached patch to $dist.\n";
-$body .= "We thought you might be interested in it, too.\n\n";
 
 while (my $line = <$patch_fh>) {
 	last if ($line =~ /^--- /);
@@ -86,19 +95,9 @@
 }
 
 $body .= "Thanks in advance,\n";
-
-# RT::Client::REST does not support attachments, we need to use the email interface
-
-my $name = $ENV{'DEBFULLNAME'};
-my $email = $ENV{'DEBEMAIL'} || $ENV{'EMAIL'} || die "Err: Set a valid email address";
-
-if (!$name) {
-	$name = (getpwuid($<))[6];
-	$name =~ s/,.*//;
-}
-
 $body .= "$name, Debian perl Group\n";
 
+# now on to the email
 my $from = "$name <$email>";
 my $to = 'bug-'.lc($dist).'@rt.cpan.org';
 
@@ -109,7 +108,7 @@
 	Type =>'multipart/mixed'
 ) or die "Error creating multipart container: $!\n";
 
-# generate body for ticket
+# edit body for ticket
 my $text = Proc::InvokeEditor -> edit(
 	$body
 );




More information about the Pkg-perl-cvs-commits mailing list