Debian Bug report logs - #578864
dpkg-source -b in 3.0 (quilt) package modifies timestamp of manually changed files

version graph

Package: dpkg-dev; Maintainer for dpkg-dev is Dpkg Developers <[email protected]>; Source for dpkg-dev is src:dpkg (PTS, buildd, popcon).

Reported by: Raphael Hertzog <[email protected]>

Date: Fri, 23 Apr 2010 08:42:02 UTC

Severity: minor

Found in version dpkg/1.15.0

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], [email protected], [email protected], Dpkg Developers <[email protected]>:
Bug#578864; Package dpkg-dev. (Fri, 23 Apr 2010 08:42:05 GMT) (full text, mbox, link).


Acknowledgement sent to Raphael Hertzog <[email protected]>:
New Bug report received and forwarded. Copy sent to [email protected], [email protected], Dpkg Developers <[email protected]>. (Fri, 23 Apr 2010 08:42:05 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Raphael Hertzog <[email protected]>
To: [email protected]
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/




Information forwarded to [email protected], Dpkg Developers <[email protected]>:
Bug#578864; Package dpkg-dev. (Wed, 18 Apr 2012 14:09:02 GMT) (full text, mbox, link).


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).


Message #10 received at [email protected] (full text, mbox, reply):

From: Guo Yixuan <[email protected]>
To: Raphael Hertzog <[email protected]>, [email protected]
Subject: Re: dpkg-source -b in 3.0 (quilt) package modifies timestamp of, manually changed files
Date: Wed, 18 Apr 2012 22:05:19 +0800
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




Information forwarded to [email protected], Dpkg Developers <[email protected]>:
Bug#578864; Package dpkg-dev. (Wed, 18 Apr 2012 22:12:06 GMT) (full text, mbox, link).


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).


Message #15 received at [email protected] (full text, mbox, reply):

From: Raphael Hertzog <[email protected]>
To: Guo Yixuan <[email protected]>
Cc: [email protected]
Subject: Re: dpkg-source -b in 3.0 (quilt) package modifies timestamp of, manually changed files
Date: Thu, 19 Apr 2012 00:09:19 +0200
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/




Information forwarded to [email protected], Dpkg Developers <[email protected]>:
Bug#578864; Package dpkg-dev. (Sun, 20 May 2012 05:15:03 GMT) (full text, mbox, link).


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).


Message #20 received at [email protected] (full text, mbox, reply):

From: Guo Yixuan <[email protected]>
To: Raphael Hertzog <[email protected]>
Cc: [email protected]
Subject: Re: dpkg-source -b in 3.0 (quilt) package modifies timestamp of, manually changed files
Date: Sun, 20 May 2012 13:12:47 +0800
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






Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Tue May 13 05:20:59 2025; Machine Name: bembo

Debian Bug tracking system

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/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.