summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--isys/Makefile4
-rw-r--r--isys/cpio.c12
-rw-r--r--isys/cpio.h12
-rw-r--r--isys/isys.c6
-rw-r--r--isys/otherinsmod.c4
-rw-r--r--loader/Makefile2
-rw-r--r--loader/kickstart.c2
-rw-r--r--loader/lang.c20
-rw-r--r--loader/loader.c28
-rw-r--r--loader/net.c4
-rw-r--r--loader/popen.c2
-rw-r--r--loader/urls.c8
-rw-r--r--rpmmodule/Makefile4
-rw-r--r--rpmmodule/rpmmodule.c108
14 files changed, 117 insertions, 99 deletions
diff --git a/isys/Makefile b/isys/Makefile
index 5f042e567..56c76c1e6 100644
--- a/isys/Makefile
+++ b/isys/Makefile
@@ -1,8 +1,8 @@
include ../Makefile.inc
ARCH := $(patsubst i%86,i386,$(shell uname -m))
-ARCH := $(patsubst sparc%,sparc,$(ARCH))
-CFLAGS = -I/usr/include/python1.5 -I.. -g
+ARCH := $(patsubst sparc%,sparc,$(ARCH))
+CFLAGS = -I/usr/include/python1.5 -I.. -g -I/usr/include/rpm
OBJECTS = nfsmount.o dns.o mount_clnt.o mount_xdr.o imount.o \
smp.o moduleinfo.o devnodes.o cpio.o probe.o
STATICOBJS = otherinsmod.o
diff --git a/isys/cpio.c b/isys/cpio.c
index 06e41502f..87631d8f6 100644
--- a/isys/cpio.c
+++ b/isys/cpio.c
@@ -10,8 +10,8 @@
int installCpioFile(FD_t fd, char * cpioName, char * outName, int inWin) {
struct cpioFileMapping map;
int rc;
- char * failedFile;
- CFD_t cfdbuf, *cfd = &cfdbuf;
+ const char * failedFile;
+ FD_t cfd;
if (outName) {
map.archivePath = cpioName;
@@ -19,12 +19,12 @@ int installCpioFile(FD_t fd, char * cpioName, char * outName, int inWin) {
map.mapFlags = CPIO_MAP_PATH;
}
- cfd->cpioIoType = cpioIoTypeGzFd;
- cfd->cpioGzFd = gzdFdopen(fdDup(fdFileno(fd)), "r");
-
+ (void) Fflush(fd);
+ cfd = Fdopen(fdDup(Fileno(fd)), "r.gzdio");
+
rc = cpioInstallArchive(cfd, outName ? &map : NULL, 1, NULL, NULL,
&failedFile);
- gzdClose(cfd->cpioGzFd);
+ Fclose(cfd);
if (rc || access(outName, R_OK)) {
return -1;
diff --git a/isys/cpio.h b/isys/cpio.h
index 44301aee9..2ee92f1ce 100644
--- a/isys/cpio.h
+++ b/isys/cpio.h
@@ -3,7 +3,11 @@
#include <zlib.h>
#define HAVE_ZLIB_H 1
-#include <rpm/rpmio.h>
+#include <glob.h> /* XXX rpmlib.h */
+#include <dirent.h> /* XXX rpmlib.h */
+
+#define HAVE_LIBIO 1
+#include <rpmlib.h>
#define CPIO_MAP_PATH (1 << 0)
#define CPIO_MAP_MODE (1 << 1)
@@ -49,9 +53,9 @@ typedef struct CFD {
typedef void (*cpioCallback)(struct cpioCallbackInfo * filespec, void * data);
/* librpm provides these */
-int cpioInstallArchive(CFD_t *cfd, struct cpioFileMapping * mappings,
- int numMappings, cpioCallback cb, void * cbData,
- char ** failedFile);
+int cpioInstallArchive(FD_t cfd, struct cpioFileMapping * mappings,
+ int numMappings, cpioCallback cb, void * cbData,
+ const char ** failedFile);
const char *cpioStrerror(int rc);
int installCpioFile(FD_t fd, char * cpioName, char * outName, int inWin);
diff --git a/isys/isys.c b/isys/isys.c
index aa291a803..5f76d0a27 100644
--- a/isys/isys.c
+++ b/isys/isys.c
@@ -366,8 +366,8 @@ static PyObject * doGetOpt(PyObject * s, PyObject * pyargs) {
argv[i] = NULL;
- optCon = poptGetContext("", PyList_Size(argList), argv, options,
- POPT_CONTEXT_KEEP_FIRST);
+ optCon = poptGetContext("", PyList_Size(argList), (const char **) argv,
+ options, POPT_CONTEXT_KEEP_FIRST);
if ((rc = poptGetNextOpt(optCon)) < -1) {
i = strlen(poptBadOption(optCon, POPT_BADOPTION_NOALIAS)) +
@@ -725,7 +725,7 @@ static PyObject * doPoptParse(PyObject * s, PyObject * args) {
if (!PyArg_ParseTuple(args, "s", &str)) return NULL;
- if (poptParseArgvString(str, &argc, &argv)) {
+ if (poptParseArgvString(str, &argc, (const char ***) &argv)) {
PyErr_SetString(PyExc_ValueError, "bad string for parsing");
return NULL;
}
diff --git a/isys/otherinsmod.c b/isys/otherinsmod.c
index 814d60286..256fbc19c 100644
--- a/isys/otherinsmod.c
+++ b/isys/otherinsmod.c
@@ -56,8 +56,8 @@ int ourInsmodCommand(int argc, char ** argv) {
/* Try two balls on sparc64, one elsewhere */
for (i = 0; ; i++) {
/* it might be having a ball */
- fd = fdOpen(ballPath, O_RDONLY, 0);
- if (fdFileno(fd) < 0) {
+ fd = Fopen(ballPath, "r.fdio");
+ if (!fd || Ferror(fd)) {
free(ballPath);
return 1;
}
diff --git a/loader/Makefile b/loader/Makefile
index d5cc4f4aa..bf44d4a89 100644
--- a/loader/Makefile
+++ b/loader/Makefile
@@ -18,7 +18,7 @@ endif
PCMCIAOBJS = pcmcia.o $(NETOBJS)
OPTS = -O2 -g
-CFLAGS = $(DEBUG) $(OPTS) -Wall -D_GNU_SOURCE=1 -I/usr/include/rpm -I.. -DUSE_ALT_DNS=1 -DVERSION='"$(VERSION)"'
+CFLAGS = $(DEBUG) $(OPTS) -Wall -D_GNU_SOURCE=1 -I/usr/include/rpm -I.. -DUSE_ALT_DNS=1 -DVERSION='"$(VERSION)"' -DHAVE_LIBIO_H
ALLOBJS = $(OBJS) $(PCMCIAOBJS)
diff --git a/loader/kickstart.c b/loader/kickstart.c
index 7daa0d445..4a13ae550 100644
--- a/loader/kickstart.c
+++ b/loader/kickstart.c
@@ -103,7 +103,7 @@ int ksReadCommands(char * cmdFile) {
} else if (!strcmp(start, "%packages")) {
inPackages = 1;
} else {
- if (poptParseArgvString(start, &argc, &argv) || !argc) {
+ if (poptParseArgvString(start, &argc, (const char ***) &argv) || !argc) {
newtWinMessage(_("Kickstart Error"), _("OK"),
_("Error on line %d of kickstart file %s."),
argv[0], line, cmdFile);
diff --git a/loader/lang.c b/loader/lang.c
index a1c005e78..d9484a3bc 100644
--- a/loader/lang.c
+++ b/loader/lang.c
@@ -10,6 +10,10 @@
#include <sys/ioctl.h>
#include <unistd.h>
#include <zlib.h>
+
+#include <glob.h> /* XXX rpmlib.h */
+#include <dirent.h> /* XXX rpmlib.h */
+
#include <rpm/rpmio.h>
#include <linux/keyboard.h>
#include <linux/kd.h>
@@ -121,18 +125,18 @@ void loadLanguage (char * file, int flags) {
sprintf(filename, "/etc/loader.tr");
}
- stream = fdOpen(file, O_RDONLY, 0644);
+ stream = Fopen (file, "r.fdio");
- if (fdFileno(stream) < 0) {
+ if (!stream || Ferror (stream)) {
newtWinMessage("Error", "OK", "Cannot open %s: %s. Installation will "
- "proceed in English.", file, strerror(errno));
+ "proceed in English.", file, Fstrerror(stream));
return ;
}
sprintf(filename, "%s.tr", key);
rc = installCpioFile(stream, filename, "/tmp/translation", 1);
- fdClose(stream);
+ Fclose(stream);
if (rc || access("/tmp/translation", R_OK)) {
newtWinMessage("Error", "OK", "Cannot get translation file %s.\n",
@@ -181,15 +185,15 @@ static int loadFont(char * fontFile, int flags) {
#if 0
if (!FL_TESTING(flags)) {
#endif
- stream = fdOpen("/etc/fonts.cgz", O_RDONLY, 0644);
- if (fdFileno(stream) < 0) {
+ stream = Fopen("/etc/fonts.cgz", "r.fdio");
+ if (!stream || Ferror (stream)) {
newtWinMessage("Error", "OK",
- "Cannot open fonts: %s", strerror(errno));
+ "Cannot open fonts: %s", Fstrerror(stream));
return LOADER_ERROR;
}
rc = installCpioFile(stream, fontFile, "/tmp/font", 1);
- fdClose(stream);
+ Fclose(stream);
if (rc || access("/tmp/font", R_OK)) {
return LOADER_ERROR;
}
diff --git a/loader/loader.c b/loader/loader.c
index 9740a76db..c24ae9ceb 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -28,6 +28,10 @@
#include <net/if.h>
#include <newt.h>
#include <popt.h>
+
+#include <glob.h> /* XXX rpmlib.h */
+#include <dirent.h> /* XXX rpmlib.h */
+
#include <rpmio.h>
#include <stdlib.h>
#include <string.h>
@@ -960,7 +964,7 @@ static char * mountUrlImage(struct installMethod * method,
fd = urlinstStartTransfer(&ui, "base/stage2.img");
- if (fd == NULL || fdFileno(fd) < 0) {
+ if (fd == NULL || Ferror(fd)) {
newtPopWindow();
snprintf(buf, sizeof(buf), "%s/RedHat/base/stage2.img",
ui.urlprefix);
@@ -971,7 +975,7 @@ static char * mountUrlImage(struct installMethod * method,
break;
}
- rc = loadStage2Ramdisk(fdFileno(fd), 0, flags);
+ rc = loadStage2Ramdisk(Fileno(fd), 0, flags);
urlinstFinishTransfer(fd);
if (!rc)
stage = URL_STAGE_DONE;
@@ -1150,7 +1154,7 @@ static int kickstartDevices(struct knownDevices * kd, moduleInfoSet modInfo,
};
if (!ksGetCommand(KS_CMD_DRIVERDISK, NULL, &ksArgc, &ksArgv)) {
- optCon = poptGetContext(NULL, ksArgc, ksArgv, diskTable, 0);
+ optCon = poptGetContext(NULL, ksArgc, (const char **) ksArgv, diskTable, 0);
do {
if ((rc = poptGetNextOpt(optCon)) < -1) {
@@ -1161,7 +1165,7 @@ static int kickstartDevices(struct knownDevices * kd, moduleInfoSet modInfo,
break;
}
- fs = poptGetArg(optCon);
+ fs = (char *) poptGetArg(optCon);
if (!fs || poptGetArg(optCon)) {
logMessage("bad arguments to kickstart driverdisk command");
@@ -1193,7 +1197,7 @@ static int kickstartDevices(struct knownDevices * kd, moduleInfoSet modInfo,
while (!ksGetCommand(KS_CMD_DEVICE, ksArgv, &ksArgc, &ksArgv)) {
opts = NULL;
- optCon = poptGetContext(NULL, ksArgc, ksArgv, table, 0);
+ optCon = poptGetContext(NULL, ksArgc, (const char **) ksArgv, table, 0);
if ((rc = poptGetNextOpt(optCon)) < -1) {
logMessage("bad argument to kickstart device command %s: %s",
@@ -1202,8 +1206,8 @@ static int kickstartDevices(struct knownDevices * kd, moduleInfoSet modInfo,
continue;
}
- type = poptGetArg(optCon);
- device = poptGetArg(optCon);
+ type = (char *) poptGetArg(optCon);
+ device = (char *) poptGetArg(optCon);
if (!type || !device || poptGetArg(optCon)) {
logMessage("bad arguments to kickstart device command");
@@ -1217,7 +1221,7 @@ static int kickstartDevices(struct knownDevices * kd, moduleInfoSet modInfo,
}
if (opts)
- poptParseArgvString(opts, &rc, &optv);
+ poptParseArgvString(opts, &rc, (const char ***) &optv);
else
optv = NULL;
@@ -1332,7 +1336,7 @@ static char * setupKickstart(char * location, struct knownDevices * kd,
if (table) {
ksGetCommand(ksType, NULL, &ksArgc, &ksArgv);
- optCon = poptGetContext(NULL, ksArgc, ksArgv, table, 0);
+ optCon = poptGetContext(NULL, ksArgc, (const char **) ksArgv, table, 0);
if ((rc = poptGetNextOpt(optCon)) < -1) {
logMessage("bad argument to kickstart method command %s: %s",
@@ -1447,7 +1451,7 @@ static int parseCmdLineFlags(int flags, char * cmdLine, char ** ksSource) {
cmdLine = buf;
}
- if (poptParseArgvString(cmdLine, &argc, &argv)) return flags;
+ if (poptParseArgvString(cmdLine, &argc, (const char ***) &argv)) return flags;
for (i = 0; i < argc; i++) {
if (!strcasecmp(argv[i], "expert"))
@@ -1842,7 +1846,7 @@ int main(int argc, char ** argv) {
flags |= LOADER_FLAGS_SERIAL;
}
- optCon = poptGetContext(NULL, argc, argv, optionTable, 0);
+ optCon = poptGetContext(NULL, argc, (const char **) argv, optionTable, 0);
if ((rc = poptGetNextOpt(optCon)) < -1) {
fprintf(stderr, "bad option %s: %s\n",
@@ -1851,7 +1855,7 @@ int main(int argc, char ** argv) {
exit(1);
}
- if ((arg = poptGetArg(optCon))) {
+ if ((arg = (char *) poptGetArg(optCon))) {
fprintf(stderr, "unexpected argument: %s\n", arg);
exit(1);
}
diff --git a/loader/net.c b/loader/net.c
index a41f1eb1e..8c4534bb5 100644
--- a/loader/net.c
+++ b/loader/net.c
@@ -516,12 +516,12 @@ int kickstartNetwork(char * device, struct networkDeviceConfig * netDev,
ksArgc = 1;
}
- optCon = poptGetContext(NULL, ksArgc, ksArgv, ksOptions, 0);
+ optCon = poptGetContext(NULL, ksArgc, (const char **) ksArgv, ksOptions, 0);
while ((rc = poptGetNextOpt(optCon)) >= 0) {
parseAddress = NULL;
netSet = 0;
- arg = poptGetOptArg(optCon);
+ arg = (char *) poptGetOptArg(optCon);
switch (rc) {
case 'g':
diff --git a/loader/popen.c b/loader/popen.c
index 21edc3c0e..75a15031f 100644
--- a/loader/popen.c
+++ b/loader/popen.c
@@ -24,7 +24,7 @@ FILE * popen(const char * command, const char * type) {
if (strcmp(type, "r") || lastRequest.f)
return NULL;
- if (poptParseArgvString(command, &argc, &argv)) {
+ if (poptParseArgvString(command, &argc, (const char ***) &argv)) {
return NULL;
}
diff --git a/loader/urls.c b/loader/urls.c
index 5c991bc6c..d8908970e 100644
--- a/loader/urls.c
+++ b/loader/urls.c
@@ -3,6 +3,10 @@
#include <fcntl.h>
#include <netinet/in.h>
#include <newt.h>
+
+#include <glob.h> /* XXX rpmlib.h */
+#include <dirent.h> /* XXX rpmlib.h */
+
#include <rpmio.h>
#include <rpmlib.h>
#include <rpmurl.h>
@@ -72,7 +76,7 @@ FD_t urlinstStartTransfer(struct iurlinfo * ui, char * filename) {
strcpy(buf, ui->urlprefix);
strcat(buf, "/RedHat/");
strcat(buf, filename);
- fd = ufdOpen(buf, O_RDONLY, 600);
+ fd = Fopen(buf, "r.ufdio");
return fd;
}
@@ -102,7 +106,7 @@ char * addrToIp(char * hostname) {
int urlMainSetupPanel(struct iurlinfo * ui, urlprotocol protocol,
char * doSecondarySetup) {
newtComponent form, okay, cancel, siteEntry, dirEntry;
- newtComponent answer, text, cb = NULL;
+ newtComponent answer, text;
char * site, * dir;
char * reflowedText = NULL;
int width, height, len;
diff --git a/rpmmodule/Makefile b/rpmmodule/Makefile
index b1125ac6d..43e79c827 100644
--- a/rpmmodule/Makefile
+++ b/rpmmodule/Makefile
@@ -1,4 +1,4 @@
-#
+
# Makefile for the RPM bindigs for python
#
# $Id$
@@ -10,7 +10,7 @@ PYTHON = $(DESTDIR)/$(PYTHONLIBDIR)
CC = gcc
INCLUDES = -I/usr/include/rpm -I/usr/include/python1.5
-CFLAGS = -Wall -fPIC -g $(INCLUDES)
+CFLAGS = -Wall -fPIC -g -DHAVE_LIBIO $(INCLUDES)
LIBS = -lrpm -lbz2 -lz -ldb1
LDFLAGS = -shared -Wl,-soname,$(TARGET) $(LIBS)
diff --git a/rpmmodule/rpmmodule.c b/rpmmodule/rpmmodule.c
index d2e3631b7..4265b8a6e 100644
--- a/rpmmodule/rpmmodule.c
+++ b/rpmmodule/rpmmodule.c
@@ -4,6 +4,8 @@
#include <sys/stat.h>
#include <sys/time.h>
#include <unistd.h>
+#include <glob.h> /* XXX rpmio.h */
+#include <dirent.h> /* XXX rpmio.h */
#include "Python.h"
#include "rpmlib.h"
@@ -60,7 +62,7 @@ static PyObject * rpmtransRun(rpmtransObject * s, PyObject * args);
static PyObject * rpmtransOrder(rpmtransObject * s, PyObject * args);
static void rpmtransDealloc(PyObject * o);
static PyObject * rpmtransGetAttr(rpmtransObject * o, char * name);
-static int rpmtransSetAttr(rpmtransObject * o, char * name,
+static int rpmtransSetAttr(rpmtransObject * o, char * name,
PyObject * val);
/* Types */
@@ -74,7 +76,7 @@ static PyMethodDef rpmModuleMethods[] = {
{ "headerLoad", (PyCFunction) hdrLoad, METH_VARARGS, NULL },
{ "opendb", (PyCFunction) rpmOpenDB, METH_VARARGS, NULL },
{ "rebuilddb", (PyCFunction) rebuildDB, METH_VARARGS, NULL },
- { "readHeaderListFromFD", (PyCFunction) rpmHeaderFromFD, METH_VARARGS, NULL },
+ { "readHeaderListFromFD", (PyCFunction) rpmHeaderFromFD, METH_VARARGS, NULL },
{ "readHeaderListFromFile", (PyCFunction) rpmHeaderFromFile, METH_VARARGS, NULL },
{ "errorSetCallback", (PyCFunction) errorSetCallback, METH_VARARGS, NULL },
{ "errorString", (PyCFunction) errorString, METH_VARARGS, NULL },
@@ -202,7 +204,7 @@ static struct PyMethodDef hdrMethods[] = {
/* External functions */
int mdfile(const char *fn, unsigned char *digest);
-
+
/* Code */
void initrpm(void) {
@@ -228,22 +230,22 @@ void initrpm(void) {
PyDict_SetItemString(d, "tagnames", dict);
- PyDict_SetItemString(d, "RPMFILE_STATE_NORMAL",
+ PyDict_SetItemString(d, "RPMFILE_STATE_NORMAL",
PyInt_FromLong(RPMFILE_STATE_NORMAL));
- PyDict_SetItemString(d, "RPMFILE_STATE_REPLACED",
+ PyDict_SetItemString(d, "RPMFILE_STATE_REPLACED",
PyInt_FromLong(RPMFILE_STATE_REPLACED));
- PyDict_SetItemString(d, "RPMFILE_STATE_NOTINSTALLED",
+ PyDict_SetItemString(d, "RPMFILE_STATE_NOTINSTALLED",
PyInt_FromLong(RPMFILE_STATE_NOTINSTALLED));
- PyDict_SetItemString(d, "RPMFILE_CONFIG",
+ PyDict_SetItemString(d, "RPMFILE_CONFIG",
PyInt_FromLong(RPMFILE_CONFIG));
PyDict_SetItemString(d, "RPMFILE_MISSINGOK",
PyInt_FromLong(RPMFILE_MISSINGOK));
- PyDict_SetItemString(d, "RPMFILE_DOC",
+ PyDict_SetItemString(d, "RPMFILE_DOC",
PyInt_FromLong(RPMFILE_DOC));
- PyDict_SetItemString(d, "RPMDEP_SENSE_REQUIRES",
+ PyDict_SetItemString(d, "RPMDEP_SENSE_REQUIRES",
PyInt_FromLong(RPMDEP_SENSE_REQUIRES));
- PyDict_SetItemString(d, "RPMDEP_SENSE_CONFLICTS",
+ PyDict_SetItemString(d, "RPMDEP_SENSE_CONFLICTS",
PyInt_FromLong(RPMDEP_SENSE_CONFLICTS));
PyDict_SetItemString(d, "RPMSENSE_SERIAL",
@@ -421,12 +423,12 @@ static PyObject * findUpgradeSet(PyObject * self, PyObject * args) {
list.packages[i]->selected = 0;
list.packages[i]->data = hdr;
- headerGetEntry(hdr->h, RPMTAG_NAME, NULL,
+ headerGetEntry(hdr->h, RPMTAG_NAME, NULL,
(void **) &list.packages[i]->name, NULL);
}
pkgSort (&list);
-
+
if (ugFindUpgradePackages(&list, root)) {
PyErr_SetString(pyrpmError, "error during upgrade check");
return NULL;
@@ -457,7 +459,7 @@ static rpmdbObject * rpmOpenDB(PyObject * self, PyObject * args) {
char * errmsg = "cannot open database in %s";
char * errstr = NULL;
int errsize;
-
+
Py_DECREF(o);
/* PyErr_SetString should take varargs... */
errsize = strlen(errmsg) + *root == '\0' ? 15 /* "/var/lib/rpm" */ : strlen(root);
@@ -518,12 +520,12 @@ static PyObject * rpmHeaderFromFD(PyObject * self, PyObject * args) {
FD_t fd;
int fileno;
PyObject * list;
-
+
if (!PyArg_ParseTuple(args, "i", &fileno)) return NULL;
fd = fdDup(fileno);
-
+
list = rpmReadHeaders (fd);
- fdClose(fd);
+ Fclose(fd);
return list;
}
@@ -548,7 +550,7 @@ static PyObject * hdrLoad(PyObject * self, PyObject * args) {
h->fileList = h->linkList = h->md5list = NULL;
h->uids = h->gids = h->mtimes = h->fileSizes = NULL;
h->modes = h->rdevs = NULL;
-
+
return (PyObject *) h;
}
@@ -558,7 +560,7 @@ static PyObject * rpmHeaderFromFile(PyObject * self, PyObject * args) {
PyObject * list;
if (!PyArg_ParseTuple(args, "s", &filespec)) return NULL;
- fd = fdOpen(filespec, O_RDONLY, 0);
+ fd = Fopen(filespec, "r.fdio");
if (!fd) {
PyErr_SetFromErrno(pyrpmError);
@@ -566,8 +568,8 @@ static PyObject * rpmHeaderFromFile(PyObject * self, PyObject * args) {
}
list = rpmReadHeaders (fd);
- fdClose(fd);
-
+ Fclose(fd);
+
return list;
}
@@ -577,7 +579,7 @@ static void errorcb (void)
{
PyObject * result, * args = NULL;
- if (errorData)
+ if (errorData)
args = Py_BuildValue("(O)", errorData);
result = PyEval_CallObject(errorCB, args);
@@ -602,15 +604,15 @@ static PyObject * errorSetCallback (PyObject * self, PyObject * args) {
}
if (!PyArg_ParseTuple(args, "O|O", &errorCB, &errorData)) return NULL;
-
+
if (!PyCallable_Check (errorCB)) {
PyErr_SetString(PyExc_TypeError, "parameter must be callable");
return NULL;
- }
+ }
Py_INCREF (errorCB);
Py_XINCREF (errorData);
-
+
rpmErrorSetCallback (errorcb);
Py_INCREF(Py_None);
@@ -623,7 +625,7 @@ static PyObject * errorString (PyObject * self, PyObject * args) {
static PyObject * versionCompare (PyObject * self, PyObject * args) {
hdrObject * h1, * h2;
-
+
if (!PyArg_ParseTuple(args, "O!O!", &hdrType, &h1, &hdrType, &h2)) return NULL;
return Py_BuildValue("i", rpmVersionCompare(h1->h, h2->h));
@@ -639,7 +641,7 @@ static PyObject * labelCompare (PyObject * self, PyObject * args) {
if (e1 && !e2)
return Py_BuildValue("i", 1);
- else if (!e1 && e2)
+ else if (!e1 && e2)
return Py_BuildValue("i", -1);
else if (e1 && e2) {
int ep1, ep2;
@@ -650,7 +652,7 @@ static PyObject * labelCompare (PyObject * self, PyObject * args) {
else if (ep1 > ep2)
return Py_BuildValue("i", 1);
}
-
+
rc = rpmvercmp(v1, v2);
if (rc)
return Py_BuildValue("i", rc);
@@ -670,7 +672,7 @@ static PyObject * rpmHeaderFromPackage(PyObject * self, PyObject * args) {
fd = fdDup(rawFd);
rc = rpmReadPackageHeader(fd, &header, &isSource, NULL, NULL);
- fdClose(fd);
+ Fclose(fd);
switch (rc) {
case 0:
@@ -808,7 +810,7 @@ static int rpmdbLength(rpmdbObject * s) {
static hdrObject * rpmdbSubscript(rpmdbObject * s, PyObject * key) {
int offset;
hdrObject * h;
-
+
if (!PyInt_Check(key)) {
PyErr_SetString(PyExc_TypeError, "integer expected");
return NULL;
@@ -827,7 +829,7 @@ static hdrObject * rpmdbSubscript(rpmdbObject * s, PyObject * key) {
PyErr_SetString(pyrpmError, "cannot read rpmdb entry");
return NULL;
}
-
+
return h;
}
@@ -872,7 +874,7 @@ static PyObject * hdrSubscript(hdrObject * s, PyObject * item) {
}
switch (tag) {
- case RPMTAG_FILENAMES:
+ case RPMTAG_OLDFILENAMES:
case RPMTAG_FILESIZES:
case RPMTAG_FILESTATES:
case RPMTAG_FILEMODES:
@@ -952,7 +954,7 @@ static PyObject * hdrSubscript(hdrObject * s, PyObject * item) {
case RPM_STRING_TYPE:
if (count != 1 || forceArray) {
stringArray = data;
-
+
metao = PyList_New(0);
for (i=0; i < count; i++) {
o = PyString_FromString(stringArray[i]);
@@ -1009,7 +1011,7 @@ static PyObject * hdrUnload(hdrObject * s, PyObject * args) {
len = headerSizeof(s->h, 0);
buf = headerUnload(s->h);
-
+
rc = PyString_FromStringAndSize(buf, len);
free(buf);
@@ -1050,7 +1052,7 @@ static PyObject * hdrVerifyFile(hdrObject * s, PyObject * args) {
if (!verifyResult) return list;
if (!s->fileList) {
- headerGetEntry(s->h, RPMTAG_FILENAMES, &type, (void **) &s->fileList,
+ headerGetEntry(s->h, RPMTAG_OLDFILENAMES, &type, (void **) &s->fileList,
&count);
}
@@ -1058,14 +1060,14 @@ static PyObject * hdrVerifyFile(hdrObject * s, PyObject * args) {
if (verifyResult & RPMVERIFY_MD5) {
if (!s->md5list) {
- headerGetEntry(s->h, RPMTAG_FILEMD5S, &type, (void **) &s->md5list,
+ headerGetEntry(s->h, RPMTAG_FILEMD5S, &type, (void **) &s->md5list,
&count);
}
-
+
if (mdfile(s->fileList[fileNumber], buf)) {
strcpy(buf, "(unknown)");
- }
-
+ }
+
tuple = PyTuple_New(3);
attrName = PyString_FromString("checksum");
PyTuple_SetItem(tuple, 0, attrName);
@@ -1076,7 +1078,7 @@ static PyObject * hdrVerifyFile(hdrObject * s, PyObject * args) {
if (verifyResult & RPMVERIFY_FILESIZE) {
if (!s->fileSizes) {
- headerGetEntry(s->h, RPMTAG_FILESIZES, &type, (void **) &s->fileSizes,
+ headerGetEntry(s->h, RPMTAG_FILESIZES, &type, (void **) &s->fileSizes,
&count);
}
@@ -1094,7 +1096,7 @@ static PyObject * hdrVerifyFile(hdrObject * s, PyObject * args) {
if (verifyResult & RPMVERIFY_LINKTO) {
if (!s->linkList) {
- headerGetEntry(s->h, RPMTAG_FILELINKTOS, &type, (void **) &s->linkList,
+ headerGetEntry(s->h, RPMTAG_FILELINKTOS, &type, (void **) &s->linkList,
&count);
}
@@ -1114,7 +1116,7 @@ static PyObject * hdrVerifyFile(hdrObject * s, PyObject * args) {
if (verifyResult & RPMVERIFY_MTIME) {
if (!s->mtimes) {
- headerGetEntry(s->h, RPMTAG_FILEMTIMES, &type, (void **) &s->mtimes,
+ headerGetEntry(s->h, RPMTAG_FILEMTIMES, &type, (void **) &s->mtimes,
&count);
}
@@ -1138,7 +1140,7 @@ static PyObject * hdrVerifyFile(hdrObject * s, PyObject * args) {
if (verifyResult & RPMVERIFY_RDEV) {
if (!s->rdevs) {
- headerGetEntry(s->h, RPMTAG_FILERDEVS, &type, (void **) &s->rdevs,
+ headerGetEntry(s->h, RPMTAG_FILERDEVS, &type, (void **) &s->rdevs,
&count);
}
@@ -1157,7 +1159,7 @@ static PyObject * hdrVerifyFile(hdrObject * s, PyObject * args) {
doesn't do these correctly either. At least this is consisten */
if (verifyResult & RPMVERIFY_USER) {
if (!s->uids) {
- headerGetEntry(s->h, RPMTAG_FILEUIDS, &type, (void **) &s->uids,
+ headerGetEntry(s->h, RPMTAG_FILEUIDS, &type, (void **) &s->uids,
&count);
}
@@ -1173,7 +1175,7 @@ static PyObject * hdrVerifyFile(hdrObject * s, PyObject * args) {
if (verifyResult & RPMVERIFY_GROUP) {
if (!s->gids) {
- headerGetEntry(s->h, RPMTAG_FILEGIDS, &type, (void **) &s->gids,
+ headerGetEntry(s->h, RPMTAG_FILEGIDS, &type, (void **) &s->gids,
&count);
}
@@ -1189,7 +1191,7 @@ static PyObject * hdrVerifyFile(hdrObject * s, PyObject * args) {
if (verifyResult & RPMVERIFY_MODE) {
if (!s->modes) {
- headerGetEntry(s->h, RPMTAG_FILEMODES, &type, (void **) &s->modes,
+ headerGetEntry(s->h, RPMTAG_FILEMODES, &type, (void **) &s->modes,
&count);
}
@@ -1235,7 +1237,7 @@ static void rpmtransDealloc(PyObject * o) {
if (trans->dbo) {
Py_DECREF(trans->dbo);
}
- if (trans->scriptFd) fdClose(trans->scriptFd);
+ if (trans->scriptFd) Fclose(trans->scriptFd);
/* this will free the keyList, and decrement the ref count of all
the items on the list as well :-) */
Py_DECREF(trans->keyList);
@@ -1318,10 +1320,10 @@ static PyObject * rpmtransDepCheck(rpmtransObject * s, PyObject * args) {
list = PyList_New(0);
for (i = 0; i < numConflicts; i++) {
- cf = Py_BuildValue("((sss)(ss)iOi)", conflicts[i].byName,
+ cf = Py_BuildValue("((sss)(ss)iOi)", conflicts[i].byName,
conflicts[i].byVersion, conflicts[i].byRelease,
- conflicts[i].needsName,
+ conflicts[i].needsName,
conflicts[i].needsVersion,
conflicts[i].needsFlags,
@@ -1347,7 +1349,7 @@ struct tsCallbackType {
int pythonError;
};
-static void * tsCallback(const Header h, const rpmCallbackType what,
+static void * tsCallback(const Header h, const rpmCallbackType what,
const unsigned long amount, const unsigned long total,
const void * pkgKey, void * data) {
struct tsCallbackType * cbInfo = data;
@@ -1379,7 +1381,7 @@ static void * tsCallback(const Header h, const rpmCallbackType what,
}
if (what == RPMCALLBACK_INST_CLOSE_FILE) {
- fdClose (fdt);
+ Fclose (fdt);
}
Py_DECREF(result);
@@ -1395,16 +1397,16 @@ static PyObject * rpmtransRun(rpmtransObject * s, PyObject * args) {
struct tsCallbackType cbInfo;
if (!PyArg_ParseTuple(args, "iiOO", &flags, &ignoreSet, &cbInfo.cb,
- &cbInfo.data))
+ &cbInfo.data))
return NULL;
cbInfo.pythonError = 0;
- rc = rpmRunTransactions(s->ts, tsCallback, &cbInfo, NULL, &probs, flags,
+ rc = rpmRunTransactions(s->ts, tsCallback, &cbInfo, NULL, &probs, flags,
ignoreSet);
if (cbInfo.pythonError) {
- if (rc > 0)
+ if (rc > 0)
rpmProblemSetFree(probs);
return NULL;
}