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
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;
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;
}
#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;
}
if (numElements == -1) {
val = malloc(20);
- strcpy(val, "(none)\n");
+ strcpy(val, "(none)");
} else {
alloced = numElements * token->u.array.numTokens * 20;
val = malloc(alloced);
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);
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);