Re: proper edit-build-install-test cycle with v3 source packages?

2010-04-23 Thread Raphael Hertzog
Hi,

On Thu, 22 Apr 2010, Niels Thykier wrote:
 Timo Juhani Lindfors wrote:
  The above is not really usable with v3 source packages: apparently
  dpkg-buildpackage modifies the timestamps of source files and emacs
  complains that these files have changed on the disk. Should I just
  modify emacs to ignore this warning?

No, there's no reason for those timestamps to be changed on build.

 Have you tried adding -b to dpkg-buildpackage as well? I think that
 should do it (unless the build/clean does weird things).

Using this option just avoids calling dpkg-source and works around what
looks like a bug. Why not report the bug instead?

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.

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/
diff --git a/scripts/Dpkg/Source/Package/V3/quilt.pm 
b/scripts/Dpkg/Source/Package/V3/quilt.pm
index 58c494b..ae4223e 100644
--- a/scripts/Dpkg/Source/Package/V3/quilt.pm
+++ b/scripts/Dpkg/Source/Package/V3/quilt.pm
@@ -163,12 +163,14 @@ sub apply_quilt_patch {
 my ($self, $dir, $patch, %opts) = @_;
 $opts{verbose} = 0 unless defined($opts{verbose});
 $opts{timestamp} = time() unless defined($opts{timestamp});
+$opts{force_timestamp} = 1 unless defined($opts{force_timestamp});
+$opts{create_dirs} = 1 unless defined($opts{create_dirs});
+$opts{remove_backup} = 0 unless defined($opts{remove_backup});
 my $path = File::Spec-catfile($dir, debian, patches, $patch);
 my $obj = Dpkg::Source::Patch-new(filename = $path);
 
 info(_g(applying %s), $patch) if $opts{verbose};
-$obj-apply($dir, timestamp = $opts{timestamp},
-force_timestamp = 1, create_dirs = 1, remove_backup = 0,
+$obj-apply($dir, %opts,
 options = [ '-s', '-t', '-F', '0', '-N', '-p1', '-u',
  '-V', 'never', '-g0', '-E', '-b',
  '-B', .pc/$patch/ ]);
@@ -327,9 +329,10 @@ sub register_autopatch {
 # 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']);
+$patch_obj-apply($dir, add_options = ['-R', '-E'],
+  force_timestamp = 0);
 erasedir(File::Spec-catdir($dir, .pc, $auto_patch));
-$self-apply_quilt_patch($dir, $auto_patch);
+$self-apply_quilt_patch($dir, $auto_patch, force_timestamp = 0);
 } else {
 # Remove auto_patch from series
 if ($has_patch) {


Re: proper edit-build-install-test cycle with v3 source packages?

2010-04-23 Thread Timo Juhani Lindfors
Raphael Hertzog hert...@debian.org 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:

$ 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/README
-rw-r--r-- 1 lindi lindi 437 Apr 23 07:57 upstream/README

$ grep force_timestamp /usr/share/perl5/Dpkg/Source/Package/V3/quilt.pm
$opts{force_timestamp} = 1 unless defined($opts{force_timestamp});
  force_timestamp = 0);
$self-apply_quilt_patch($dir, $auto_patch, force_timestamp = 0);



$ strace -o ../s -s4096 -f dpkg-buildpackage -rfakeroot -us -uc
$ grep upstream/README\ ../s | grep -v ENOENT
1091  open(sample1/upstream/README, O_WRONLY|O_CREAT|O_EXCL, 0644) = 3
1091  utimensat(AT_FDCWD, sample1/upstream/README, {{1272009605, 986398357}, 
{1248874754, 0}}, 0) = 0
1078  stat(sample7-1.0.orig.qqSdKV/upstream/README, {st_mode=S_IFREG|0644, 
st_size=40, ...}) = 0
1078  lstat(sample7-1.0.orig.qqSdKV/upstream/README, {st_mode=S_IFREG|0644, 
st_size=40, ...}) = 0
1078  stat(sample7-1.0.orig.qqSdKV/upstream/README, {st_mode=S_IFREG|0644, 
st_size=40, ...}) = 0
1106  stat(upstream/README, {st_mode=S_IFREG|0644, st_size=40, ...}) = 0
1106  open(upstream/README, O_RDONLY) = 5
1106  stat(upstream/README, {st_mode=S_IFREG|0644, st_size=40, ...}) = 0
1106  rename(upstream/README, .pc/change-something/upstream/README) = 0
1106  rename(/tmp/poWipCxZ, upstream/README) = -1 EXDEV (Invalid 
cross-device link)
1106  open(upstream/README, O_WRONLY|O_CREAT|O_TRUNC, 0100644) = 3
1106  chmod(upstream/README, 0100644) = 0
1078  utimes(sample7-1.0.orig.qqSdKV/upstream/README, {{1272009606, 0}, 
{1272009606, 0}}) = 0
1078  lstat(sample7-1.0/upstream/README, {st_mode=S_IFREG|0644, st_size=437, 
...}) = 0
1078  lstat(sample7-1.0.orig.qqSdKV/upstream/README, {st_mode=S_IFREG|0644, 
st_size=379, ...}) = 0
1078  open(sample7-1.0.orig.qqSdKV/upstream/README, O_RDONLY) = 5
1078  open(sample7-1.0/upstream/README, O_RDONLY) = 6
1118  execve(/usr/bin/diff, [diff, -u, -p, -L, 
sample7-1.0.orig/upstream/README, -L, sample7-1.0/upstream/README, --, 
sample7-1.0.orig.qqSdKV/upstream/README, sample7-1.0/upstream/README], [/* 
69 vars */]) = 0
1118  stat(sample7-1.0.orig.qqSdKV/upstream/README, {st_mode=S_IFREG|0644, 
st_size=379, ...}) = 0
1118  stat(sample7-1.0/upstream/README, {st_mode=S_IFREG|0644, st_size=437, 
...}) = 0
1118  open(sample7-1.0.orig.qqSdKV/upstream/README, O_RDONLY) = 3
1118  open(sample7-1.0/upstream/README, O_RDONLY) = 4
1078  stat(sample7-1.0/upstream/README, {st_mode=S_IFREG|0644, st_size=437, 
...}) = 0
1078  lstat(sample7-1.0/upstream/README, {st_mode=S_IFREG|0644, st_size=437, 
...}) = 0
1078  stat(sample7-1.0/upstream/README, {st_mode=S_IFREG|0644, st_size=437, 
...}) = 0
1078  stat(sample7-1.0/upstream/README, {st_mode=S_IFREG|0644, st_size=437, 
...}) = 0
1078  lstat(sample7-1.0/upstream/README, {st_mode=S_IFREG|0644, st_size=437, 
...}) = 0
1078  stat(sample7-1.0/upstream/README, {st_mode=S_IFREG|0644, st_size=437, 
...}) = 0
1119  stat(upstream/README, {st_mode=S_IFREG|0644, st_size=437, ...}) = 0
1119  open(upstream/README, O_RDONLY) = 5
1119  stat(upstream/README, {st_mode=S_IFREG|0644, st_size=437, ...}) = 0
1119  rename(upstream/README, upstream/README.dpkg-orig) = 0
1119  rename(/tmp/poitsPCr, upstream/README) = -1 EXDEV (Invalid 
cross-device link)
1119  open(upstream/README, O_WRONLY|O_CREAT|O_TRUNC, 0100644) = 3
1119  chmod(upstream/README, 0100644) = 0
1078  stat(sample7-1.0/upstream/README, {st_mode=S_IFREG|0644, st_size=379, 
...}) = 0
1078  lstat(sample7-1.0/upstream/README, {st_mode=S_IFREG|0644, st_size=379, 
...}) = 0
1078  stat(sample7-1.0/upstream/README, {st_mode=S_IFREG|0644, st_size=379, 
...}) = 0
1121  stat(upstream/README, {st_mode=S_IFREG|0644, st_size=379, ...}) = 0
1121  open(upstream/README, O_RDONLY) = 5
1121  stat(upstream/README, {st_mode=S_IFREG|0644, st_size=379, ...}) = 0
1121  rename(upstream/README, .pc/debian-changes-1.0-1/upstream/README) = 0
1121  rename(/tmp/po3ufJdq, upstream/README) = -1 EXDEV (Invalid 
cross-device link)
1121  open(upstream/README, O_WRONLY|O_CREAT|O_TRUNC, 0100644) = 3
1121  chmod(upstream/README, 0100644) = 0


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/84pr1q4mqp@sauna.l.org



proper edit-build-install-test cycle with v3 source packages?

2010-04-22 Thread Timo Juhani Lindfors
If I hit a bug in a v1 source package I often do

apt-get source foo
cd foo-*
DEB_BUILD_OPTIONS=noopt debug nostrip dpkg-buildpackage -rfakeroot -us -uc
sudo debi ../foo*.changes

and then run the program inside M-x gdb RET of emacs. If I want to
test a possible fix I then just use the same emacs to modify files and
then rerun dpkg-buildpackage and debi to test my changes.

The above is not really usable with v3 source packages: apparently
dpkg-buildpackage modifies the timestamps of source files and emacs
complains that these files have changed on the disk. Should I just
modify emacs to ignore this warning?

I asked my question on #debian-devel and was given the suggestion that
I should copy the source tree to a different directory for build. This
works but is slow and also has the problem that M-x gdb will open
files of the build directory instead of the original one. If I then
accidentally modify something in the build directory it will get
overwritten by the build.


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/84y6gf4egf@sauna.l.org



Re: proper edit-build-install-test cycle with v3 source packages?

2010-04-22 Thread Niels Thykier
Timo Juhani Lindfors wrote:
 If I hit a bug in a v1 source package I often do
 
 apt-get source foo
 cd foo-*
 DEB_BUILD_OPTIONS=noopt debug nostrip dpkg-buildpackage -rfakeroot -us -uc
 sudo debi ../foo*.changes
 
 and then run the program inside M-x gdb RET of emacs. If I want to
 test a possible fix I then just use the same emacs to modify files and
 then rerun dpkg-buildpackage and debi to test my changes.
 
 The above is not really usable with v3 source packages: apparently
 dpkg-buildpackage modifies the timestamps of source files and emacs
 complains that these files have changed on the disk. Should I just
 modify emacs to ignore this warning?
 
 I asked my question on #debian-devel and was given the suggestion that
 I should copy the source tree to a different directory for build. This
 works but is slow and also has the problem that M-x gdb will open
 files of the build directory instead of the original one. If I then
 accidentally modify something in the build directory it will get
 overwritten by the build.
 
 

Have you tried adding -b to dpkg-buildpackage as well? I think that
should do it (unless the build/clean does weird things).

~Niels




signature.asc
Description: OpenPGP digital signature


Re: proper edit-build-install-test cycle with v3 source packages?

2010-04-22 Thread Timo Juhani Lindfors
Niels Thykier ni...@thykier.net writes:
 Have you tried adding -b to dpkg-buildpackage as well?

Thanks! This seems to work:

$ 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/README
-rw-r--r-- 1 lindi kurp 437 Apr 22 13:45 upstream/README

$ touch -d 1970-01-01 upstream/README
$ dpkg-buildpackage -rfakeroot -us -uc -b
$ ls -l upstream/README
-rw-r--r-- 1 lindi kurp 437 Jan  1  1970 upstream/README

Since source packages are not so sensitive to build directory I
suppose I can generate the source package with

(rsync --delete -a . ../build-foo  cd ../build-foo  dpkg-buildpackage 
-rfakeroot -uc -us -S)


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/84tyr34b99@sauna.l.org