X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=dh_installdocs;h=6191091ac62a1ddcb5438c00338832203a200c41;hb=9b53dab3959087e387b73f0a573172fdc910e737;hp=86b6f200faebf50e08306711feb2397720f0c254;hpb=f06ac32c0e70741472b5b2f09dd1c011c3f53441;p=debhelper.git diff --git a/dh_installdocs b/dh_installdocs index 86b6f20..6191091 100755 --- a/dh_installdocs +++ b/dh_installdocs @@ -5,8 +5,7 @@ # Also installs the debian/copyright and debian/README.debian and debian/TODO # and handles debian/doc-base. -BEGIN { push @INC, "debian", "/usr/share/debhelper" } -use Dh_Lib; +use Debian::Debhelper::Dh_Lib; init(); foreach $PACKAGE (@{$dh{DOPACKAGES}}) { @@ -16,13 +15,13 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { # If this is a symlink, leave it alone. if ( ! -d "$TMP/usr/share/doc/$PACKAGE" && ! -l "$TMP/usr/share/doc/$PACKAGE") { - doit("install","-g","root","-o","root","-d","$TMP/usr/share/doc/$PACKAGE"); + doit("install","-g",0,"-o",0,"-d","$TMP/usr/share/doc/$PACKAGE"); } undef @docs; if ($file) { - @docs=filearray($file); + @docs=filearray($file, "."); } if (($PACKAGE eq $dh{FIRSTPACKAGE} || $dh{PARAMS_ALL}) && @ARGV) { @@ -31,7 +30,7 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { if (@docs) { doit("cp", "-a",@docs,"$TMP/usr/share/doc/$PACKAGE/"); - doit("chown","-R","root.root","$TMP/usr/share/doc"); + doit("chown","-R","0.0","$TMP/usr/share/doc"); doit("chmod","-R","go=rX","$TMP/usr/share/doc"); doit("chmod","-R","u+rw","$TMP/usr/share/doc"); } @@ -42,32 +41,37 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { $readme_debian=pkgfile($PACKAGE,'README.debian'); } if ($readme_debian) { - doit("install","-g","root","-o","root","-m","644","-p","$readme_debian", + doit("install","-g",0,"-o",0,"-m","644","-p","$readme_debian", "$TMP/usr/share/doc/$PACKAGE/README.Debian"); } $todo=pkgfile($PACKAGE,'TODO'); if ($todo) { if (isnative($PACKAGE)) { - doit("install","-g","root","-o","root","-m","644","-p",$todo, + doit("install","-g",0,"-o",0,"-m","644","-p",$todo, "$TMP/usr/share/doc/$PACKAGE/TODO"); } else { - doit("install","-g","root","-o","root","-m","644","-p",$todo, + doit("install","-g",0,"-o",0,"-m","644","-p",$todo, "$TMP/usr/share/doc/$PACKAGE/TODO.Debian"); } } - # Support debian/package.copyright, but if not present, fall back - # on debian/copyright for all packages, not just the main binary - # package. - $copyright=pkgfile($PACKAGE,'copyright'); - if (! $copyright && -e "debian/copyright") { - $copyright="debian/copyright"; - } - if ($copyright) { - doit("install","-g","root","-o","root","-m","644","-p",$copyright, - "$TMP/usr/share/doc/$PACKAGE/copyright"); + # If the "directory" is a dangling symlink, then don't install + # the copyright file. This is useful for multibinary packages + # that share a doc directory. + if (-d "$TMP/usr/share/doc/$PACKAGE") { + # Support debian/package.copyright, but if not present, fall + # back on debian/copyright for all packages, not just the + # main binary package. + $copyright=pkgfile($PACKAGE,'copyright'); + if (! $copyright && -e "debian/copyright") { + $copyright="debian/copyright"; + } + if ($copyright) { + doit("install","-g",0,"-o",0,"-m","644","-p",$copyright, + "$TMP/usr/share/doc/$PACKAGE/copyright"); + } } # Add in the /usr/doc compatability symlinks code. @@ -107,11 +111,11 @@ foreach $PACKAGE (@{$dh{DOPACKAGES}}) { if (%doc_ids) { if (! -d "$TMP/usr/share/doc-base/") { - doit("install","-g","root","-o","root","-d","$TMP/usr/share/doc-base/"); + doit("install","-g",0,"-o",0,"-d","$TMP/usr/share/doc-base/"); } } foreach my $fn (keys %doc_ids) { - doit("install","-g","root","-o","root","-m644","-p","debian/$fn", + doit("install","-g",0,"-o",0,"-m644","-p","debian/$fn", "$TMP/usr/share/doc-base/$doc_ids{$fn}"); if (! $dh{NOSCRIPTS}) { autoscript($PACKAGE,"postinst","postinst-doc-base",