Patch broken dh_lib

ubuntu/bionic
Jason Rhinelander 4 years ago
parent 0c147abed2
commit d8a416868b

@ -34,6 +34,7 @@ local deb_pipeline(image, buildarch='amd64', debarch='amd64', jobs=6) = {
'cd debian',
'eatmydata mk-build-deps -i -r --tool="' + apt_get_quiet + ' -o Debug::pkgProblemResolver=yes --no-install-recommends -y" control',
'cd ..',
'patch -i debian/dh-lib.patch /usr/share/perl5/Debian/Debhelper/Dh_Lib.pm', # patch debian bug #897569
'eatmydata gbp buildpackage --git-no-pbuilder --git-builder=\'debuild --preserve-envvar=CCACHE_*\' --git-upstream-tag=HEAD -us -uc -j' + jobs,
'./debian/ci-upload.sh ' + distro + ' ' + debarch,
],

@ -0,0 +1,32 @@
diff --git a/lib/Debian/Debhelper/Dh_Lib.pm b/lib/Debian/Debhelper/Dh_Lib.pm
index e25b696c0bbf61677344b99382c7a58a1182dc1a..9c829f0f0effb4094eb6ab5a6a60e662726f41fb 100644
--- a/lib/Debian/Debhelper/Dh_Lib.pm
+++ b/lib/Debian/Debhelper/Dh_Lib.pm
@@ -31,7 +31,7 @@ use constant {
'DBGSYM_PACKAGE_TYPE' => DEFAULT_PACKAGE_TYPE,
};
-use Errno qw(ENOENT);
+use Errno qw(ENOENT EXDEV);
use Exporter qw(import);
use File::Glob qw(bsd_glob GLOB_CSH GLOB_NOMAGIC GLOB_TILDE);
our (@EXPORT, %dh);
@@ -535,8 +535,16 @@ sub rename_path {
}
return 1 if $dh{NO_ACT};
if (not rename($source, $dest)) {
- my $files = escape_shell($source, $dest);
- error("mv $files: $!")
+ my $ok = 0;
+ if ($! == EXDEV) {
+ # Replay with a fork+exec to handle crossing two mount
+ # points (See #897569)
+ $ok = _doit('mv', $source, $dest);
+ }
+ if (not $ok) {
+ my $files = escape_shell($source, $dest);
+ error("mv $files: $!");
+ }
}
return 1;
}
Loading…
Cancel
Save