diff -Nru debhelper-9.20160115/dh_installdocs debhelper-9.20160118/dh_installdocs --- debhelper-9.20160115/dh_installdocs 2016-01-14 19:49:48.000000000 +0000 +++ debhelper-9.20160118/dh_installdocs 2016-01-20 05:13:14.000000000 +0000 @@ -177,13 +177,6 @@ if ($link_doc) { getpackages('both') unless $called_getpackages++; - if (package_arch($package) ne package_arch($dh{LINK_DOC})) { - if (compat(9)) { - warning("WARNING: --link-doc between architecture all and not all packages breaks binNMUs"); - } else { - error("--link-doc not allowed between ${package} and $dh{LINK_DOC} (one is arch:all and the other not)"); - } - } # Make sure that the parent directory exists. if (! -d "$tmp/usr/share/doc" && ! -l "$tmp/usr/share/doc") { install_dir("$tmp/usr/share/doc"); @@ -196,7 +189,19 @@ # Policy says that if you make your documentation # directory a symlink, then you have to depend on # the target. - addsubstvar($package, 'misc:Depends', "$dh{LINK_DOC} (= \${binary:Version})"); + if (package_arch($package) eq package_arch($dh{LINK_DOC})) { + addsubstvar($package, 'misc:Depends', "$dh{LINK_DOC} (= \${binary:Version})"); + } else { + if (package_arch($package) eq "all") { + addsubstvar($package, 'misc:Depends', "$dh{LINK_DOC} (>= \${source:Version})"); + } else { + if (compat(9)) { + warning("WARNING: --link-doc if target, $dh{LINK_DOC}, is architecture all and linked doc package, $package, is not, breaks binNMUs"); + } else { + error("--link-doc not allowed between ${package} and $dh{LINK_DOC} ($dh{LINK_DOC} is arch:all and ${package} is not)"); + } + } + } } } else {