* [PATCH v2 1/3] debianize: make changelog date reproducible
@ 2021-12-14 16:03 Henning Schild
2021-12-14 16:03 ` [PATCH v2 2/3] debianize: prepend changelog entries Henning Schild
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Henning Schild @ 2021-12-14 16:03 UTC (permalink / raw)
To: isar-users; +Cc: Venkata.Pyla, Henning Schild
Deriving the date from the filesystem and git also does not always
produce the same result.
In case there is a changelog file and our version does not yet exist
in it, make the new entry 42s later. If there was no changelog use
"1970-01-01 00:00:00 UTC".
Reported-by: <Venkata.Pyla@toshiba-tsip.com>
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/debianize.bbclass | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass
index aa13b28d101b..d315b5bf44a9 100644
--- a/meta/classes/debianize.bbclass
+++ b/meta/classes/debianize.bbclass
@@ -14,20 +14,19 @@ MAINTAINER ??= "Unknown maintainer <unknown@example.com>"
deb_add_changelog() {
changelog_v="${CHANGELOG_V}"
+ timestamp=0
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}'/')
+ orig_date=$(dpkg-parsechangelog -l ${WORKDIR}/changelog.orig -S Date)
+ orig_seconds=$(date --date="${orig_date}" +'%s')
+ timestamp=$(expr ${orig_seconds} + 42)
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})
- else
- date=$(LANG=C date -R)
- fi
+ date=$(LANG=C date -R -d @${timestamp})
cat <<EOF > ${S}/debian/changelog
${PN} (${changelog_v}) UNRELEASED; urgency=low
--
2.32.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 2/3] debianize: prepend changelog entries
2021-12-14 16:03 [PATCH v2 1/3] debianize: make changelog date reproducible Henning Schild
@ 2021-12-14 16:03 ` Henning Schild
2021-12-14 16:03 ` [PATCH v2 3/3] isar-exclude-docs: include "native" package changelogs Henning Schild
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Henning Schild @ 2021-12-14 16:03 UTC (permalink / raw)
To: isar-users; +Cc: Venkata.Pyla, Henning Schild
Make sure to include the upstream changelog and prepend our entry.
Before that change i.e. hello would end up with a changelog containing
only our entry. After that we will get the full upstream changelog and
our prepended entry.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/debianize.bbclass | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass
index d315b5bf44a9..d125256a2285 100644
--- a/meta/classes/debianize.bbclass
+++ b/meta/classes/debianize.bbclass
@@ -34,6 +34,12 @@ ${PN} (${changelog_v}) UNRELEASED; urgency=low
-- ${MAINTAINER} ${date}
EOF
+ if [ -f ${WORKDIR}/changelog.orig ]; then
+ # prepend our entry to the original changelog
+ echo >> ${S}/debian/changelog
+ cat ${WORKDIR}/changelog.orig >> ${S}/debian/changelog
+ fi
+
if [ -f ${WORKDIR}/changelog ]; then
latest_version=$(dpkg-parsechangelog -l ${WORKDIR}/changelog -S Version)
if [ "${latest_version}" = "${changelog_v}" ]; then
--
2.32.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 3/3] isar-exclude-docs: include "native" package changelogs
2021-12-14 16:03 [PATCH v2 1/3] debianize: make changelog date reproducible Henning Schild
2021-12-14 16:03 ` [PATCH v2 2/3] debianize: prepend changelog entries Henning Schild
@ 2021-12-14 16:03 ` Henning Schild
2021-12-14 16:04 ` [PATCH v2 1/3] debianize: make changelog date reproducible Henning Schild
2021-12-21 13:04 ` Anton Mikanovich
3 siblings, 0 replies; 5+ messages in thread
From: Henning Schild @ 2021-12-14 16:03 UTC (permalink / raw)
To: isar-users; +Cc: Venkata.Pyla, Henning Schild
So called "native" packages will put the debian changelog into the
package as "changelog" and not "changelog.Debian".
dh_installchangelogs(1)
We have the file from ubuntu and with this change we start doing things
differently. For isar "raw" packages will be "native" so we probably
want that no matter what ubuntu might think. I still started a
discussion on the topic.
https://github.com/tianon/docker-brew-ubuntu-core/issues/216
This was found when working on reproducible builds, for some reason the
changelogs of the raw packages did not differ, because they are not in
the rootfs.
Reported-by: <Venkata.Pyla@toshiba-tsip.com>
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/recipes-support/isar-exclude-docs/files/isar-exclude-docs | 2 +-
meta/recipes-support/isar-exclude-docs/files/postinst | 2 +-
.../{isar-exclude-docs_0.1.bb => isar-exclude-docs_0.2.bb} | 0
3 files changed, 2 insertions(+), 2 deletions(-)
rename meta/recipes-support/isar-exclude-docs/{isar-exclude-docs_0.1.bb => isar-exclude-docs_0.2.bb} (100%)
diff --git a/meta/recipes-support/isar-exclude-docs/files/isar-exclude-docs b/meta/recipes-support/isar-exclude-docs/files/isar-exclude-docs
index 5bec6260fddd..a77a47d1fe01 100644
--- a/meta/recipes-support/isar-exclude-docs/files/isar-exclude-docs
+++ b/meta/recipes-support/isar-exclude-docs/files/isar-exclude-docs
@@ -8,4 +8,4 @@ path-exclude=/usr/share/doc/*
path-include=/usr/share/doc/*/copyright
# ... and Debian changelogs
-path-include=/usr/share/doc/*/changelog.Debian.*
+path-include=/usr/share/doc/*/changelog.*
diff --git a/meta/recipes-support/isar-exclude-docs/files/postinst b/meta/recipes-support/isar-exclude-docs/files/postinst
index f6c0d1b2df52..d34c04ea47f0 100644
--- a/meta/recipes-support/isar-exclude-docs/files/postinst
+++ b/meta/recipes-support/isar-exclude-docs/files/postinst
@@ -4,4 +4,4 @@
# what we delete needs to be in sync with the dpkg configuration we ship
rm -rf /usr/share/man/*
-find /usr/share/doc/ -type f ! -name "copyright" ! -name "changelog.Debian.*" -exec rm -rf {} \;
+find /usr/share/doc/ -type f ! -name "copyright" ! -name "changelog.*" -exec rm -rf {} \;
diff --git a/meta/recipes-support/isar-exclude-docs/isar-exclude-docs_0.1.bb b/meta/recipes-support/isar-exclude-docs/isar-exclude-docs_0.2.bb
similarity index 100%
rename from meta/recipes-support/isar-exclude-docs/isar-exclude-docs_0.1.bb
rename to meta/recipes-support/isar-exclude-docs/isar-exclude-docs_0.2.bb
--
2.32.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/3] debianize: make changelog date reproducible
2021-12-14 16:03 [PATCH v2 1/3] debianize: make changelog date reproducible Henning Schild
2021-12-14 16:03 ` [PATCH v2 2/3] debianize: prepend changelog entries Henning Schild
2021-12-14 16:03 ` [PATCH v2 3/3] isar-exclude-docs: include "native" package changelogs Henning Schild
@ 2021-12-14 16:04 ` Henning Schild
2021-12-21 13:04 ` Anton Mikanovich
3 siblings, 0 replies; 5+ messages in thread
From: Henning Schild @ 2021-12-14 16:04 UTC (permalink / raw)
To: isar-users; +Cc: Venkata.Pyla
diff to v1 is using expr instead of bc for timestamp calculation
Henning
Am Tue, 14 Dec 2021 17:03:02 +0100
schrieb Henning Schild <henning.schild@siemens.com>:
> Deriving the date from the filesystem and git also does not always
> produce the same result.
>
> In case there is a changelog file and our version does not yet exist
> in it, make the new entry 42s later. If there was no changelog use
> "1970-01-01 00:00:00 UTC".
>
> Reported-by: <Venkata.Pyla@toshiba-tsip.com>
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
> meta/classes/debianize.bbclass | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/meta/classes/debianize.bbclass
> b/meta/classes/debianize.bbclass index aa13b28d101b..d315b5bf44a9
> 100644 --- a/meta/classes/debianize.bbclass
> +++ b/meta/classes/debianize.bbclass
> @@ -14,20 +14,19 @@ MAINTAINER ??= "Unknown maintainer
> <unknown@example.com>"
> deb_add_changelog() {
> changelog_v="${CHANGELOG_V}"
> + timestamp=0
> 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}'/')
> + orig_date=$(dpkg-parsechangelog -l
> ${WORKDIR}/changelog.orig -S Date)
> + orig_seconds=$(date --date="${orig_date}" +'%s')
> + timestamp=$(expr ${orig_seconds} + 42)
> 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})
> - else
> - date=$(LANG=C date -R)
> - fi
> + date=$(LANG=C date -R -d @${timestamp})
> cat <<EOF > ${S}/debian/changelog
> ${PN} (${changelog_v}) UNRELEASED; urgency=low
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/3] debianize: make changelog date reproducible
2021-12-14 16:03 [PATCH v2 1/3] debianize: make changelog date reproducible Henning Schild
` (2 preceding siblings ...)
2021-12-14 16:04 ` [PATCH v2 1/3] debianize: make changelog date reproducible Henning Schild
@ 2021-12-21 13:04 ` Anton Mikanovich
3 siblings, 0 replies; 5+ messages in thread
From: Anton Mikanovich @ 2021-12-21 13:04 UTC (permalink / raw)
To: Henning Schild, isar-users; +Cc: Venkata.Pyla
14.12.2021 19:03, Henning Schild wrote:
> Deriving the date from the filesystem and git also does not always
> produce the same result.
>
> In case there is a changelog file and our version does not yet exist
> in it, make the new entry 42s later. If there was no changelog use
> "1970-01-01 00:00:00 UTC".
>
> Reported-by: <Venkata.Pyla@toshiba-tsip.com>
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
Applied to next, thanks.
--
Anton Mikanovich
Promwad Ltd.
External service provider of ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn, Germany
+49 (89) 122 67 24-0
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-12-21 13:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-14 16:03 [PATCH v2 1/3] debianize: make changelog date reproducible Henning Schild
2021-12-14 16:03 ` [PATCH v2 2/3] debianize: prepend changelog entries Henning Schild
2021-12-14 16:03 ` [PATCH v2 3/3] isar-exclude-docs: include "native" package changelogs Henning Schild
2021-12-14 16:04 ` [PATCH v2 1/3] debianize: make changelog date reproducible Henning Schild
2021-12-21 13:04 ` Anton Mikanovich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox