Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Sep 2012 19:09:42 GMT
From:      Olli Hauer <ohauer@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        miwi@FreeBSD.org
Subject:   ports/171853: [patch] Tools/scripts/getpr save PR and patch with PR_$num prefix
Message-ID:  <201209211909.q8LJ9g4C019872@freefall.freebsd.org>
Resent-Message-ID: <201209211910.q8LJA6iZ019908@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         171853
>Category:       ports
>Synopsis:       [patch] Tools/scripts/getpr save PR and patch with PR_$num prefix
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 21 19:10:06 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Olli Hauer
>Release:        
>Organization:
>Environment:

>Description:
The patch below allows to save more then on PR to the same location
which is verry handy if more then one PR with patch exist for the
port.


>How-To-Repeat:

>Fix:

--- getpr.diff begins here ---
Index: /usr/ports/Tools/scripts/getpr
===================================================================
--- /usr/ports/Tools/scripts/getpr	(revision 304637)
+++ /usr/ports/Tools/scripts/getpr	(working copy)
@@ -26,10 +26,13 @@
 	$user = "$user@";
 }
 
+my $pr_num   = "PR_" . $pr;
+my $pr_patch = "PR_" . $pr . ".patch";
+
 # get the PR off of freefall
 
-open(D, "> $pr") or die "$pr: $!";
-open(PATCH, "> pr-patch") or die "pr-patch: $!";
+open(D, "> $pr_num") or die "$pr_num: $!";
+open(PATCH, "> $pr_patch") or die "$pr_patch: $!";
 open(PR, " ${ssh} ${user}freefall.freebsd.org query-pr -F $pr | ") or die $!;
 
 my $fix = "";
@@ -56,7 +59,7 @@
 # .tar.gz, .shar or just .gz, if not found, display what we think of as
 # the file submission (probably just a patch)
 
-open(PATCH, "pr-patch");
+open(PATCH, $pr_patch);
 while(<PATCH>) {
 	if (m/^# This is a shell archive.  Save it in a file, remove anything before/) {
 		&shar;
@@ -70,7 +73,7 @@
 }
 
 close(PATCH);
-system("more pr-patch");
+system("more $pr_patch");
 
 exit;
 
@@ -80,7 +83,7 @@
 	$fname =~ s/\s+$//g;
 	print "$fname\n";
 
-	print `uudecode pr-patch`;
+	print `uudecode $pr_patch`;
 	if (($fname =~ m/.tar.gz$/) || ($fname =~ m/.tgz$/)) {
 		print "you may extract this tarball by typing tar xvzf $fname\n";
 	} elsif ($fname =~ m/.gz$/) {
@@ -89,5 +92,5 @@
 }
 
 sub shar {
-	print "you may extract this shar archive by typing sh pr-patch\n";
+	print "you may extract this shar archive by typing sh $pr_patch\n";
 }
--- getpr.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209211909.q8LJ9g4C019872>