summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbiao716.wang <biao716.wang@samsung.com>2023-03-21 15:08:48 +0900
committerbiao716.wang <biao716.wang@samsung.com>2023-03-21 15:26:47 +0900
commit18243ddb211f50bdeb17f269e5f6d8b1d59b86d5 (patch)
tree62c6ac2d56051a7ca7be35fb802abe4e2866dfeb
parent5746c1980a7000e123edd6837284dd5af3a12c9a (diff)
downloadrpm-18243ddb211f50bdeb17f269e5f6d8b1d59b86d5.tar.gz
rpm-18243ddb211f50bdeb17f269e5f6d8b1d59b86d5.tar.bz2
rpm-18243ddb211f50bdeb17f269e5f6d8b1d59b86d5.zip
Fix build error: Ignore rewrite "%package debuginfo" section in spec filesubmit/tizen_base/20230321.143030
Change-Id: I4ecc81988f64c395aef10b4f7c089fba1cc9e614 Signed-off-by: biao716.wang <biao716.wang@samsung.com>
-rw-r--r--build/parsePreamble.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
index 96bf9c035..70c528ad1 100644
--- a/build/parsePreamble.c
+++ b/build/parsePreamble.c
@@ -702,8 +702,9 @@ int addLangTag(rpmSpec spec, Header h, rpmTagVal tag,
if (haveLangTag(h, tag, lang)) {
/* Turn this into an error eventually */
- rpmlog(RPMLOG_WARNING, _("line %d: second %s\n"),
+ rpmlog(RPMLOG_WARNING, _("line %d: second %s, please remove it\n"),
spec->lineNum, rpmTagGetName(tag));
+ return 0;
}
if (!*lang) {
@@ -1126,6 +1127,30 @@ int parsePreamble(rpmSpec spec, int initialPackage)
// goto exit;
if (!lookupPackage(spec, name, flag, NULL)) {
+ //exist %package debuginfo, need to ignore it, because there has been
+ //debuginfo package created by %debug_package macro.
+ if (0 == strncmp(name, "debuginfo", 9))
+ {
+ rpmlog(RPMLOG_WARNING, _("debuginfo package has been in spec file, Don't write again this %s"), spec->line);
+ if ((rc = readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS)) > 0) {
+ nextPart = PART_NONE;
+ } else if (rc < 0) {
+ free(name);
+ goto exit;
+ } else {
+ while (! (nextPart = isPart(spec->line))) {
+ if ((rc = readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS)) > 0) {
+ nextPart = PART_NONE;
+ break;
+ }
+ if (rc) {
+ free(name);
+ goto exit;
+ }
+ }
+ }
+ res = nextPart;
+ }
free(name);
goto exit;
}