diff options
author | Jindrich Novy <jnovy@redhat.com> | 2008-07-04 14:58:38 +0200 |
---|---|---|
committer | Jindrich Novy <jnovy@redhat.com> | 2008-07-04 15:00:21 +0200 |
commit | 724b07bba5e802998b1b79b408c2401d2a238a3b (patch) | |
tree | 969f24a2bd286387513b06e32075945e507f471f /build/parsePrep.c | |
parent | 6c1103fc80bd0f063338c7147e2e9fac10b3a32c (diff) | |
download | librpm-tizen-724b07bba5e802998b1b79b408c2401d2a238a3b.tar.gz librpm-tizen-724b07bba5e802998b1b79b408c2401d2a238a3b.tar.bz2 librpm-tizen-724b07bba5e802998b1b79b408c2401d2a238a3b.zip |
Don't treat Patch and Source as Patch0 and Source0
Diffstat (limited to 'build/parsePrep.c')
-rw-r--r-- | build/parsePrep.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/build/parsePrep.c b/build/parsePrep.c index 1ce4f727a..3f3e8536d 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -77,7 +77,11 @@ static char *doPatch(rpmSpec spec, uint32_t c, int strip, const char *db, } } if (sp == NULL) { - rpmlog(RPMLOG_ERR, _("No patch number %u\n"), c); + if (c != INT_MAX) { + rpmlog(RPMLOG_ERR, _("No patch number %u\n"), c); + } else { + rpmlog(RPMLOG_ERR, _("%%patch without corresponding \"Patch:\" tag\n")); + } return NULL; } @@ -113,11 +117,16 @@ static char *doPatch(rpmSpec spec, uint32_t c, int strip, const char *db, free(arg_fuzz); free(arg_backup); free(args); - - rasprintf(&buf, "echo \"Patch #%u (%s):\"\n" - "%s\n", - c, basename(fn), patchcmd); - + + if (c != INT_MAX) { + rasprintf(&buf, "echo \"Patch #%u (%s):\"\n" + "%s\n", + c, basename(fn), patchcmd); + } else { + rasprintf(&buf, "echo \"Patch (%s):\"\n" + "%s\n", + basename(fn), patchcmd); + } free(fn); free(patchcmd); @@ -145,7 +154,11 @@ static char *doUntar(rpmSpec spec, uint32_t c, int quietly) } } if (sp == NULL) { - rpmlog(RPMLOG_ERR, _("No source number %u\n"), c); + if (c != INT_MAX) { + rpmlog(RPMLOG_ERR, _("No source number %u\n"), c); + } else { + rpmlog(RPMLOG_ERR, _("No \"Source:\" tag in the spec file\n"), c); + } return NULL; } @@ -336,7 +349,7 @@ static int doSetupMacro(rpmSpec spec, const char *line) /* do the default action */ if (!createDir && !skipDefaultAction) { - char *chptr = doUntar(spec, 0, quietly); + char *chptr = doUntar(spec, INT_MAX, quietly); if (!chptr) return RPMRC_FAIL; appendLineStringBuf(spec->prep, chptr); @@ -377,7 +390,6 @@ static int doSetupMacro(rpmSpec spec, const char *line) /** * Parse %patch line. * This supports too many crazy syntaxes: - * - %patch is equal to %patch0 * - %patchN is equal to %patch -P<N> * - -P<N> -P<N+1>... can be used to apply several patch on a single line * - Any trailing arguments are treated as patch numbers @@ -451,10 +463,6 @@ static rpmRC doPatchMacro(rpmSpec spec, const char *line) goto exit; } - /* %patch without -P<N> is treated as %patch0, urgh */ - if (opt_P < 0) { - argvAdd(&patchnums, "0"); - } /* Any trailing arguments are treated as patch numbers */ argvAppend(&patchnums, (ARGV_const_t) poptGetArgs(optCon)); |