r56540 - /scripts/patchedit

jozef-guest at users.alioth.debian.org jozef-guest at users.alioth.debian.org
Mon Apr 19 15:52:39 UTC 2010


Author: jozef-guest
Date: Mon Apr 19 15:52:31 2010
New Revision: 56540

URL: http://svn.debian.org/wsvn/?sc=1&rev=56540
Log:
extra fields is not specified in dep3 so SKIP if fails, optional fields todo_skip() if fails

Modified:
    scripts/patchedit

Modified: scripts/patchedit
URL: http://svn.debian.org/wsvn/scripts/patchedit?rev=56540&op=diff
==============================================================================
--- scripts/patchedit (original)
+++ scripts/patchedit Mon Apr 19 15:52:31 2010
@@ -234,12 +234,42 @@
 	$tb->ok($patch_content->{'Description'} || $patch_content->{'Subject'}, 'has Description or Subject');
 	$tb->ok($patch_content->{'Origin'} || $patch_content->{'Author'}, 'has Origin or Author');
 	if ($also_optional) {
-		$tb->ok(scalar (grep { m/Bug-?/ } keys %{$patch_content}), 'has Bug or Bug-???');
-		$tb->ok($patch_content->{'Forwarded'}, 'has Forwarded');
-		$tb->ok($patch_content->{'Author'} || $patch_content->{'From'}, 'has Author or From');
-		$tb->ok($patch_content->{'Reviewed-by'} || $patch_content->{'Acked-by'}, 'has Reviewed-by or Acked-by');
-		$tb->ok($patch_content->{'Last-Update'}, 'has Last-Update');
-		$tb->ok($patch_content->{'Applied-Upstream'}, 'has Applied-Upstream');
+		if (scalar (grep { m/Bug-?/ } keys %{$patch_content}), 'has Bug or Bug-???') {
+			$tb->ok(1, 'has Bug or Bug-???');
+		}
+		else {
+			$tb->todo_skip('Bug or Bug-??? missing');
+		}
+		if ($patch_content->{'Forwarded'}) {
+			$tb->ok(1, 'has Forwarded');
+		}
+		else {
+			$tb->todo_skip('Forwarded missing')
+		}
+		if ($patch_content->{'Author'} || $patch_content->{'From'}) {
+			$tb->ok(1, 'has Author or From');
+		}
+		else {
+			$tb->todo_skip('Author or From missing');
+		}
+		if ($patch_content->{'Reviewed-by'} || $patch_content->{'Acked-by'}) {
+			$tb->ok(1, 'has Reviewed-by or Acked-by');
+		}
+		else {
+			$tb->todo_skip('Reviewed-by or Acked-by missing');
+		}
+		if ($patch_content->{'Last-Update'}) {
+			$tb->ok($patch_content->{'Last-Update'}, 'has Last-Update');
+		}
+		else {
+			$tb->todo_skip('Last-Update missing');
+		}
+		if ($patch_content->{'Applied-Upstream'}) {
+			$tb->ok(1, 'has Applied-Upstream');
+		}
+		else {
+			$tb->todo_skip('Applied-Upstream missing');
+		}
 	}
 	else {
 		$tb->skip('skipping optional') foreach (1..6);
@@ -250,7 +280,13 @@
 		grep { not m/^Bug-/ }      # different bugs are fine
 		keys %{$patch_content}
 	;
-	$tb->ok(@extra_fields == 0, 'no extra fields ('.join(',', @extra_fields).')');
+	if (@extra_fields == 0) {
+		$tb->ok(1, 'no extra fields');
+	}
+	else {
+		$tb->skip('some extra fields - '.join(', ', @extra_fields));
+		$tb->note(join("\n", map { $_.': '.$patch_content->{$_} } @extra_fields));
+	}
 }
 
 sub edit_patch {




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