summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Debian/Dgit.pm12
-rw-r--r--debian/changelog3
-rwxr-xr-xdgit4
3 files changed, 16 insertions, 3 deletions
diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm
index ac44b9a..fa85374 100644
--- a/Debian/Dgit.pm
+++ b/Debian/Dgit.pm
@@ -17,7 +17,8 @@ BEGIN {
@ISA = qw(Exporter);
@EXPORT = qw(setup_sigwarn
debiantag server_branch server_ref
- stat_exists fail ensuredir executable_on_path
+ stat_exists link_ltarget
+ fail ensuredir executable_on_path
waitstatusmsg failedcmd
cmdoutput cmdoutput_errok
git_rev_parse git_get_ref git_for_each_ref
@@ -219,6 +220,15 @@ sub cmdoutput {
return $d;
}
+sub link_ltarget ($$) {
+ my ($old,$new) = @_;
+ lstat $old or return undef;
+ if (-l _) {
+ $old = cmdoutput qw(realpath --), $old;
+ }
+ link $old, $new or die "link $old $new: $!";
+}
+
sub git_rev_parse ($) {
return cmdoutput qw(git rev-parse), "$_[0]~0";
}
diff --git a/debian/changelog b/debian/changelog
index 577b81a..1c5fbc4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,9 @@
dgit (1.3) unstable; urgency=low
* In option parser test `@ARGV' not `length @ARGV'. Closes:#795710.
+ * If a .orig in .. is a symlink, hardlink the link target into our
+ private unpack directory, rather than the link itself (since latter
+ won't work if the symlink is relative).
--
diff --git a/dgit b/dgit
index 62cd049..2d42f94 100755
--- a/dgit
+++ b/dgit
@@ -1382,7 +1382,7 @@ sub generate_commit_from_dsc () {
my $f = $fi->{Filename};
die "$f ?" if $f =~ m#/|^\.|\.dsc$|\.tmp$#;
- link "../../../$f", $f
+ link_ltarget "../../../$f", $f
or $!==&ENOENT
or die "$f $!";
@@ -2794,7 +2794,7 @@ END
foreach my $f (<../../../../*>) { #/){
my $b=$f; $b =~ s{.*/}{};
next unless is_orig_file $b, srcfn $upstreamversion,'';
- link $f, $b or die "$b $!";
+ link_ltarget $f, $b or die "$b $!";
$dscaddfile->($b);
}