On Thu, 2015-01-08 at 09:16 +0000, Ian Campbell wrote:
> On Wed, 2015-01-07 at 20:49 +0100, Jérémy Bobbio wrote:
> > > > +@@ -301,7 +301,9 @@ if [ ! -z ${output_file} ]; then
> > > > +       if [ -z ${cpio_file} ]; then
> > > > +               timestamp=
> > > > +               if test -n "$KBUILD_BUILD_TIMESTAMP"; then
> > > > +-                      timestamp="$(date -d"$KBUILD_BUILD_TIMESTAMP" 
> > > > +%s || :)"
> > > > ++                      source_date=$(echo "$KBUILD_BUILD_TIMESTAMP" |
> > > > ++                                      sed -e 
> > > > 's/.*(\([0-9-]\+\)).*/\1/')
> > > > ++                      timestamp="$(date -d"$source_date" +%s || :)"
> > > 
> > > This solution may not work.  The patched source can be built with a
> > > normal timestamp override, via linux-source.
> > 
> > The above construction will work given a standard date in
> > KBUILD_BUILD_TIMESTAMP. The sed expression only match parenthesises.
> > I am open to other suggestions.
> 
> How about changing debian/rules.real to set some other variable (e.g.
> DEB_BUILD_TIMESTAMP, or whatever) to our special version string and
> patching the relevant code (not here, but the scripts/mkcompile_h one)
> to prefer $DEB_BUILD_TIMESTAMP but still support $KBUILD_BUILD_TIMESTAMP
> as a fallback?
> 
> I think we would still need to set KBUILD_BUILD_TIMESTAMP to the
> debian/changelog date in rules.real.

I've implemented something pretty similar to that:

- $KBUILD_BUILD_TIMESTAMP is set to the date in the changelog
- $KBUILD_BUILD_VERSION_TIMESTAMP is set to what we want in
  utsname::version
- mkcompile_h prefers $KBUILD_BUILD_VERSION_TIMESTAMP over
  $KBUILD_BUILD_TIMESTAMP

Ben.

-- 
Ben Hutchings
For every action, there is an equal and opposite criticism. - Harrison

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to