Hi,

On Fri, 21 Aug 2015 09:24:21 +0200 Joachim Breitner <[email protected]> wrote:
> On Mon, 20 Aug 2012 18:53:02 +0200 Jakub Wilk <[email protected]> wrote:
> > The symlink to build log that sbuild creates is absolute:
> > 
> > $ readlink python-pipeline_0.1.3-3_i386.build
> > /home/jwilk/python-pipeline_0.1.3-3_i386-20120820-1846.build
> > 
> > It used to be relative in older (<= 0.63.1-1) versions of sbuild. Could you
> > restore the previous behavior? Thanks.
> 
> the bug is still present, and has caused me a minor annoyance.

same here.

Please find a patch attached which uses a relative symlink if the log directory
is equal to the build directory (the default) and if sbuild is not in buildd
mode.

Would this solve the problem?

Thanks!

cheers, josch
diff --git a/lib/Sbuild/Build.pm b/lib/Sbuild/Build.pm
index 41a8f68..5661cd7 100644
--- a/lib/Sbuild/Build.pm
+++ b/lib/Sbuild/Build.pm
@@ -2161,7 +2161,13 @@ sub open_build_log {
 				   $self->get_conf('BUILD_DIR') . '/current-' .
 				   $self->get_conf('DISTRIBUTION'));
 	    } else {
-		$self->log_symlink($filename,
+		my $symlinktarget = $filename;
+		# if symlink target is in the same directory as the symlink
+		# itself, make it a relative link instead of an absolute one
+		if (Cwd::abs_path($self->get_conf('BUILD_DIR')) eq Cwd::abs_path(dirname($filename))) {
+		    $symlinktarget = basename($filename)
+		}
+		$self->log_symlink($symlinktarget,
 				   $self->get_conf('BUILD_DIR') . '/' .
 				   $self->get('Package_SVersion') . '_' .
 				   $self->get('Host Arch') . ".build");

Attachment: signature.asc
Description: signature

Reply via email to