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\
84 const char * result = NULL;
90 str =
rpmExpand(pre,
"load(\"", fn,
"\");", NULL);
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);
114 order = memset(
alloca(i), 0, i);
119 sprintf(dstr,
"%d",
_debug);
122 "$loglvl = ", lstr,
";\n",
128 (void)
rpmrubyRun(NULL,
"puts \"loading RPM classes.\";", &result);
130 for (i = 0, tbl = classTable; i <
nclassTable; i++, tbl++) {
133 order[tbl->
ix & (norder - 1)] = i + 1;
134 if (tbl->
init != NULL)
135 (void) (*tbl->
init) ();
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 },
173 poptContext optCon =
rpmcliInit(argc, argv, optionsTable);
174 ARGV_t av = poptGetArgs(optCon);
179 if (!
_test && ac < 1) {
180 poptPrintUsage(optCon, stderr, 0);
192 while ((fn = *av++) != NULL) {