[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#41729: [PROPOSAL] Modify dpkg-buildpackage to handle FHS move



Package: debian-policy
Version: 3.0.0.0
Severity: wishlist

Manoj requested that I submit this as a separate proposal so that it
doesn't get lost.

The following was originally posted on the thread discussing the
/usr/doc -> /usr/share/doc move and the problems associated with it.

   Julian

----- Original message -----

Maybe I can suggest an alternative which will
 - not require packages to add anything to their maintainer scripts
 - not break the majority of packages, and
 - not create a forest of symlinks (which might be problematic, as has
   been pointed out)

The dpkg-buildpackage program (and maybe autobuilders as well?) could
be modified so that after the .deb is built, before anything is signed
or similar, something like the following is done (within any necessary
fakeroot-type environment, of course):

if dpkg -c ../$pva.deb | grep usr/doc/; then
  cat >&2 <<-EOF
    I see that you are using the old FSSTND /usr/doc directory.
    I will attempt to move /usr/doc to /usr/share/doc, but please
    modify your package in order to make it FHS compliant.
  EOF
  dpkg -x ../$pva.deb ${TMPDIR-/tmp}/$pva
  dpkg -e ../$pva.deb ${TMPDIR-/tmp}/$pva/DEBIAN
  mv ${TMPDIR-/tmp}/$pva/usr/doc ${TMPDIR-/tmp}/$pva/usr/share/doc
  dpkg --build ${TMPDIR-/tmp}/$pva ..
fi

This would therefore only require one package to be upgraded in order
to handle most packages (even if it is dpkg!), and autobuilders could
recompile most packages automatically.

This would fail if any of the following happen:
 - the package contained any symlinks (relative or absolute) to
   /usr/doc, although the package would still build in such a case
 - the maintainer scripts made assumptions about /usr/doc existing;
   this will hopefully not affect too many packages.

Using this, I could feasibly see all packages becoming /usr/share/doc
using by the time potato is released, as the individual packages won't
directly need modification in order to make them FHS compliant.

   Julian

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  Julian Gilbey, Dept of Maths, QMW, Univ. of London. J.D.Gilbey@qmw.ac.uk
        Debian GNU/Linux Developer,  see http://www.debian.org/~jdg

----- End of original message -----


Reply to: