2

I'm trying to create a package of Bugzilla 4 in a Launchpad PPA. Keep getting a malformed patch and have redid the patch from ground up numerous times without any success. One of the logs can be seen here (it's very long so just ctrl+f for the word fail/ed). The error refers to the following lines in my code:

diff -Naur bugzilla-srcdir.orig//Bugzilla.pm bugzilla-srcdir/Bugzilla.pm
--- bugzilla-srcdir.orig//Bugzilla.pm   2010-11-12 10:27:20.664915051 +0100
+++ bugzilla-srcdir/Bugzilla.pm 2010-11-12 10:28:19.721916586 +0100
@@ -144,7 +144,7 @@
        if (!i_am_cgi()
            && grep { $_ eq $script } SHUTDOWNHTML_EXIT_SILENTLY)
        {
-            exit;
+            exit(0);
        }

        # For security reasons, log out users when Bugzilla is down.
@@ -178,7 +178,7 @@
         $template->process("global/message.$extension.tmpl", $vars, \$t_output)
             || ThrowTemplateError($template->error);
         print $t_output . "\n";
-        exit;
+        exit(1);
     }
 }

diff -Naur bugzilla-srcdir.orig//chart.cgi bugzilla-srcdir/chart.cgi
--- bugzilla-srcdir.orig//chart.cgi 2010-11-12 10:26:25.625929357 +0100
+++ bugzilla-srcdir/chart.cgi   2010-11-12 10:28:19.721916586 +0100
@@ -79,7 +79,7 @@
if (grep(/^cmd-/, $cgi->param())) {
    my $params = $cgi->canonicalise_query("format", "ctype", "action");
    print $cgi->redirect("query.cgi?format=" . $cgi->param('query_format') .
                                               ($params ? "&$params" : ""));
-    exit;
+    exit(0);
}

my $action = $cgi->param('action');
@@ -102,7 +102,7 @@
if ($action eq "search") {
    my $params = $cgi->canonicalise_query("format", "ctype", "action");
    print $cgi->redirect("buglist.cgi" . ($params ? "?$params" : ""));
-    exit;
+    exit(0);
}

$user->in_group(Bugzilla->params->{"chartgroup"})
@@ -233,9 +233,9 @@
else {
        ThrowUserError('unknown_action', {action => $action});
}

-exit;
+exit(0);

# Find any selected series and return either the first or all of them.
sub getAndValidateSeriesIDs {

Ignore the time stamps, since I used the packaging source of Bugzilla 3.6 in Ubuntu Natty.

1 Answer 1

2

The patch that you are trying to apply in the branch has numerous patch hunks with incorrect whitespace or line counts. Both of these will cause the patch hunk to fail to apply.

In the example above, the first hunk has a missing space from most of the lines, causing it to not match the source. The second file has lines which aren't preceded by a single space, causing patch to try & interpret it as patch information. Once these errors are fixed, the are several more to fix in the patch.

1
  • Can you please refer to the exact lines, since I copied and pasted the code for the patch from the source.
    – Tamer
    Apr 26, 2011 at 10:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.