2022-10-25 10:48:12 +08:00
|
|
|
From 67f2f371822dde322047bcae05c433a91022f334 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: licihua <licihua@huawei.com>
|
|
|
|
|
Date: Thu, 20 Oct 2022 20:32:09 +0800
|
|
|
|
|
Subject: [PATCH 03/22] add dist to release by default
|
2020-03-04 21:30:21 +08:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
build/parsePreamble.c | 7 +++++++
|
|
|
|
|
1 file changed, 7 insertions(+)
|
|
|
|
|
|
|
|
|
|
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
|
2022-10-25 10:48:12 +08:00
|
|
|
index bd3da19..722d0ac 100644
|
2020-03-04 21:30:21 +08:00
|
|
|
--- a/build/parsePreamble.c
|
|
|
|
|
+++ b/build/parsePreamble.c
|
2022-10-25 10:48:12 +08:00
|
|
|
@@ -799,6 +799,11 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag,
|
2020-03-04 21:30:21 +08:00
|
|
|
case RPMTAG_VERSION:
|
|
|
|
|
case RPMTAG_RELEASE:
|
|
|
|
|
SINGLE_TOKEN_ONLY;
|
2022-10-25 10:48:12 +08:00
|
|
|
+ if (tag == RPMTAG_RELEASE) {
|
2020-03-04 21:30:21 +08:00
|
|
|
+ char *dist = rpmExpand("%{?dist}",NULL);
|
|
|
|
|
+ rasprintf(&field,"%s%s",field,dist);
|
|
|
|
|
+ free(dist);
|
|
|
|
|
+ }
|
2022-10-25 10:48:12 +08:00
|
|
|
if (rpmCharCheck(spec, field, ALLOWED_CHARS_VERREL, NULL))
|
2020-03-04 21:30:21 +08:00
|
|
|
goto exit;
|
|
|
|
|
headerPutString(pkg->header, tag, field);
|
2022-10-25 10:48:12 +08:00
|
|
|
@@ -986,6 +991,8 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag,
|
2020-03-04 21:30:21 +08:00
|
|
|
}
|
|
|
|
|
rc = RPMRC_OK;
|
|
|
|
|
exit:
|
|
|
|
|
+ if (tag == RPMTAG_RELEASE)
|
|
|
|
|
+ free(field);
|
|
|
|
|
return rc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
--
|
2022-10-25 10:48:12 +08:00
|
|
|
2.26.2
|
2020-03-04 21:30:21 +08:00
|
|
|
|