public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v3] debianize: Add placeholder for original version to CHANGELOG_V
@ 2020-04-23 16:31 Jan Kiszka
  2020-04-23 16:43 ` Henning Schild
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Jan Kiszka @ 2020-04-23 16:31 UTC (permalink / raw)
  To: isar-users; +Cc: Henning Schild

From: Jan Kiszka <jan.kiszka@siemens.com>

This allows to append to the latest upstream version when using an
unpinned source version. The format of the placeholder is
"<orig-version>".

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Changes in v3:
 - fix regression when placeholder was not used

 meta/classes/debianize.bbclass | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass
index da43a4e2..e77be232 100644
--- a/meta/classes/debianize.bbclass
+++ b/meta/classes/debianize.bbclass
@@ -11,6 +11,15 @@ DESCRIPTION ?= "must not be empty"
 MAINTAINER ?= "Unknown maintainer <unknown@example.com>"
 
 deb_add_changelog() {
+	changelog_v="${CHANGELOG_V}"
+	if [ -f ${S}/debian/changelog ]; then
+		if [ ! -f ${WORKDIR}/changelog.orig ]; then
+			cp ${S}/debian/changelog ${WORKDIR}/changelog.orig
+		fi
+		orig_version=$(dpkg-parsechangelog -l ${WORKDIR}/changelog.orig -S Version)
+		changelog_v=$(echo "${changelog_v}" | sed 's/<orig-version>/'${orig_version}'/')
+	fi
+
 	timestamp=$(find ${S}/ -type f -not -path "${S}/debian/*" -printf "%T@\n"|sort -n -r|head -n 1)
 	if [ -n "${timestamp}" ]; then
 		date=$(LANG=C date -R -d @${timestamp})
@@ -18,7 +27,7 @@ deb_add_changelog() {
 		date=$(LANG=C date -R)
 	fi
 	cat <<EOF > ${S}/debian/changelog
-${PN} (${CHANGELOG_V}) UNRELEASED; urgency=low
+${PN} (${changelog_v}) UNRELEASED; urgency=low
 
   * generated by Isar
 
@@ -26,7 +35,7 @@ ${PN} (${CHANGELOG_V}) UNRELEASED; urgency=low
 EOF
 	if [ -f ${WORKDIR}/changelog ]; then
 		if head -1 "${WORKDIR}"/changelog | \
-			grep -q -e "^${PN} (${CHANGELOG_V})"
+			grep -q -e "^${PN} (${changelog_v})"
 		then
 			# entry for our version already there, use unmodified
 			rm ${S}/debian/changelog
-- 
2.16.4

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-05-08  6:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-23 16:31 [PATCH v3] debianize: Add placeholder for original version to CHANGELOG_V Jan Kiszka
2020-04-23 16:43 ` Henning Schild
2020-04-23 16:50   ` Jan Kiszka
2020-04-23 17:32     ` Henning Schild
2020-04-24  7:59       ` Jan Kiszka
2020-04-23 16:47 ` Henning Schild
2020-05-07 19:45 ` Baurzhan Ismagulov
2020-05-07 20:02   ` Henning Schild
2020-05-07 20:28     ` Baurzhan Ismagulov
2020-05-08  5:45       ` Henning Schild
2020-05-08  6:02         ` Baurzhan Ismagulov
2020-05-08  6:02     ` Jan Kiszka
2020-05-08  6:06       ` Baurzhan Ismagulov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox