RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson
Root: /v/rpm/cvs Email: jbj@rpm5.org
Module: rpm Date: 07-Feb-2008 21:11:09
Branch: HEAD Handle: 2008020720110801
Modified files:
rpm CHANGES
rpm/rpmio rpmio.c
rpm/tools Makefile.am
Log:
- jbj: install rpmcache in bindir, not pkglibdir.
- jbj: fix: Fopen: heh, I swear I had a rpmExpand() on fmode somewhen ...
Summary:
Revision Changes Path
1.2142 +2 -0 rpm/CHANGES
1.119 +21 -12 rpm/rpmio/rpmio.c
2.106 +2 -2 rpm/tools/Makefile.am
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/CHANGES
============================================================================
$ cvs diff -u -r1.2141 -r1.2142 CHANGES
--- rpm/CHANGES 7 Feb 2008 19:29:32 -0000 1.2141
+++ rpm/CHANGES 7 Feb 2008 20:11:08 -0000 1.2142
@@ -1,4 +1,6 @@
5.0.0 -> 5.1a1:
+ - jbj: install rpmcache in bindir, not pkglibdir.
+ - jbj: fix: Fopen: heh, I swear I had a rpmExpand() on fmode somewhen ...
- jbj: rpm.spec: nuke the xar.1 man page.
- jbj: rpmrpc: split stat(2) prints so valgrind can detect uninitialized.
- jbj: rpmcache: fix: don't check fo ".i386" suffix if name is too short.
@@ .
patch -p0 <<'@@ .'
Index: rpm/rpmio/rpmio.c
============================================================================
$ cvs diff -u -r1.118 -r1.119 rpmio.c
--- rpm/rpmio/rpmio.c 11 Jan 2008 23:05:34 -0000 1.118
+++ rpm/rpmio/rpmio.c 7 Feb 2008 20:11:09 -0000 1.119
@@ -3481,29 +3481,31 @@
/*@-refcounttrans -retalias@*/ return fd; /*@=refcounttrans =retalias@*/
}
-FD_t Fopen(const char *path, const char *fmode)
+FD_t Fopen(const char *path, const char *_fmode)
{
+ const char * fmode = rpmExpand(_fmode, NULL);
char stdio[20], other[20];
const char *end = NULL;
mode_t perms = 0666;
int flags = 0;
- FD_t fd;
+ FD_t fd = NULL;
if (path == NULL || fmode == NULL)
- return NULL;
+ goto exit;
stdio[0] = '\0';
cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, &flags);
if (stdio[0] == '\0')
- return NULL;
+ goto exit;
if (end == NULL || !strcmp(end, "fdio")) {
if (_rpmio_debug)
-fprintf(stderr, "*** Fopen fdio path %s fmode %s\n", path, fmode);
+fprintf(stderr, "*** Fopen(%s, %s) fdio\n", path, fmode);
fd = fdOpen(path, flags, perms);
if (fdFileno(fd) < 0) {
if (fd) (void) fdClose(fd);
- return NULL;
+ fd = NULL;
+ goto exit;
}
} else {
FILE *fp;
@@ -3523,15 +3525,20 @@
case URL_IS_FTP:
case URL_IS_UNKNOWN:
if (_rpmio_debug)
-fprintf(stderr, "*** Fopen ufdio path %s fmode %s\n", path, fmode);
+fprintf(stderr, "*** Fopen(%s, %s) ufdio\n", path, fmode);
fd = ufdOpen(path, flags, perms);
- if (fd == NULL || !(fdFileno(fd) >= 0 || fd->req != NULL))
- return fd;
+ if (fd == NULL || !(fdFileno(fd) >= 0 || fd->req != NULL)) {
+ if (fd) (void) fdClose(fd);
+ fd = NULL;
+ goto exit;
+ }
break;
default:
if (_rpmio_debug)
-fprintf(stderr, "*** Fopen WTFO path %s fmode %s\n", path, fmode);
- return NULL;
+fprintf(stderr, "*** Fopen(%s, %s) WTFO\n", path, fmode);
+ if (fd) (void) fdClose(fd);
+ fd = NULL;
+ goto exit;
/*@notreached@*/ break;
}
@@ -3541,12 +3548,14 @@
/*@+voidabstract@*/
fdPush(fd, fpio, fp, fileno(fp)); /* Push fpio onto stack */
/*@=voidabstract@*/
- return fd;
+ goto exit;
}
}
if (fd)
fd = Fdopen(fd, fmode);
+exit:
+ fmode = _free(fmode);
return fd;
}
@@ .
patch -p0 <<'@@ .'
Index: rpm/tools/Makefile.am
============================================================================
$ cvs diff -u -r2.105 -r2.106 Makefile.am
--- rpm/tools/Makefile.am 27 Dec 2007 10:30:54 -0000 2.105
+++ rpm/tools/Makefile.am 7 Feb 2008 20:11:09 -0000 2.106
@@ -23,10 +23,10 @@
$(top_builddir)/misc/librpmmisc.la \
@LTLIBINTL@
-bin_PROGRAMS = rpm2cpio
+bin_PROGRAMS = rpm2cpio rpmcache
pkglibdir = @USRLIBRPM@
-pkglib_PROGRAMS = rpmcache rpmcmp rpmdeps rpmdigest @WITH_LIBELF_DEBUGEDIT@
+pkglib_PROGRAMS = rpmcmp rpmdeps rpmdigest @WITH_LIBELF_DEBUGEDIT@
debugedit_SOURCES = debugedit.c hashtab.c
debugedit_LDADD = $(myLDADD)
@@ .
Received on Thu Feb 7 21:11:09 2008