Subject: dpkg-source -b in 3.0 (quilt) package modifies timestamp of
manually changed files
Date: Fri, 23 Apr 2010 10:39:58 +0200
Package: dpkg-dev
Severity: minor
Version: 1.15.0
Short summary: dpkg-source -b on a "3.0 (quilt)" source package with
changes not yet recorded in a quilt patch will lead to timestamp changes
on the modified files, this confuses emacs if one of the modified files is
currently open.
See discussion at
http://lists.debian.org/debian-devel/2010/04/msg00382.html
On Fri, 23 Apr 2010, Timo Juhani Lindfors wrote:
> Raphael Hertzog <[email protected]> writes:
> > Timo, I'd be glad if you could check whether the attached patch fixes the
> > issue for you. If yes, I'll commit it to dpkg.
>
> Doesn't seem to help:
Hum, I was fooled by your statement that only the timestamp changed. In fact
files are modified twice to properly record the changes in the quilt
framework so the timestamps are implicitly changed in that operation (and
it was not only dpkg-source that was directly modifying the timestamp).
I'm not even sure if resetting the timestamp to match the original one
would suffice. I might have to find another solution to record the changes
in quilt.
Cheers,
--
Raphaël Hertzog
Like what I do? Sponsor me: http://ouaza.com/wp/2010/01/05/5-years-of-freexian/
My Debian goals: http://ouaza.com/wp/2010/01/09/debian-related-goals-for-2010/
Acknowledgement sent
to Guo Yixuan <[email protected]>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <[email protected]>.
(Wed, 18 Apr 2012 14:09:03 GMT) (full text, mbox, link).
Hello Raphael,
This bug seems to be fixed, as I tried what Timo has done:
$ dget
http://people.debian.org/~hertzog/packages/debsrc3.0/sample7_1.0-1.dsc
$ dpkg-source -x sample*.dsc
$ cd sample7-1.0
$ touch -d 1970-01-01 upstream/README
$ dpkg-buildpackage -rfakeroot -us -uc
$ ls -l upstream/
total 4
-rw-r--r-- 1 gyx gyx 437 Jan 1 1970 README
Although I don't know why it is fixed.
(dpkg-dev version: 1.16.2, wheezy)
Guo Yixuan
Acknowledgement sent
to Raphael Hertzog <[email protected]>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <[email protected]>.
(Wed, 18 Apr 2012 22:12:06 GMT) (full text, mbox, link).
Hi,
On Wed, 18 Apr 2012, Guo Yixuan wrote:
> This bug seems to be fixed, as I tried what Timo has done:
>
> $ dget http://people.debian.org/~hertzog/packages/debsrc3.0/sample7_1.0-1.dsc
> $ dpkg-source -x sample*.dsc
> $ cd sample7-1.0
Here you need to modify upstream/README to actually match the case
described in this bug report:
$ echo "foo" >>upstream/README
> $ touch -d 1970-01-01 upstream/README
> $ dpkg-buildpackage -rfakeroot -us -uc
And here, nowadays, you have to allow the change to be automatically recorded:
$ dpkg-buildpackage -us -uc --source-option=--auto-commit
> $ ls -l upstream/
> total 4
> -rw-r--r-- 1 gyx gyx 437 Jan 1 1970 README
And then you can see that it's not fixed:
$ ls -l upstream/
total 4
-rw-r--r-- 1 rhertzog rhertzog 441 avril 19 00:07 README
Cheers,
--
Raphaël Hertzog ◈ Debian Developer
Pre-order a copy of the Debian Administrator's Handbook and help
liberate it: http://debian-handbook.info/liberation/
Acknowledgement sent
to Guo Yixuan <[email protected]>:
Extra info received and forwarded to list. Copy sent to Dpkg Developers <[email protected]>.
(Sun, 20 May 2012 05:15:03 GMT) (full text, mbox, link).
Hi Raphael,
On 04/19/2012 06:09 AM, Raphael Hertzog wrote:
> On Wed, 18 Apr 2012, Guo Yixuan wrote:
>> This bug seems to be fixed, as I tried what Timo has done:
>>
>> $ dget http://people.debian.org/~hertzog/packages/debsrc3.0/sample7_1.0-1.dsc
>> $ dpkg-source -x sample*.dsc
>> $ cd sample7-1.0
>
> Here you need to modify upstream/README to actually match the case
> described in this bug report:
> $ echo "foo">>upstream/README
>
>> $ touch -d 1970-01-01 upstream/README
>> $ dpkg-buildpackage -rfakeroot -us -uc
>
> And here, nowadays, you have to allow the change to be automatically recorded:
> $ dpkg-buildpackage -us -uc --source-option=--auto-commit
>
>> $ ls -l upstream/
>> total 4
>> -rw-r--r-- 1 gyx gyx 437 Jan 1 1970 README
>
> And then you can see that it's not fixed:
> $ ls -l upstream/
> total 4
> -rw-r--r-- 1 rhertzog rhertzog 441 avril 19 00:07 README
Thanks for you answer. I looked into dpkg-source and find the code that
modify timestamp.
In scripts/Dpkg/Source/Package/V3/quilt.pm, sub register_patch, ll. 379-385
# Ensure quilt meta-data are created and in sync with some trickery:
# reverse-apply the patch, drop .pc/$patch, re-apply it
# with the correct options to recreate the backup files
my $patch_obj = Dpkg::Source::Patch->new(filename => $patch);
$patch_obj->apply($dir, add_options => ['-R', '-E'], verbose => 0);
erasedir(File::Spec->catdir($dir, ".pc", $patch_name));
$self->apply_quilt_patch($dir, $patch_name);
So in order to have correct meta-data for quilt, the debian-changes-* is
first reverse applied (by patch -R -E), then applied by
$self->apply_quilt_patch(...). So the timestamp is flushed in the way.
The quilt meta-data just contains the original files that
debian-changes-* modifies, so there should be a more reasonable way to
correct these files instead of relying on the unpatch-patch trickery.
Cheers,
Guo Yixuan
Debbugs is free software and licensed under the terms of the GNU General
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.