Fix regression in %patch handling (rhbz#455872)
authorPanu Matilainen <pmatilai@redhat.com>
Sat, 19 Jul 2008 12:27:42 +0000 (15:27 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Sat, 19 Jul 2008 12:27:42 +0000 (15:27 +0300)
- popt doesn't think of "008" as an integer, let popt think it's a string
  as we do our own conversion to number anyway

build/parsePrep.c

index 4b0ccdf..fcc28c8 100644 (file)
@@ -403,16 +403,16 @@ static int doSetupMacro(rpmSpec spec, const char *line)
  */
 static rpmRC doPatchMacro(rpmSpec spec, const char *line)
 {
-    char *opt_b;
+    char *opt_b, *opt_P;
     char *buf = NULL;
-    int opt_P, opt_p, opt_R, opt_E, opt_F;
+    int opt_p, opt_R, opt_E, opt_F;
     int argc, c;
     const char **argv = NULL;
     ARGV_t patch, patchnums = NULL;
     rpmRC rc = RPMRC_FAIL; /* assume failure */
     
     struct poptOption const patchOpts[] = {
-       { NULL, 'P', POPT_ARG_INT, &opt_P, 'P', NULL, NULL },
+       { NULL, 'P', POPT_ARG_STRING, &opt_P, 'P', NULL, NULL },
        { NULL, 'p', POPT_ARG_INT, &opt_p, 'p', NULL, NULL },
        { NULL, 'R', POPT_ARG_NONE, &opt_R, 'R', NULL, NULL },
        { NULL, 'E', POPT_ARG_NONE, &opt_E, 'E', NULL, NULL },