help-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-tar] [PATCH] Add --clamp-mtime option


From: Jakob Bohm
Subject: Re: [Help-tar] [PATCH] Add --clamp-mtime option
Date: Wed, 10 Jun 2015 06:48:53 +0200
User-agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 10/06/2015 05:58, Paul Eggert wrote:
Jakob Bohm wrote:
make will still see the files in debian/foo with the
timestamps make expects, and will thus not redo most of the copies and
compilations, as it would if the actual files had been backdated with
touch

I don't see why 'make' would have to redo most of its work with
backdating, if the backdating is done to a time that *could* have been
done by a 'make'.


This is because the timestamp manipulation is typically limited to
files that are going to be packaged, not to build intermediary files
(such as .o files).

As a result, make may see files that were not backdated, notice that
those are newer than the backdated files, and recreate the backdated
files.

If (in a misguided attempt to please make), you also start touching
files outside debian/${pkgname}, you will be corrupting the timestamps in the source package, making it more difficult for users/other people other than the package maintainer to inspect the chronology of source code changes.

And do remember that debian source packages are independent of any
source control systems (git, svn etc. etc.) that you may have been
using when you created the package.  Online repositories such as
alioth, gitorius and bitkeeper come and go much more often than the
(infinite!) lifetime of archived debian package repositories.  If it is
not on both the source code DVDs and the Debian mirrors, then it is not
accompanying the binary files provided to users, and thus cannot be a
needed part of the GPL source code for any GPL packages.

All of this is avoided by using the (existing!) tar --mtime option to
only change the timestamps in the .deb and .udeb packages, not in the
build tree.

As a thought experiment, suppose your working files are the same as
what's in your repository (i.e., 'git diff' outputs nothing), and
suppose you run 'make' and build everything, and then touch every file
that's in the repository so that its timestamp equals the time of its
most recent commit.  If the newest such timestamp is T, suppose you also
do a "touch -d T FOO" for every file FOO that's built by 'make' (i.e.,
every file that's not in the repository).  After these timestamps are
all applied, the resulting set of files should be such that:

1. Running 'make' does nothing because everything appears to be up to date.

2. Putting the files into a tarball and then extracting from the tarball
will still keep 'make' happy on the extracting host.

3. If you redo the whole process you'll still get the same output
tarball with the same time stamps, so it's reproducible.

4. If you change any of the repository-controlled files (either by
editing and committing the results, or by checking out another branch)
you redo the whole process everything will still work with the new
configuration (generating different tarballs of course).

None of this requires --clamp-mtime so I'm not seeing what --clamp-mtime
buys us.  Evidently I'm missing something.

--clamp-mtime preserves the timestamp of files that are *not*
modified/created by the package build and should thus keep the
timestamp from the source package.  Man pages and default config files
are very common cases.


Enjoy

Jakob
--
Jakob Bohm, CIO, Partner, WiseMo A/S.  https://www.wisemo.com
Transformervej 29, 2860 Søborg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded



reply via email to

[Prev in Thread] Current Thread [Next in Thread]