From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Henning Schild <henning.schild@siemens.com>
Subject: [PATCH v3] debianize: Add placeholder for original version to CHANGELOG_V
Date: Thu, 23 Apr 2020 18:31:10 +0200 [thread overview]
Message-ID: <ebf1ab25-74ea-b3ba-4c48-2ecac873c6f7@siemens.com> (raw)
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
next reply other threads:[~2020-04-23 16:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-23 16:31 Jan Kiszka [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ebf1ab25-74ea-b3ba-4c48-2ecac873c6f7@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=henning.schild@siemens.com \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox