Package pkg, int installSpecialDoc, int test)
{
struct FileList_s fl;
- char *s, **fp;
- ARGV_t files = NULL;
const char *fileName;
char buf[BUFSIZ];
struct AttrRec_s arbuf;
if (pkg->fileFile) {
char *ffn;
- ARGV_t filelists = NULL;
FILE *fd;
- argvSplit(&filelists, getStringBuf(pkg->fileFile), "\n");
- for (fp = filelists; *fp != NULL; fp++) {
+ for (ARGV_const_t fp = pkg->fileFile; *fp != NULL; fp++) {
if (**fp == '/') {
ffn = rpmGetPath(*fp, NULL);
} else {
fclose(fd);
return RPMRC_FAIL;
}
- appendStringBuf(pkg->fileList, buf);
+ argvAdd(&(pkg->fileList), buf);
}
(void) fclose(fd);
}
- argvFree(filelists);
}
/* Init the file list structure */
fl.fileListRecsAlloced = 0;
fl.fileListRecsUsed = 0;
- s = getStringBuf(pkg->fileList);
- argvSplit(&files, s, "\n");
-
- for (fp = files; *fp != NULL; fp++) {
- s = *fp;
+ for (ARGV_const_t fp = pkg->fileList; *fp != NULL; fp++) {
+ const char *s = *fp;
SKIPSPACE(s);
if (*s == '\0')
continue;
specialDoc = _free(specialDoc);
}
- argvFree(files);
-
if (fl.processingFailed)
goto exit;
for (arg=1; arg<argc; arg++) {
if (rstreq(argv[arg], "-f") && argv[arg+1]) {
char *file = rpmGetPath(argv[arg+1], NULL);
- if (!pkg->fileFile) pkg->fileFile = newStringBuf();
- appendLineStringBuf(pkg->fileFile, file);
+ argvAdd(&(pkg->fileFile), file);
free(file);
}
}
goto exit;
} else {
while (! (nextPart = isPart(spec->line))) {
- appendStringBuf(pkg->fileList, spec->line);
+ argvAdd(&(pkg->fileList), spec->line);
if ((rc = readLine(spec, STRIP_COMMENTS)) > 0) {
nextPart = PART_NONE;
break;
goto exit;
}
- pkg->policyList = newStringBuf();
-
if ((rc = readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS)) > 0) {
nextPart = PART_NONE;
} else if (rc < 0) {
goto exit;
} else {
while (!(nextPart = isPart(spec->line))) {
- appendLineStringBuf(pkg->policyList, spec->line);
+ argvAdd(&(pkg->policyList), spec->line);
if ((rc = readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS)) > 0) {
nextPart = PART_NONE;
break;
uint32_t flags = 0;
poptContext optCon = NULL;
- ARGV_t policies = NULL;
- ARGV_t pol;
rpmRC rc = RPMRC_FAIL;
struct poptOption optionsTable[] = {
goto exit;
}
- argvSplit(&policies, getStringBuf(pkg->policyList), "\n");
- for (pol = policies; *pol != NULL; pol++) {
+ for (ARGV_const_t pol = pkg->policyList; *pol != NULL; pol++) {
ModuleRec mod;
- char *line = *pol;
+ const char *line = *pol;
const char **argv = NULL;
int argc = 0;
int err;
rc = RPMRC_OK;
exit:
- argvFree(policies);
return rc;
}
struct TriggerFileEntry * triggerFiles;
- StringBuf fileFile;
- StringBuf fileList; /* If NULL, package will not be written */
- StringBuf policyList;
+ ARGV_t fileFile;
+ ARGV_t fileList; /* If NULL, package will not be written */
+ ARGV_t policyList;
Package next;
};
p->header = headerNew();
p->autoProv = 1;
p->autoReq = 1;
- p->fileList = newStringBuf();
+ p->fileList = argvNew();
+ p->fileFile = NULL;
p->policyList = NULL;
if (spec->packages == NULL) {
pkg->header = headerFree(pkg->header);
pkg->ds = rpmdsFree(pkg->ds);
- pkg->fileList = freeStringBuf(pkg->fileList);
- pkg->fileFile = freeStringBuf(pkg->fileFile);
- pkg->policyList = freeStringBuf(pkg->policyList);
+ pkg->fileList = argvFree(pkg->fileList);
+ pkg->fileFile = argvFree(pkg->fileFile);
+ pkg->policyList = argvFree(pkg->policyList);
if (pkg->cpioList) {
rpmfi fi = pkg->cpioList;
pkg->cpioList = NULL;