timestamps and export

James Westby jw+debian at jameswestby.net
Mon Jun 2 12:37:27 BST 2008

On Mon, 2008-06-02 at 12:28 +1000, Martin Pool wrote:
> On Sat, May 31, 2008 at 2:08 AM, James Westby <jw+debian at jameswestby.net> wrote:
> > Hi all,
> >
> > There is a bug in the builddeb plugin that is caused by exporting
> > the same branch twice at different times, and so getting two
> > different tarballs.
> >
> > It may be possible to solve this a different way, but it may require
> > changes to the export code. I would like to make it possible to
> > specify a timestamp to the exporter, which, if given, would then be the
> > timestamp set on all files.
> This is a bit surprising to me - I was looking at the tarball export
> code last week and it does see to make an effort to pass the timestamp
> of the revision.  So this may just be a bug...

>From the tar exporter code:

  def tar_exporter(tree, dest, root, compression=None):
    from time import time
    now = time()
      item, fileobj = ie.get_tar_item(root, dp, now, tree)

I guess this could be changed to use "get_file_mtime()" on the tree
to get the timestamp value.

builddeb implements a bit of a hack to allow the exporters to work
on working trees (there's no command line way to export a working
tree, so it's not a bug that bzr users will hit), I don't know
if this will work in that case, as we probably want time.time(),
rather than the mtime returned by stat of the working tree file
in that case. (The bug that started all of this isn't from exporting
a working tree, so this choice wouldn't change that, however there
may be a bug in another part of the code that this wouldn't fix).



More information about the bazaar mailing list