6 #define _RPMRUBY_INTERNAL
66 def ack(cmd, expected)\n\
70 print(\"NACK: ack(\"+cmd.to_s+\")\tcaught '\"+\"#{$!}\"+\"'\n\")\n\
73 if (actual != expected && expected != nil)\n\
74 print(\"NACK: ack(\"+cmd.to_s+\")\tgot '\"+actual.to_s+\"' not '\"+expected.to_s+\"'\n\")\n\
76 print(\" ack(\"+cmd.to_s+\")\tgot '\"+actual.to_s+\"'\n\")\n\
92 fprintf(stderr,
"\trunning:%s%s\n", (*pre ?
"\n" :
" "), str);
95 if (result !=
NULL && *result !=
'\0')
96 fprintf(stdout,
"%s\n", result);
104 const char * pre =
NULL;
113 i = norder *
sizeof(*order);
122 "$loglvl = ", lstr,
";\n",
130 for (i = 0, tbl = classTable; i <
nclassTable; i++, tbl++) {
133 order[tbl->
ix & (norder - 1)] = i + 1;
139 for (i = 0; i < norder; i++) {
146 tbl = &classTable[
ix];
148 if (
Stat(fn, &sb) == 0) {
160 {
"debug",
'd', POPT_ARG_VAL, &
_debug, -1,
NULL, NULL },
161 {
"test",
't', POPT_ARG_VAL, &
_test, -1,
NULL, NULL },
164 N_(
"Common options for all rpm executables:"),
NULL },
179 if (!
_test && ac < 1) {
180 poptPrintUsage(optCon, stderr, 0);
192 while ((fn = *av++) !=
NULL) {
202 optCon = rpmcliFini(optCon);
struct rpmrbClassTable_s * rpmrbClassTable
char * rpmGetPath(const char *path,...)
Return (malloc'ed) expanded, canonicalized, file path.
int main(int argc, const char **argv, char **envp)
int Stat(const char *path, struct stat *st)
stat(2) clone.
static size_t nclassTable
sprintf(t," (%u)",(unsigned) dig->nbytes)
enum rpmRC_e rpmRC
RPM return codes.
static const char tscripts[]
memset(_r, 0, sizeof(*_r))
fprintf(stderr,"--> %s(%p,%p,%p) sig %p sigp %p\n", __FUNCTION__, dig, t, rsactx, sig, sigp)
int _rpmruby_debug
Triggers printing of debugging information.
int argvCount(const ARGV_t argv)
Return no.
void Init_rpm(void)
Defines the "RPM" Ruby module and makes it known to the Interpreter.
Ruby bindings to the RPM Transaction Set API.
static void rpmrbLoadClasses(void)
static struct poptOption optionsTable[]
static rpmRC rpmrbLoadFile(rpmruby rb, const char *pre, const char *fn)
char * rpmExpand(const char *arg,...)
Return (malloc'ed) concatenated macro expansion(s).
Embedded Ruby interpreter.
struct rpmruby_s * rpmruby
RPM Ruby bindings "RPM" module.
struct poptOption rpmcliAllPoptTable[]
Popt option table for options shared by all modes and executables.
static struct rpmrbClassTable_s classTable[]
static void
Print copy of spec file, filling in Group/Description/Summary from specspo.
rpmRC rpmrubyRun(rpmruby ruby, const char *str, const char **resultp)
Evaluates Ruby code stored in a string.
Ruby bindings to RPM's macro context facility.
static void * _free(const void *p)
Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
_rpmrubyI
Current (global) interpreter instance.
static const char * _acknack