diff options
author | ewt <devnull@localhost> | 1997-08-21 01:20:16 +0000 |
---|---|---|
committer | ewt <devnull@localhost> | 1997-08-21 01:20:16 +0000 |
commit | b782a7d4aa0c7273ebade951d8292a5584a80114 (patch) | |
tree | 01276fda8bcc91a1ed7e40acd2660ead9eef53f6 | |
parent | a50bad6f038dd3965a7702ebeda77de79ed74bbe (diff) | |
download | rpm-b782a7d4aa0c7273ebade951d8292a5584a80114.tar.gz rpm-b782a7d4aa0c7273ebade951d8292a5584a80114.tar.bz2 rpm-b782a7d4aa0c7273ebade951d8292a5584a80114.zip |
1) rpm2cpio didn't handle zlib errors properly
2) query formats could yield (none)\n instead of just (none)
3) queries of fssizes w/o fsnames went bonkers
CVS patchset: 1787
CVS date: 1997/08/21 01:20:16
-rw-r--r-- | CHANGES | 2 | ||||
-rw-r--r-- | lib/formats.c | 11 | ||||
-rw-r--r-- | lib/fs.c | 6 | ||||
-rw-r--r-- | lib/header.c | 2 | ||||
-rw-r--r-- | lib/rpmlib.h | 2 | ||||
-rw-r--r-- | rpm2cpio.c | 2 |
6 files changed, 15 insertions, 10 deletions
@@ -33,6 +33,8 @@ under the LGPL - applied man page changes from Alex deVries - configure.in builds up LIBS by appending (Benedict Lofstedt) + - rpm2cpio reported wrong zlib error string + - removed \n from (none) generated by query format code 2.4.2 -> 2.4.3: - implemented install time prerequisites diff --git a/lib/formats.c b/lib/formats.c index 9d9784469..10a5a84c8 100644 --- a/lib/formats.c +++ b/lib/formats.c @@ -164,16 +164,13 @@ static int fsnamesTag(Header h, int_32 * type, void ** data, int_32 * count, char ** list; int i; - if (rpmGetFilesystemList(&list)) { + if (rpmGetFilesystemList(&list, count)) { return 1; } *type = RPM_STRING_ARRAY_TYPE; *((char ***) data) = list; - for (i = 0; list[i]; i++) ; - *count = i; - *freeData = 0; return 0; @@ -185,15 +182,19 @@ static int fssizesTag(Header h, int_32 * type, void ** data, int_32 * count, int_32 * filesizes; uint_32 * usages; int numFiles; + int i; headerGetEntry(h, RPMTAG_FILENAMES, NULL, (void **) &filenames, NULL); headerGetEntry(h, RPMTAG_FILESIZES, NULL, (void **) &filesizes, &numFiles); + if (rpmGetFilesystemList(NULL, count)) { + return 1; + } + if (rpmGetFilesystemUsage(filenames, filesizes, numFiles, &usages, 0)) return 1; *type = RPM_INT32_TYPE; - *count = 20; *freeData = 1; *data = usages; @@ -191,12 +191,14 @@ static int getFilesystemList(void) { } #endif -int rpmGetFilesystemList(char *** listptr) { +int rpmGetFilesystemList(char *** listptr, int * num) { if (!fsnames) if (getFilesystemList()) return 1; - *listptr = fsnames; + if (listptr) *listptr = fsnames; + if (num) *num = numFilesystems; + return 0; } diff --git a/lib/header.c b/lib/header.c index 12626840f..dd6f9c00e 100644 --- a/lib/header.c +++ b/lib/header.c @@ -1686,7 +1686,7 @@ static char * singleSprintf(Header h, struct sprintfToken * token, if (numElements == -1) { val = malloc(20); - strcpy(val, "(none)\n"); + strcpy(val, "(none)"); } else { alloced = numElements * token->u.array.numTokens * 20; val = malloc(alloced); diff --git a/lib/rpmlib.h b/lib/rpmlib.h index 108d32429..81d6800f3 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -458,7 +458,7 @@ void rpmFreeSignature(Header h); int rpmVerifySignature(char *file, int_32 sigTag, void *sig, int count, char *result); -int rpmGetFilesystemList(char *** listptr); +int rpmGetFilesystemList(char *** listptr, int * num); int rpmGetFilesystemUsage(char ** filelist, int_32 * fssizes, int numFiles, uint_32 ** usagesPtr, int flags); diff --git a/rpm2cpio.c b/rpm2cpio.c index a5ba3fef4..67b6c2295 100644 --- a/rpm2cpio.c +++ b/rpm2cpio.c @@ -59,7 +59,7 @@ int main(int argc, char **argv) gzclose(stream); return 1; } - fprintf (stderr, "rpm2cpio: zlib: %s error\n", zlib_err [-zerror]); + fprintf (stderr, "rpm2cpio: zlib: %s error\n", zlib_err [-zerror - 1]); } gzclose(stream); |