[CVS] RPM: rpm/build/ parsePrep.c
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Per Ãyvind Karlsen Root: /v/rpm/cvs Email: pkarl...@rpm5.org Module: rpm Date: 18-Oct-2010 13:33:01 Branch: HEAD Handle: 201010181133 Modified files: rpm/build parsePrep.c Log: check return value of rindex() before using strcasecmp() Summary: RevisionChanges Path 2.132 +2 -2 rpm/build/parsePrep.c patch -p0 <<'@@ .' Index: rpm/build/parsePrep.c $ cvs diff -u -r2.131 -r2.132 parsePrep.c --- rpm/build/parsePrep.c 18 Oct 2010 11:27:12 - 2.131 +++ rpm/build/parsePrep.c 18 Oct 2010 11:33:00 - 2.132 @@ -237,7 +237,7 @@ } t = rindex(sp->source, '.'); -if(!strcasecmp(t, ".gem")) +if(t && !strcasecmp(t, ".gem")) rubygem = 1; t = stpcpy(taropts, "-x"); @@ -495,7 +495,7 @@ } if (sp != NULL) { char *t = rindex(sp->source, '.'); - if(!strcasecmp(t, ".gem")) + if(t && !strcasecmp(t, ".gem")) createDir = 1; } } @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org
[CVS] RPM: rpm/build/ parsePrep.c
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 18-Dec-2008 19:59:15 Branch: HEAD Handle: 2008121818591500 Modified files: rpm/build parsePrep.c Log: - jbj: change to positive #ifdef vendor logic, #ifndef is too goosey-loosey. Summary: RevisionChanges Path 2.129 +5 -3 rpm/build/parsePrep.c patch -p0 <<'@@ .' Index: rpm/build/parsePrep.c $ cvs diff -u -r2.128 -r2.129 parsePrep.c --- rpm/build/parsePrep.c 18 Dec 2008 17:11:34 - 2.128 +++ rpm/build/parsePrep.c 18 Dec 2008 18:59:15 - 2.129 @@ -283,11 +283,13 @@ if (strcmp(tar, "%{__tar}") == 0) tar = xstrdup("tar"); -#if !defined(RPM_VENDOR_ARK) /* use-gnu-tar-compression-detection */ -if (compressed != COMPRESSED_NOT) { +#if defined(RPM_VENDOR_ARK) /* use-gnu-tar-compression-detection */ +/* We leave compression handling for all tar based files up to GNU tar */ +if (compressed == COMPRESSED_ZIP) #else -if (compressed == COMPRESSED_ZIP) { /* We leave compression handling for all tar based files up to GNU tar */ +if (compressed != COMPRESSED_NOT) #endif +{ const char *zipper; int needtar = 1; @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org
[CVS] RPM: rpm/build/ parsePrep.c
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Ralf S. Engelschall Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 23-Dec-2007 22:18:49 Branch: HEAD Handle: 2007122321184900 Modified files: rpm/build parsePrep.c Log: allow the (currently still OpenPKG-specific) -bf option to provide a nice source/patch file listing under verbose mode (option -v) Summary: RevisionChanges Path 2.110 +39 -2 rpm/build/parsePrep.c patch -p0 <<'@@ .' Index: rpm/build/parsePrep.c $ cvs diff -u -r2.109 -r2.110 parsePrep.c --- rpm/build/parsePrep.c 23 Dec 2007 19:41:28 - 2.109 +++ rpm/build/parsePrep.c 23 Dec 2007 21:18:49 - 2.110 @@ -636,6 +636,33 @@ } #endif +static void prepFetchVerbose(struct Source *sp, struct stat *st) +{ +#if defined(RPM_VENDOR_OPENPKG) /* explicit-source-fetch-cli-option */ +char *buf; +size_t buf_len; +int i; + +if (!(rpmIsVerbose() && !quietly && (rpmBTArgs.buildAmount & RPMBUILD_FETCHSOURCE))) +return; +buf_len = 2*80; +if ((buf = (char *)malloc(buf_len)) == NULL) +return; +snprintf(buf, buf_len, "%s%d:", (sp->flags & RPMFILE_SOURCE) ? "Source" : "Patch", sp->num); +for (i = strlen(buf); i <= 11; i++) +buf[i] = ' '; +snprintf(buf+i, buf_len-i, "%-52.52s", sp->source); +i = strlen(buf); +if (st != NULL) +snprintf(buf+i, buf_len-i, " %9lu Bytes\n", (unsigned long)st->st_size); +else +snprintf(buf+i, buf_len-i, " ...MISSING\n"); +rpmlog(RPMLOG_NOTICE, "%s", buf); +buf = _free(buf); +#endif +return; +} + /** * Check that all sources/patches/icons exist locally, fetching if necessary. */ @@ -681,6 +708,11 @@ if (rpmrc != RPMRC_OK) return -1; +#if defined(RPM_VENDOR_OPENPKG) /* explicit-source-fetch-cli-option */ +if (rpmIsVerbose() && !quietly && (rpmBTArgs.buildAmount & RPMBUILD_FETCHSOURCE)) +rpmlog(RPMLOG_NOTICE, "Checking source and patch file(s):\n"); +#endif + ec = 0; for (sp = spec->sources; sp != NULL; sp = sp->next) { @@ -710,13 +742,18 @@ up from there, too. */ Lurlfn = rpmGenPath(NULL, Smacro, sp->source); rc = Lstat(Lurlfn, &st); - if (rc == 0) + if (rc == 0) { +prepFetchVerbose(sp, &st); goto bottom; +} #endif Lurlfn = rpmGenPath(NULL, Lmacro, sp->source); rc = Lstat(Lurlfn, &st); - if (rc == 0) + if (rc == 0) { +prepFetchVerbose(sp, &st); goto bottom; +} +prepFetchVerbose(sp, NULL); if (errno != ENOENT) { ec++; rpmlog(RPMLOG_ERR, _("Missing %s%d %s: %s\n"), @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org
[CVS] RPM: rpm/build/ parsePrep.c
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 16-Dec-2007 19:16:57 Branch: HEAD Handle: 2007121618165700 Modified files: rpm/build parsePrep.c Log: - remove compiler warning. Summary: RevisionChanges Path 2.101 +2 -2 rpm/build/parsePrep.c patch -p0 <<'@@ .' Index: rpm/build/parsePrep.c $ cvs diff -u -r2.100 -r2.101 parsePrep.c --- rpm/build/parsePrep.c 12 Dec 2007 19:24:13 - 2.100 +++ rpm/build/parsePrep.c 16 Dec 2007 18:16:57 - 2.101 @@ -170,14 +170,14 @@ "if [ $STATUS -ne 0 ]; then\n" " exit $STATUS\n" "fi", - c, /[EMAIL PROTECTED]@*/ (const char *) basename(fn), /[EMAIL PROTECTED]@*/ + c, /[EMAIL PROTECTED]@*/ (const char *) basename((char *)fn), /[EMAIL PROTECTED]@*/ zipper, fn, patch, strip, args); zipper = _free(zipper); } else { sprintf(buf, "echo \"Patch #%d (%s):\"\n" - "%s -p%d %s -s < '%s'", c, (const char *) basename(fn), + "%s -p%d %s -s < '%s'", c, (const char *) basename((char *)fn), patch, strip, args, fn); } @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org
[CVS] RPM: rpm/build/ parsePrep.c rpm/ macros.in rpm/rpmio/ macro.c
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 22-Jul-2007 03:54:12 Branch: HEAD Handle: 2007072202541200 Modified files: rpm macros.in rpm/build parsePrep.c rpm/rpmio macro.c Log: revert all %patch changes, fixing %patch. Summary: RevisionChanges Path 2.87+3 -3 rpm/build/parsePrep.c 1.184 +2 -2 rpm/macros.in 2.134 +6 -1 rpm/rpmio/macro.c patch -p0 <<'@@ .' Index: rpm/build/parsePrep.c $ cvs diff -u -r2.86 -r2.87 parsePrep.c --- rpm/build/parsePrep.c 22 Jul 2007 01:39:29 - 2.86 +++ rpm/build/parsePrep.c 22 Jul 2007 01:54:12 - 2.87 @@ -54,7 +54,7 @@ return 0; } -#ifdef DYING +#ifndef DYING /** * Expand %patchN macro into %prep scriptlet. * @param spec build info @@ -467,7 +467,7 @@ return 0; } -#ifdef DYING +#ifndef DYING /** * Parse %patch line. * @param spec build info @@ -756,7 +756,7 @@ /[EMAIL PROTECTED]@*/ if (! strncmp(cp, "%setup", sizeof("%setup")-1)) { res = doSetupMacro(spec, cp); -#ifdef DYING +#ifndef DYING } else if (! strncmp(cp, "%patch", sizeof("%patch")-1)) { res = doPatchMacro(spec, cp); #endif @@ . patch -p0 <<'@@ .' Index: rpm/macros.in $ cvs diff -u -r1.183 -r1.184 macros.in --- rpm/macros.in 22 Jul 2007 01:33:34 - 1.183 +++ rpm/macros.in 22 Jul 2007 01:54:12 - 1.184 @@ -1,7 +1,7 @@ #/*! \page config_macros Default configuration: @USRLIBRPM@/macros # \verbatim # -# $Id: macros.in,v 1.183 2007/07/22 01:33:34 jbj Exp $ +# $Id: macros.in,v 1.184 2007/07/22 01:54:12 jbj Exp $ # # This is a global RPM configuration file. All changes made here will # be lost when the rpm package is upgraded. Any per-system configuration @@ -387,7 +387,7 @@ # a file and aplly using patch(1). # -%patch(b:p:P:REz:F:d:) \ +%Xpatch(b:p:P:REz:F:d:) \ %define patch_file %{P:%{-P:%{-P*}}%{!-P:%%PATCH0}} \ %define patch_suffix %{-b:-b --suffix %{-b*}}%{-z:--suffix %{-z*}} echo "Patch #%{-P:%{-P*}}%{!-P:0} (%{basename:%patch_file}):" \ @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/macro.c $ cvs diff -u -r2.133 -r2.134 macro.c --- rpm/rpmio/macro.c 22 Jul 2007 00:59:08 - 2.133 +++ rpm/rpmio/macro.c 22 Jul 2007 01:54:12 - 2.134 @@ -1134,12 +1134,15 @@ buf[gn] = '\0'; (void) expandU(mb, buf, sizeof(buf)); } +#ifdef NOTYET if (fn > 5 && STREQ("patch", f, 5) && xisdigit(f[5])) { for ( c = 5 ; c < fn-1 && f[c] == '0' && xisdigit(f[c+1]) ; c++ ) ; /* Skip leading zeros */ b = buf; be = stpncpy( stpcpy(b, "%patch -P "), f+c, fn-c); *be = '\0'; -} else if (STREQ("basename", f, fn)) { +} else +#endif +if (STREQ("basename", f, fn)) { if ((b = strrchr(buf, '/')) == NULL) b = buf; else @@ -1479,6 +1482,7 @@ } #endif +#ifdef NOTYET /* Rewrite "%patchNN ..." as "%patch -P NN ..." and expand. */ if (lastc != NULL && fn > 5 && STREQ("patch", f, 5) && xisdigit(f[5])) { /[EMAIL PROTECTED]@*/ /* FIX: verbose may be set */ @@ -1487,6 +1491,7 @@ s = lastc; continue; } +#endif /* XXX necessary but clunky */ if (STREQ("basename", f, fn) || @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org
[CVS] RPM: rpm/build/ parsePrep.c
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 22-Jul-2007 03:39:29 Branch: HEAD Handle: 2007072202392900 Modified files: rpm/build parsePrep.c Log: revert 2.79. Summary: RevisionChanges Path 2.86+276 -2 rpm/build/parsePrep.c patch -p0 <<'@@ .' Index: rpm/build/parsePrep.c $ cvs diff -u -r2.85 -r2.86 parsePrep.c --- rpm/build/parsePrep.c 22 Jul 2007 01:20:04 - 2.85 +++ rpm/build/parsePrep.c 22 Jul 2007 01:39:29 - 2.86 @@ -54,6 +54,132 @@ return 0; } +#ifdef DYING +/** + * Expand %patchN macro into %prep scriptlet. + * @param spec build info + * @param c patch index + * @param strip patch level (i.e. patch -p argument) + * @param db saved file suffix (i.e. patch --suffix argument) + * @param reverseinclude -R? + * @param removeEmpties include -E? + * @param fuzz include -F? + * @return expanded %patch macro (NULL on error) + */ +/[EMAIL PROTECTED]@*/ +/[EMAIL PROTECTED]@*/ +static char *doPatch(Spec spec, int c, int strip, const char *db, + int reverse, int removeEmpties, int fuzz, const char *subdir) + /[EMAIL PROTECTED] rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /[EMAIL PROTECTED] rpmGlobalMacroContext, fileSystem, internalState @*/ +{ +const char *fn, *Lurlfn; +static char buf[BUFSIZ]; +char args[BUFSIZ], *t = args; +struct Source *sp; +rpmCompressedMagic compressed = COMPRESSED_NOT; +int urltype; +const char *patch; + +*t = '\0'; +if (db) + t = stpcpy( stpcpy(t, "-b --suffix "), db); +if (subdir) + t = stpcpy( stpcpy(t, "-d "), subdir); +if (fuzz) { + t = stpcpy(t, "-F "); + sprintf(t, "%10.10d", fuzz); + t += strlen(t); +} +if (reverse) + t = stpcpy(t, " -R"); +if (removeEmpties) + t = stpcpy(t, " -E"); + +for (sp = spec->sources; sp != NULL; sp = sp->next) { + if ((sp->flags & RPMFILE_PATCH) && (sp->num == c)) + break; +} +if (sp == NULL) { + rpmError(RPMERR_BADSPEC, _("No patch number %d\n"), c); + return NULL; +} + +Lurlfn = rpmGenPath(NULL, "%{_patchdir}/", sp->source); + +/* XXX On non-build parse's, file cannot be stat'd or read */ +if (!spec->force && (isCompressed(Lurlfn, &compressed) || checkOwners(Lurlfn))) { + Lurlfn = _free(Lurlfn); + return NULL; +} + +fn = NULL; +urltype = urlPath(Lurlfn, &fn); +switch (urltype) { +case URL_IS_HTTPS: /* XXX WRONG WRONG WRONG */ +case URL_IS_HTTP:/* XXX WRONG WRONG WRONG */ +case URL_IS_FTP: /* XXX WRONG WRONG WRONG */ +case URL_IS_HKP: /* XXX WRONG WRONG WRONG */ +case URL_IS_PATH: +case URL_IS_UNKNOWN: + break; +case URL_IS_DASH: + Lurlfn = _free(Lurlfn); + return NULL; + /[EMAIL PROTECTED]@*/ break; +} + +patch = rpmGetPath("%{__patch}", NULL); +if (strcmp(patch, "%{__patch}") == 0) +patch = xstrdup("patch"); + +if (compressed) { + const char *zipper; + + switch (compressed) { + default: + case COMPRESSED_NOT:/* XXX can't happen */ + case COMPRESSED_OTHER: + case COMPRESSED_ZIP:/* XXX wrong */ + zipper = "%{__gzip}"; + break; + case COMPRESSED_BZIP2: + zipper = "%{__bzip2}"; + break; + case COMPRESSED_LZOP: + zipper = "%{__lzop}"; + break; + case COMPRESSED_LZMA: + zipper = "%{__lzma}"; + break; + } + zipper = rpmGetPath(zipper, NULL); + + sprintf(buf, + "echo \"Patch #%d (%s):\"\n" + "%s -d < '%s' | %s -p%d %s -s\n" + "STATUS=$?\n" + "if [ $STATUS -ne 0 ]; then\n" + " exit $STATUS\n" + "fi", + c, /[EMAIL PROTECTED]@*/ (const char *) basename(fn), /[EMAIL PROTECTED]@*/ + zipper, + fn, patch, strip, args); + zipper = _free(zipper); +} else { + sprintf(buf, + "echo \"Patch #%d (%s):\"\n" + "%s -p%d %s -s < '%s'", c, (const char *) basename(fn), + patch, strip, args, fn); +} + +patch = _free(patch); +Lurl
[CVS] RPM: rpm/build/ parsePrep.c
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 22-Jul-2007 03:20:04 Branch: HEAD Handle: 2007072202200400 Modified files: rpm/build parsePrep.c Log: revert 2.84. Summary: RevisionChanges Path 2.85+12 -12 rpm/build/parsePrep.c patch -p0 <<'@@ .' Index: rpm/build/parsePrep.c $ cvs diff -u -r2.84 -r2.85 parsePrep.c --- rpm/build/parsePrep.c 20 Jul 2007 16:23:36 - 2.84 +++ rpm/build/parsePrep.c 22 Jul 2007 01:20:04 - 2.85 @@ -90,7 +90,7 @@ taropts = ((rpmIsVerbose() && !quietly) ? "-xvvf" : "-xf"); /[EMAIL PROTECTED]@*/ -Lurlfn = rpmGenPath(NULL, "%{?_sourcedir/}", sp->source); +Lurlfn = rpmGenPath(NULL, "%{_sourcedir}/", sp->source); /* XXX On non-build parse's, file cannot be stat'd or read */ if (!spec->force && (isCompressed(Lurlfn, &compressed) || checkOwners(Lurlfn))) { @@ -268,7 +268,7 @@ argv = _free(argv); /* cd to the build dir */ -{const char * buildDirURL = rpmGenPath(spec->rootURL, "%{?_builddir/}", ""); +{const char * buildDirURL = rpmGenPath(spec->rootURL, "%{_builddir}", ""); const char *buildDir; (void) urlPath(buildDirURL, &buildDir); @@ -357,7 +357,7 @@ /* XXX insure that %{_sourcedir} exists */ rpmrc = RPMRC_OK; -Lurlfn = rpmGenPath(NULL, "%{?_sourcedir/}", NULL); +Lurlfn = rpmGenPath(NULL, "%{?_sourcedir}", NULL); if (Lurlfn != NULL && *Lurlfn != '\0') rpmrc = rpmMkdirPath(Lurlfn, "_sourcedir"); Lurlfn = _free(Lurlfn); @@ -366,7 +366,7 @@ /* XXX insure that %{_patchdir} exists */ rpmrc = RPMRC_OK; -Lurlfn = rpmGenPath(NULL, "%{?_patchdir/}", NULL); +Lurlfn = rpmGenPath(NULL, "%{?_patchdir}", NULL); if (Lurlfn != NULL && *Lurlfn != '\0') rpmrc = rpmMkdirPath(Lurlfn, "_patchdir"); Lurlfn = _free(Lurlfn); @@ -375,7 +375,7 @@ /* XXX insure that %{_icondir} exists */ rpmrc = RPMRC_OK; -Lurlfn = rpmGenPath(NULL, "%{?_icondir/}", NULL); +Lurlfn = rpmGenPath(NULL, "%{?_icondir}", NULL); if (Lurlfn != NULL && *Lurlfn != '\0') rpmrc = rpmMkdirPath(Lurlfn, "_icondir"); Lurlfn = _free(Lurlfn); @@ -387,16 +387,16 @@ for (sp = spec->sources; sp != NULL; sp = sp->next) { if (sp->flags & RPMFILE_SOURCE) { - Rmacro = "%{?_Rsourcedir/}"; - Lmacro = "%{?_sourcedir/}"; + Rmacro = "%{?_Rsourcedir}/"; + Lmacro = "%{?_sourcedir}/"; } else if (sp->flags & RPMFILE_PATCH) { - Rmacro = "%{?_Rpatchdir/}"; - Lmacro = "%{?_patchdir/}"; + Rmacro = "%{?_Rpatchdir}/"; + Lmacro = "%{?_patchdir}/"; } else if (sp->flags & RPMFILE_ICON) { - Rmacro = "%{?_Ricondir/}"; - Lmacro = "%{?_icondir/}"; + Rmacro = "%{?_Ricondir}/"; + Lmacro = "%{?_icondir}/"; } else continue; @@ -413,7 +413,7 @@ } Rurlfn = rpmGenPath(NULL, Rmacro, sp->source); - if (Rurlfn == NULL || Rurlfn[0] == '\0' || !strcmp(Lurlfn, Rurlfn)) { + if (Rurlfn == NULL || Rurlfn[0] == '\0' || !strcmp(Rurlfn, "/") || !strcmp(Lurlfn, Rurlfn)) { rpmError(RPMERR_BADFILENAME, _("file %s missing: %s\n"), Lurlfn, strerror(errno)); ec++; @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org
[CVS] RPM: rpm/build/ parsePrep.c
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 20-Jul-2007 15:02:47 Branch: HEAD Handle: 2007072014024600 Modified files: rpm/build parsePrep.c Log: grr, stoopid trailing '/' on directories. perhaps %{?foo/} expansion? Summary: RevisionChanges Path 2.83+1 -1 rpm/build/parsePrep.c patch -p0 <<'@@ .' Index: rpm/build/parsePrep.c $ cvs diff -u -r2.82 -r2.83 parsePrep.c --- rpm/build/parsePrep.c 20 Jul 2007 12:43:31 - 2.82 +++ rpm/build/parsePrep.c 20 Jul 2007 13:02:46 - 2.83 @@ -413,7 +413,7 @@ } Rurlfn = rpmGenPath(NULL, Rmacro, sp->source); - if (Rurlfn == NULL || Rurlfn[0] == '\0' || !strcmp(Lurlfn, Rurlfn)) { + if (Rurlfn == NULL || Rurlfn[0] == '\0' || !strcmp(Rurlfn, "/") || !strcmp(Lurlfn, Rurlfn)) { rpmError(RPMERR_BADFILENAME, _("file %s missing: %s\n"), Lurlfn, strerror(errno)); ec++; @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org
[CVS] RPM: rpm/build/ parsePrep.c
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 20-Jul-2007 14:43:31 Branch: HEAD Handle: 2007072013433100 Modified files: rpm/build parsePrep.c Log: simplify macro undefined test, remove absolute path restriction. Summary: RevisionChanges Path 2.82+7 -7 rpm/build/parsePrep.c patch -p0 <<'@@ .' Index: rpm/build/parsePrep.c $ cvs diff -u -r2.81 -r2.82 parsePrep.c --- rpm/build/parsePrep.c 20 Jul 2007 12:39:37 - 2.81 +++ rpm/build/parsePrep.c 20 Jul 2007 12:43:31 - 2.82 @@ -387,16 +387,16 @@ for (sp = spec->sources; sp != NULL; sp = sp->next) { if (sp->flags & RPMFILE_SOURCE) { - Rmacro = "%{_Rsourcedir}/"; - Lmacro = "%{_sourcedir}/"; + Rmacro = "%{?_Rsourcedir}/"; + Lmacro = "%{?_sourcedir}/"; } else if (sp->flags & RPMFILE_PATCH) { - Rmacro = "%{_Rpatchdir}/"; - Lmacro = "%{_patchdir}/"; + Rmacro = "%{?_Rpatchdir}/"; + Lmacro = "%{?_patchdir}/"; } else if (sp->flags & RPMFILE_ICON) { - Rmacro = "%{_Ricondir}/"; - Lmacro = "%{_icondir}/"; + Rmacro = "%{?_Ricondir}/"; + Lmacro = "%{?_icondir}/"; } else continue; @@ -413,7 +413,7 @@ } Rurlfn = rpmGenPath(NULL, Rmacro, sp->source); - if (Rurlfn == NULL || (Rurlfn[0] == '/' && Rurlfn[1] == '%') || !strcmp(Lurlfn, Rurlfn)) { + if (Rurlfn == NULL || Rurlfn[0] == '\0' || !strcmp(Lurlfn, Rurlfn)) { rpmError(RPMERR_BADFILENAME, _("file %s missing: %s\n"), Lurlfn, strerror(errno)); ec++; @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org
[CVS] RPM: rpm/build/ parsePrep.c
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Ralf S. Engelschall Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 20-Jul-2007 14:39:37 Branch: HEAD Handle: 2007072013393700 Modified files: rpm/build parsePrep.c Log: using rpmGenPath() on '%{_Rsourcedir}' results in '/%{_Rsourcedir}'. Make sure this is detected correctly Summary: RevisionChanges Path 2.81+1 -1 rpm/build/parsePrep.c patch -p0 <<'@@ .' Index: rpm/build/parsePrep.c $ cvs diff -u -r2.80 -r2.81 parsePrep.c --- rpm/build/parsePrep.c 17 Jul 2007 06:38:19 - 2.80 +++ rpm/build/parsePrep.c 20 Jul 2007 12:39:37 - 2.81 @@ -413,7 +413,7 @@ } Rurlfn = rpmGenPath(NULL, Rmacro, sp->source); - if (Rurlfn == NULL || *Rurlfn == '%' || !strcmp(Lurlfn, Rurlfn)) { + if (Rurlfn == NULL || (Rurlfn[0] == '/' && Rurlfn[1] == '%') || !strcmp(Lurlfn, Rurlfn)) { rpmError(RPMERR_BADFILENAME, _("file %s missing: %s\n"), Lurlfn, strerror(errno)); ec++; @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org
[CVS] RPM: rpm/build/ parsePrep.c
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Ralf S. Engelschall Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 03-Jul-2007 17:24:30 Branch: HEAD Handle: 2007070316243000 Modified files: rpm/build parsePrep.c Log: use macro %__tar instead of %_tarbin and fix memory handling of 'patch' variable by allocating the fallback string Summary: RevisionChanges Path 2.77+3 -3 rpm/build/parsePrep.c patch -p0 <<'@@ .' Index: rpm/build/parsePrep.c $ cvs diff -u -r2.76 -r2.77 parsePrep.c --- rpm/build/parsePrep.c 3 Jul 2007 00:55:39 - 2.76 +++ rpm/build/parsePrep.c 3 Jul 2007 15:24:30 - 2.77 @@ -130,7 +130,7 @@ patch = rpmGetPath("%{__patch}", NULL); if (strcmp(patch, "%{__patch}") == 0) -patch = "patch"; +patch = xstrdup("patch"); if (compressed) { const char *zipper; @@ -238,8 +238,8 @@ /[EMAIL PROTECTED]@*/ break; } -tar = rpmGetPath("%{_tarbin}", NULL); -if (strcmp(tar, "%{_tarbin}") == 0) +tar = rpmGetPath("%{__tar}", NULL); +if (strcmp(tar, "%{__tar}") == 0) tar = xstrdup("tar"); if (compressed != COMPRESSED_NOT) { @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org
[CVS] RPM: rpm/build/ parsePrep.c
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Mark Hatle Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 03-Jul-2007 02:55:40 Branch: HEAD Handle: 2007070301553900 Modified files: rpm/build parsePrep.c Log: the value of "tar" is freed later on. Which causes a problem. strdup makes sure that it's freeable. Summary: RevisionChanges Path 2.76+1 -1 rpm/build/parsePrep.c patch -p0 <<'@@ .' Index: rpm/build/parsePrep.c $ cvs diff -u -r2.75 -r2.76 parsePrep.c --- rpm/build/parsePrep.c 21 Jun 2007 18:58:05 - 2.75 +++ rpm/build/parsePrep.c 3 Jul 2007 00:55:39 - 2.76 @@ -240,7 +240,7 @@ tar = rpmGetPath("%{_tarbin}", NULL); if (strcmp(tar, "%{_tarbin}") == 0) -tar = "tar"; +tar = xstrdup("tar"); if (compressed != COMPRESSED_NOT) { const char *zipper; @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org
[CVS] RPM: rpm/build/ parsePrep.c
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 19-Jun-2007 15:48:45 Branch: HEAD Handle: 2007061914484400 Modified files: rpm/build parsePrep.c Log: handle %patch -Fn as well as %patch -F n. Summary: RevisionChanges Path 2.72+3 -1 rpm/build/parsePrep.c patch -p0 <<'@@ .' Index: rpm/build/parsePrep.c $ cvs diff -u -r2.71 -r2.72 parsePrep.c --- rpm/build/parsePrep.c 18 Jun 2007 16:50:36 - 2.71 +++ rpm/build/parsePrep.c 19 Jun 2007 13:48:44 - 2.72 @@ -507,8 +507,10 @@ } } else if (!strcmp(s, "-F")) { /* fuzz factor */ - const char * fnum = strtok(NULL, " \t\n"); + const char * fnum = (!strchr(" \t\n", s[2]) + ? s+2 : strtok(NULL, " \t\n")); char * end = NULL; + opt_F = (fnum ? strtol(fnum, &end, 10) : 0); if (! opt_F || *end) { rpmError(RPMERR_BADSPEC, @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org
[CVS] RPM: rpm/build/ parsePrep.c
RPM Package Manager, CVS Repository http://rpm5.org/cvs/ Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 18-Jun-2007 18:50:36 Branch: HEAD Handle: 2007061817503600 Modified files: rpm/build parsePrep.c Log: initialize variables. Summary: RevisionChanges Path 2.71+2 -1 rpm/build/parsePrep.c patch -p0 <<'@@ .' Index: rpm/build/parsePrep.c $ cvs diff -u -r2.70 -r2.71 parsePrep.c --- rpm/build/parsePrep.c 17 Jun 2007 16:32:13 - 2.70 +++ rpm/build/parsePrep.c 18 Jun 2007 16:50:36 - 2.71 @@ -133,6 +133,7 @@ const char *zipper; switch (compressed) { + default: case COMPRESSED_NOT:/* XXX can't happen */ case COMPRESSED_OTHER: case COMPRESSED_ZIP:/* XXX wrong */ @@ -463,7 +464,7 @@ int patch_index, x; memset(patch_nums, 0, sizeof(patch_nums)); -opt_P = opt_p = opt_R = opt_E = 0; +opt_P = opt_p = opt_R = opt_E = opt_F = 0; opt_b = NULL; patch_index = 0; @@ . __ RPM Package Managerhttp://rpm5.org CVS Sources Repositoryrpm-cvs@rpm5.org