public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Moessbauer, Felix" <felix.moessbauer@siemens.com>
To: "Schild, Henning" <henning.schild@siemens.com>
Cc: "isar-users@googlegroups.com" <isar-users@googlegroups.com>,
	"Kiszka, Jan" <jan.kiszka@siemens.com>,
	"venkata.pyla@toshiba-tsip.com" <venkata.pyla@toshiba-tsip.com>
Subject: Re: [PATCH 3/3] deb_add_changelog: use SOURCE_DATE_EPOCH
Date: Mon, 9 Jan 2023 10:24:51 +0000	[thread overview]
Message-ID: <08ab1a6c2ea50f2c4b6457c125fd9c2e2551620e.camel@siemens.com> (raw)
In-Reply-To: <20230109102526.313c2082@md1za8fc.ad001.siemens.net>

On Mon, 2023-01-09 at 10:25 +0100, Henning Schild wrote:
> Am Mon,  9 Jan 2023 05:14:28 +0000
> schrieb Felix Moessbauer <felix.moessbauer@siemens.com>:
> 
> > In case the SOURCE_DATE_EPOCH bb variable is set, use that value
> > both for the auto-generated changelog as well as when appending to
> > an existing changelog.
> 
> The variable SOURCE_DATE_EPOCH does not make it into the build
> environment and it very likely should not because the overall value
> for
> a single image must not be used for all packages. So we can not and
> should not use it. For a package the sane value would likely be the
> newest changelog entry ... like we try and do already.

I have to disagree. The SOURCE_DATE_EPOCH is only used to create the
timestamp in the debian changelog, as it is the best information we
have. And it is only used when we modify (or create) the changelog.
This is a prime example for what this variable is for: Adding a
timestamp where otherwise no meaningful value is available. Artificial
values are always dangerous.

Inside the sbuild environment, the SOURCE_DATE_EPOCH is defined and
exported by the debhelper scripts and points to the top most changelog
entry. For details, see /usr/share/dpkg/pkg-info.mk
There, indeed the SOURCE_DATE_EPOCH **bitbake** variable is not used
and also should not be used.

Felix

> 
> Henning
> 
> > Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> > ---
> >  meta/classes/debianize.bbclass | 11 ++++++-----
> >  1 file changed, 6 insertions(+), 5 deletions(-)
> > 
> > diff --git a/meta/classes/debianize.bbclass
> > b/meta/classes/debianize.bbclass index 3531421..49ae0dd 100644
> > --- a/meta/classes/debianize.bbclass
> > +++ b/meta/classes/debianize.bbclass
> > @@ -14,7 +14,7 @@ MAINTAINER ??= "Unknown maintainer
> > <unknown@example.com>" 
> >  deb_add_changelog() {
> >         changelog_v="${CHANGELOG_V}"
> > -       timestamp=3600
> > +       timestamp=${@ d.getVar('SOURCE_DATE_EPOCH', True) or '3600'
> > }
> >         # we have a changelog and that is not autogenerated
> >         # (when autogenerated, changelog.orig is empty)
> >         if [ -f ${S}/debian/changelog ] && [ -s
> > ${WORKDIR}/changelog.orig ]; then @@ -23,9 +23,11 @@
> > deb_add_changelog() { 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)
> > +               if [ -z "${SOURCE_DATE_EPOCH}" ]; then
> > +                       orig_date=$(dpkg-parsechangelog -l
> > ${WORKDIR}/changelog.orig -S Date)
> > +                       orig_seconds=$(date --date="${orig_date}"
> > +'%s')
> > +                       timestamp=$(expr ${orig_seconds} + 42)
> > +               fi
> >         fi
> >  
> >         date=$(LANG=C date -R -d @${timestamp})
> > @@ -42,7 +44,6 @@ EOF
> >         # 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)
> 


  reply	other threads:[~2023-01-09 10:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09  5:14 [PATCH 0/3] Fix reproducability issues in deb_add_changelog Felix Moessbauer
2023-01-09  5:14 ` [PATCH 1/3] make deb_add_changelog idempotent Felix Moessbauer
2023-01-09  9:19   ` Henning Schild
2023-01-09 10:42     ` Moessbauer, Felix
2023-01-09  5:14 ` [PATCH 2/3] deb_add_changelog: set timestamp to valid epoch Felix Moessbauer
2023-01-09  5:14 ` [PATCH 3/3] deb_add_changelog: use SOURCE_DATE_EPOCH Felix Moessbauer
2023-01-09  5:34   ` Jan Kiszka
2023-01-09  9:25   ` Henning Schild
2023-01-09 10:24     ` Moessbauer, Felix [this message]
2023-01-09 10:30     ` Jan Kiszka
2023-01-09  9:28 ` [PATCH 0/3] Fix reproducability issues in deb_add_changelog Henning Schild
2023-01-09 10:33   ` Moessbauer, Felix

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=08ab1a6c2ea50f2c4b6457c125fd9c2e2551620e.camel@siemens.com \
    --to=felix.moessbauer@siemens.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    --cc=venkata.pyla@toshiba-tsip.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