FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 04-22-2010, 04:52 PM
Timo Juhani Lindfors
 
Default proper edit-build-install-test cycle with v3 source packages?

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-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 84y6gf4egf.fsf@sauna.l.org">http://lists.debian.org/84y6gf4egf.fsf@sauna.l.org
 
Old 04-22-2010, 05:29 PM
Niels Thykier
 
Default proper edit-build-install-test cycle with v3 source packages?

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
 
Old 04-22-2010, 06:01 PM
Timo Juhani Lindfors
 
Default proper edit-build-install-test cycle with v3 source packages?

Niels Thykier <niels@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-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 84tyr34b99.fsf@sauna.l.org">http://lists.debian.org/84tyr34b99.fsf@sauna.l.org
 
Old 04-23-2010, 06:37 AM
Raphael Hertzog
 
Default proper edit-build-install-test cycle with v3 source packages?

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) {
 
Old 04-23-2010, 08:05 AM
Timo Juhani Lindfors
 
Default proper edit-build-install-test cycle with v3 source packages?

Raphael Hertzog <hertzog@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-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 84pr1q4mqp.fsf@sauna.l.org">http://lists.debian.org/84pr1q4mqp.fsf@sauna.l.org
 

Thread Tools




All times are GMT. The time now is 09:31 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org