From: Alan Ezust <alan.ezust@presinet.com>
To: netfilter-devel@lists.netfilter.org
Subject: [patch] POM-NG: runme message clarification and filename regex fixes (v3)
Date: Thu, 11 Jan 2007 10:21:52 -0800 [thread overview]
Message-ID: <200701111021.55817.alan.ezust@presinet.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 347 bytes --]
This patch (3rd attempt to submit), includes fixes to the messages, to clarify
where things went wrong (when they do go wrong), and also avoids picking up
backup files in the patchlets directory.
Cheers --alan
--
Alan Ezust www.presinet.com
Presinet, inc alan.ezust@presinet.com
Victoria, BC, Canada
[-- Attachment #1.2: runme.patch --]
[-- Type: text/x-diff, Size: 4003 bytes --]
Index: Netfilter_POM.pm
===================================================================
--- Netfilter_POM.pm (revision 6735)
+++ Netfilter_POM.pm (working copy)
@@ -361,12 +361,13 @@
opendir(DIR, $dir)
or croak "can't open directory $dir: $!";
# Don't miss .foo-test files!
- my @dents = sort grep {!/^(\.\.?|CVS|\.svn)$/} readdir(DIR);
+ my @dents = sort grep {!/^(\.\.?|CVS|\.svn|.*~)$/} readdir(DIR);
closedir(DIR);
foreach my $dent (@dents) {
my $fullpath = "$dir/$dent";
if (-f $fullpath) {
- push(@{$patchlet->{$dent =~ /\.ladd/ ? 'ladds' : 'files'}->{$proj}->{$ver}}, "$pdir/$fullpath");
+ my $key = ($dent =~ /\.ladd/ ? 'ladds' : 'files');
+ push(@{$patchlet->{$key}->{$proj}->{$ver}}, "$pdir/$fullpath");
} elsif (-d _) {
$self->recurse($pdir, $fullpath, $patchlet, $proj, $ver);
}
@@ -486,7 +487,7 @@
# get list of source files that we'd need to copy
opendir(PDIR, $patchdir)
or croak "unable to open patchdir $patchdir: $!";
- my @dents = sort readdir(PDIR);
+ my @dents = sort grep {!/^(\.\.?|CVS|\.svn|.*~)$/} readdir(PDIR);
closedir(PDIR);
foreach my $pf (@dents) {
@@ -494,7 +495,6 @@
my $ver;
my $oldpwd;
- next if $pf =~ /^(\.|CVS$)/;
if ($pf =~ /\.patch/) {
# Patch file of a project:
@@ -820,22 +820,22 @@
print "patch output was:\n$patch_output\n";
}
if ($missing_files != 0) {
- $self->{ERRMSG} .= "cannot apply ($missing_files missing files)\n";
+ $self->{ERRMSG} .= "cannot apply $patchfile: ($missing_files missing files)\n";
return 0;
# } elsif ($rejects*2 > $hunks) {
} elsif ($rejects != 0) {
- $self->{ERRMSG} .= "cannot apply ($rejects rejects out of $hunks hunks)\n";
+ $self->{ERRMSG} .= "cannot apply $patchfile: ($rejects rejects out of $hunks hunks)\n";
return 0;
} else {
# could be applied!
- #printf(" ALREADY APPLIED (%d rejects out of %d hunks)\n", $rejects, $hunks;
+ #printf(" ALREADY APPLIED $patchfile: (%d rejects out of %d hunks)\n", $rejects, $hunks;
}
} else {
if ($missing_files != 0) {
- $self->{ERRMSG} .= "ERROR ($missing_files missing files)\n";
+ $self->{ERRMSG} .= "$patchfile: ERROR ($missing_files missing files)\n";
return 0;
} elsif ($rejects != 0) {
- $self->{ERRMSG} .= "ERROR ($rejects rejects out of $hunks hunks)\n";
+ $self->{ERRMSG} .= "$patchfile: ERROR ($rejects rejects out of $hunks hunks)\n";
return 0;
}
}
Index: runme
===================================================================
--- runme (revision 6735)
+++ runme (working copy)
@@ -3,7 +3,7 @@
# runme.pl, part of the patch-o-matig 'next generation' package.
# (C) 2003-2004 by Harald Welte <laforge@netfilter.org>
# 2004 by Jozsef Kadlecsik <kadlec@blackhole.kfki.ho>
-#
+# 2006 small fixes by Alan Ezust <alan.ezust@presinet.com>
# This script is subject to the GNU GPLv2
#
# $Id$
@@ -75,7 +75,7 @@
my @patchlets;
my @repositories;
-my $clrscr = "\n\n\n\n\n\n\n\n\n\n";
+my $clrscr = "\n\n\n\n\n";
my $opt_batch;
my $opt_verbose;
@@ -346,15 +346,16 @@
print($clrscr);
print_header($session);
- print("Already applied: ", join(" ", @{$session->{applied}}),"\n\n");
+ print("Already applied: ", join(" ", @{$session->{applied}}),"\n");
next PATCHLET unless $session->requirements_fulfilled($patchlet);
print("Testing ${plname}... ");
if (grep($_ eq $plname, @{$session->{applied}})) {
- print("applied\n");
+ print("already applied.\n");
next PATCHLET;
- } elsif ($session->apply_patchlet($patchlet, !$opt_reverse, 1, "/tmp/pom-$$", $opt_verbose)) {
- print("applied\n");
+ }
+ elsif ($session->apply_patchlet($patchlet, !$opt_reverse, 1, "/tmp/pom-$$", $opt_verbose)) {
+ print("Reverse Test passed - assuming already applied.\n");
push(@{$session->{applied}}, $plname);
next PATCHLET;
}
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next reply other threads:[~2007-01-11 18:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-11 18:21 Alan Ezust [this message]
2007-01-11 23:44 ` [patch] POM-NG: runme message clarification and filename regex fixes (v3) Jonas Berlin
2007-01-12 16:20 ` Patrick McHardy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200701111021.55817.alan.ezust@presinet.com \
--to=alan.ezust@presinet.com \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.