[Bug 521] New: [patch] - some changes to runme script

bugzilla-daemon at bugzilla.netfilter.org bugzilla-daemon at bugzilla.netfilter.org
Thu Oct 5 01:16:50 CEST 2006


https://bugzilla.netfilter.org/bugzilla/show_bug.cgi?id=521

           Summary: [patch] - some changes to runme script
           Product: netfilter/iptables
           Version: patch-o-matic-ng
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: unknown
        AssignedTo: laforge at netfilter.org
        ReportedBy: alan.ezust at presinet.com


This patch addresses 2 bugs I found in runme.

1. When a patch fails, it shows you exactly which file caused the failure.
2. When there are backup files (ending with ~ or beginning with #) they are
ignored by POM.

--- ../patch-o-matic-ng-trunk/Netfilter_POM.pm	2006-10-03 08:21:19.000000000 -0700
+++ Netfilter_POM.pm	2006-10-03 10:58:03.000000000 -0700
@@ -361,7 +361,7 @@
 	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";
@@ -486,7 +486,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 +494,6 @@
 		my $ver;
 		my $oldpwd;
 
-		next if $pf =~ /^(\.|CVS$)/;
 
 		if ($pf =~ /\.patch/) {
 			# Patch file of a project:
@@ -820,22 +819,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;
 			}
 		}
--- ../patch-o-matic-ng-trunk/runme	2006-10-03 08:21:19.000000000 -0700
+++ runme	2006-10-03 08:33:18.000000000 -0700
@@ -109,7 +109,8 @@
 	open(SOURCES, "<sources.list") || die "could not open sources.list";
 	while (my $source = <SOURCES>) {
 		chomp($source);
-		if ($source =~ m/^\s*#/ || $source =~ m/^\s+$/) {
+		if ($source =~ m/^\s*#/ || $source =~ m/^\s+$/
+                    || $source =~ m/~$/ ) {
 			next;
 		}
 		if (!open(INDEX, "curl -s $source/index |")) {

-- 
Configure bugmail: https://bugzilla.netfilter.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the netfilter-buglog mailing list