From 0f37a4cac41ca7dc266b9e9af877f0d6a6e49b01 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 11 Oct 2018 00:19:41 +0100 Subject: dgit: Handle EXDEV when saving origs Replace two link calls with rename_link_xf, and change the subsequent error handling to use $@ iff appropriate. Part of the fix to #910730. Signed-off-by: Ian Jackson --- dgit | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'dgit') diff --git a/dgit b/dgit index d443c34..6b961f5 100755 --- a/dgit +++ b/dgit @@ -2224,18 +2224,18 @@ sub generate_commits_from_dsc () { printdebug "considering saving $f: "; - if (link $f, $upper_f) { + if (rename_link_xf 1, $f, $upper_f) { printdebug "linked.\n"; - } elsif ((printdebug "($!) "), + } elsif ((printdebug "($@) "), $! != EEXIST) { - fail f_ "saving %s: %s", "$buildproductsdir/$f", $!; + fail f_ "saving %s: %s", "$buildproductsdir/$f", $@; } elsif (!$refetched) { printdebug "no need.\n"; - } elsif (link $f, "$upper_f,fetch") { + } elsif (rename_link_xf 1, $f, "$upper_f,fetch") { printdebug "linked (using ...,fetch).\n"; - } elsif ((printdebug "($!) "), + } elsif ((printdebug "($@) "), $! != EEXIST) { - fail f_ "saving %s: %s", "$buildproductsdir/$f,fetch", $!; + fail f_ "saving %s: %s", "$buildproductsdir/$f,fetch", $@; } else { printdebug "cannot.\n"; } -- cgit v1.2.3