chiark / gitweb /
dgit: Handle EXDEV when putting in place output source
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 10 Oct 2018 23:28:55 +0000 (00:28 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 10 Oct 2018 23:58:26 +0000 (00:58 +0100)
Replace a rename call with rename_link_xf, and change the subsequent
error handling to use $@ iff appropriate.

Closes: #910730.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index e35f1681f387a4b2beeddaf92c5e1d92014dd8e7..5b223afb2d7080a26ed08cebecb2cabd922a4f36 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -6603,8 +6603,8 @@ sub build_source {
     my $mv = sub {
        my ($why, $l) = @_;
         printdebug " renaming ($why) $l\n";
-        rename "$l", bpd_abs()."/$l"
-           or fail f_ "put in place new built file (%s): %s", $l, $!;
+        rename_link_xf 0, "$l", bpd_abs()."/$l"
+           or fail f_ "put in place new built file (%s): %s", $l, $@;
     };
     foreach my $l (split /\n/, getfield $dsc, 'Files') {
         $l =~ m/\S+$/ or next;