diff options
author | mharo <mharo@FreeBSD.org> | 2000-05-02 03:53:54 +0800 |
---|---|---|
committer | mharo <mharo@FreeBSD.org> | 2000-05-02 03:53:54 +0800 |
commit | bf18bec4c5c302d3eee45f39f8a73ea89b5f7c40 (patch) | |
tree | 4b7ed70b1242a43648a513b67b802dc91cc5762e /Tools/scripts/getpr | |
parent | 34f7bcc941c68c004507540cb6ac062e919055b9 (diff) | |
download | freebsd-ports-gnome-bf18bec4c5c302d3eee45f39f8a73ea89b5f7c40.tar.gz freebsd-ports-gnome-bf18bec4c5c302d3eee45f39f8a73ea89b5f7c40.tar.zst freebsd-ports-gnome-bf18bec4c5c302d3eee45f39f8a73ea89b5f7c40.zip |
3 little scripts I use when dealing with port update PRs.
getpr - downloads a problem report from GNATS and attempts to extract
the patch, shar, uuencoded file from it.
this probably needs to be checked for potential security problems.
prpatch - just does `patch $1 < pr-patch' (pr-patch is created by getpr)
prdone - checks in the port, attempting to fill out the commit message using
information from the problem report and then takes you into edit-pr
so you don't forget to close the PR.
Diffstat (limited to 'Tools/scripts/getpr')
-rwxr-xr-x | Tools/scripts/getpr | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/Tools/scripts/getpr b/Tools/scripts/getpr new file mode 100755 index 000000000000..e7b703bc607f --- /dev/null +++ b/Tools/scripts/getpr @@ -0,0 +1,81 @@ +#!/usr/bin/perl +# +# MAINTAINER= mharo@FreeBSD.org +# +# $FreeBSD$ +# + +use strict; + +my $pr = shift; + +if ($pr eq "") { + print STDERR "getpr prnum\n"; + exit 1 +} + +# get the PR off of freefall + +open(D, "> $pr") or die "$pr: $!"; +open(PATCH, "> pr-patch") or die "pr-patch: $!"; +open(PR, " ssh freefall query-pr -F $pr | ") or die $!; + +my $fix = ""; +my $infix = 0; + +while(<PR>) { + print D; + + if (m/^>Release-Note:/) { + $infix = 0; + } + if ($infix == 1) { + print PATCH; + } + if (m/^>Fix:/) { + $infix = 1; + } +} +close(D); +close(PR); +close(PATCH); + +# decode the submission attempting to find a file attachment by extension +# .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"); +while(<PATCH>) { + if (m/^# This is a shell archive. Save it in a file, remove anything before/) { + &shar; + exit; + } + if (m/^begin (\d+)? (.*)/) { + &uudecode($2); + close(PATCH); + exit; + } +} + +close(PATCH); +system("more pr-patch"); + +exit; + +sub uudecode { + my ($fname) = @_; + + $fname =~ s/\s+$//g; + print "$fname\n"; + + 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$/) { + print `gunzip $fname`; + } +} + +sub shar { + print "you may extract this shar archive by typing sh pr-patch\n"; +} |