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: 11-Sep-2014 20:46:20 Branch: rpm-5_4 Handle: 2014091118461901 Modified files: (Branch: rpm-5_4) rpm CHANGES rpm/rpmio macro.c Log: - rpmct: add %{copy foo bar:} embedding. Summary: Revision Changes Path 1.3501.2.438+1 -0 rpm/CHANGES 2.249.2.16 +32 -0 rpm/rpmio/macro.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.3501.2.437 -r1.3501.2.438 CHANGES --- rpm/CHANGES 10 Sep 2014 19:05:51 -0000 1.3501.2.437 +++ rpm/CHANGES 11 Sep 2014 18:46:19 -0000 1.3501.2.438 @@ -1,4 +1,5 @@ 5.4.15 -> 5.4.16: + - jbj: rpmct: add %{copy foo bar:} embedding. - jbj: rpmpopt: fix: escaped newline was fubar, grr. - jbj: lua: upgrade to lua-5.2.3. - jbj: rpmds: fix: off-by-1 comparison check parsing N.A compound. @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/macro.c ============================================================================ $ cvs diff -u -r2.249.2.15 -r2.249.2.16 macro.c --- rpm/rpmio/macro.c 5 Sep 2014 19:35:13 -0000 2.249.2.15 +++ rpm/rpmio/macro.c 11 Sep 2014 18:46:20 -0000 2.249.2.16 @@ -72,6 +72,7 @@ #define _RPMAUG_INTERNAL /* XXX for _rpmaugFoo globals */ #include <rpmaug.h> +#include <rpmct.h> #include <rpmficl.h> #include <rpmgit.h> #include <rpmjs.h> @@ -2312,6 +2313,7 @@ #endif #ifdef WITH_SQLITE + /* Embedded squirrel. */ if (STREQ("sql", f, fn)) { char ** av = NULL; char * script = parseEmbedded(s, (size_t)(se-s), &av); @@ -2340,6 +2342,7 @@ #endif #ifdef WITH_SQUIRREL + /* Embedded squirrel. */ if (STREQ("squirrel", f, fn)) { char ** av = NULL; char * script = parseEmbedded(s, (size_t)(se-s), &av); @@ -2368,6 +2371,7 @@ #endif #ifdef WITH_TCL + /* Embedded tcl. */ if (STREQ("tcl", f, fn)) { char ** av = NULL; char * script = parseEmbedded(s, (size_t)(se-s), &av); @@ -2392,6 +2396,34 @@ } #endif + /* Embedded cp(1) tree copy. */ + if (STREQ("cp", f, fn) || STREQ("copy", f, fn)) { + char ** av = NULL; + char * script = parseEmbedded(s, (size_t)(se-s), &av); + rpmct ct = rpmctNew(av, 0); /* XXX _globalI? */ + rpmRC ctrc = rpmctCopy(ct); /* XXX script as stdio? */ + + if (ctrc != RPMRC_OK) { + /* XXX return error message as result? */ + rc = 1; + } else { + /* XXX return script body as result? */ + if (script != NULL && *script != '\0') { + size_t len = strlen(script); + if (len > mb->nb) + len = mb->nb; + memcpy(mb->t, script, len); + mb->t += len; + mb->nb -= len; + } + } + ct = rpmctFree(ct); + av = _free(av); + script = _free(script); + s = se; + continue; + } + /* Rewrite "%patchNN ..." as "%patch -P NN ..." and expand. */ if (lastc && fn > 5 && STREQ("patch", f, 5) && xisdigit((int)f[5])) { /*@-internalglobs@*/ /* FIX: verbose may be set */ @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org