summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2012-05-14 10:31:45 +0300
committerPanu Matilainen <pmatilai@redhat.com>2012-05-14 10:33:30 +0300
commit89f32675c2df4ebfb5acacb2c962d5716385ba4c (patch)
treef653ca4ad410100e6551c88f2d671761a7ae42ae
parent807ba93a6cf168410e3801347898949f356fcd6c (diff)
downloadlibrpm-tizen-89f32675c2df4ebfb5acacb2c962d5716385ba4c.tar.gz
librpm-tizen-89f32675c2df4ebfb5acacb2c962d5716385ba4c.tar.bz2
librpm-tizen-89f32675c2df4ebfb5acacb2c962d5716385ba4c.zip
Centralize fl.processingFailed setting for parseForFoo() calls
- All the parseForFoo() functions return an error code already, on top of this they also set fl.processingFailed, which forces passing the whole damn filelist to them when they'd only really need the current buffer and (parts of) fl.cur / fl.def. - Preserve former behavior of continuing parsing despite errors, dunno whether it makes much sense though.
-rw-r--r--build/files.c44
1 files changed, 11 insertions, 33 deletions
diff --git a/build/files.c b/build/files.c
index 54651202c..62d31dcdb 100644
--- a/build/files.c
+++ b/build/files.c
@@ -351,9 +351,6 @@ static rpmRC parseForVerify(char * buf, FileList fl)
exit:
free(q);
- if (rc != RPMRC_OK) {
- fl->processingFailed = 1;
- }
return rc;
}
@@ -447,7 +444,6 @@ static rpmRC parseForDev(char * buf, FileList fl)
exit:
if (rc) {
rpmlog(RPMLOG_ERR, _("Missing %s in %s %s\n"), errstr, name, p);
- fl->processingFailed = 1;
}
free(q);
return rc;
@@ -580,9 +576,6 @@ static rpmRC parseForAttr(char * buf, FileList fl)
exit:
free(q);
- if (rc != RPMRC_OK) {
- fl->processingFailed = 1;
- }
return rc;
}
@@ -648,9 +641,6 @@ static rpmRC parseForConfig(char * buf, FileList fl)
exit:
free(q);
- if (rc != RPMRC_OK) {
- fl->processingFailed = 1;
- }
return rc;
}
@@ -739,9 +729,6 @@ static rpmRC parseForLang(char * buf, FileList fl)
exit:
free(q);
- if (rc != RPMRC_OK) {
- fl->processingFailed = 1;
- }
return rc;
}
@@ -808,9 +795,6 @@ static rpmRC parseForCaps(char * buf, FileList fl)
exit:
free(q);
- if (rc != RPMRC_OK) {
- fl->processingFailed = 1;
- }
return rc;
}
@@ -931,10 +915,6 @@ static rpmRC parseForSimple(rpmSpec spec, Package pkg, char * buf,
free(specialDocBuf);
}
- if (res != RPMRC_OK) {
- fl->processingFailed = 1;
- }
-
return res;
}
@@ -1815,20 +1795,18 @@ static rpmRC processPackageFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
fl.cur.specdFlags = ((unsigned)fl.def.specdFlags) >> 8;
fl.cur.verifyFlags = fl.def.verifyFlags;
- if (parseForVerify(buf, &fl))
- continue;
- if (parseForAttr(buf, &fl))
- continue;
- if (parseForDev(buf, &fl))
- continue;
- if (parseForConfig(buf, &fl))
- continue;
- if (parseForLang(buf, &fl))
- continue;
- if (parseForCaps(buf, &fl))
- continue;
- if (parseForSimple(spec, pkg, buf, &fl, &fileName))
+ if (parseForVerify(buf, &fl) ||
+ parseForAttr(buf, &fl) ||
+ parseForDev(buf, &fl) ||
+ parseForConfig(buf, &fl) ||
+ parseForLang(buf, &fl) ||
+ parseForCaps(buf, &fl) ||
+ parseForSimple(spec, pkg, buf, &fl, &fileName))
+ {
+ fl.processingFailed = 1;
continue;
+ }
+
if (fileName == NULL)
continue;