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

Re: /usr/share/doc vs. /usr/doc transition, debate reopened



Okay, my two cents on the issue.  I hope I'm not just adding more noise
to the ratio, but since I have no particular policy axe to grind,
perhaps I may be a bit more impartial....

On Mon, Aug 02, 1999 at 04:06:15PM +0200, Kristoffer.Rose@ENS-Lyon.FR
wrote:
> Thanks for reopening the debate, Chris.
>
> I am (still) following it and I (still :) do not understand what is
wrong
> with the following'
>
> debian-policy [PROPOSAL]: /usr/doc -> /usr/share/doc should be a
symlink
>
> I propose that the "transition" of /usr/doc to /usr/share/doc be done
with
> the following three changes to Policy:
>
> 1. REQUIRE that /usr/doc is a symlink to the FHS directory
/usr/share/doc.

Joseph Carter and others have pointed out that this is a non-starter.
However, Kristoffer's script can be adapted, absent this provision, to
simply migrate the files with *no* symlink.

Basically, to me there are just two ways to go about this "transition"
that make sense.

1.  Don't migrate to /usr/share/doc.  Require packages currently
installing in this location to put them back in /usr/doc.  At least
until after Potato gets out the door.

2.  Migrate everything to /usr/share/doc.  Do it automatically for
packages which install in /usr/doc.  One exception: for the sake of
users who may be confused by the move, create a document /usr/doc/README
which tells them where to find the documents they are looking for.

Regarding the script, I would modify it thusly:


#!/bin/bash
#
# Debian FHS migration script.

# Check that /usr/share/doc exists.
if [ ! -d /usr/share/doc ]
then
  echo "Error: /usr/share/doc does not exist!  Please reinstall
base-files."
  exit 1
fi

# We must migrate (or fail).
usrdocfiles=`find /usr/doc/* -type d -maxdepth 0`
usrsharedocfiles=`find /usr/share/doc/* -type d -maxdepth 0`
echo -n "Migrating /usr/doc -> share/doc..."

# Fail noisily if /usr/doc is a mount point.
if mount | fgrep -q ' /usr/doc '
then
  echo "failed."
  echo "Error: /usr/doc is a mount point! Please undo that and rerun"
  echo "       the /usr/sbin/fix-FHS-compliance script."
  exit 1
fi

# Check that there are no duplicates between the directories.
dups=""
for d in $usrdocfiles
do
  dups="$dups"`expr " $usrsharedocfiles " : " $d "`
done
if [ -n "$dups" ]
then
  echo "failed."
  echo "Error: The following packages have files in both /usr/doc and
/usr/share/doc:"
  echo "       $dups"
  echo "       This should not happen and cannot be handled by this
script."
  echo "       We propose you remove these buggy packages and rerun the"

  echo "       /usr/sbin/fix-FHS-compliance script."
  exit 1
fi

# We have a go for migration!  Copy /usr/doc/* to /usr/share/doc/*.
cd /usr/doc
for d in $usrdocfiles
do
  cp -a $d /usr/share/doc/$d
  if ! diff -rq $d /usr/share/doc/$d >/dev/null 2>&1
  then
    echo failed."
    echo "Error: Could not copy /usr/doc/$d to /usr/share/doc."
    echo -n "Cleaning up..."
    rm -fr /usr/share/doc/$d
    echo "done."
    exit 1
  fi
  rm -fr $d
  if [ -d $d ]
  then
    echo "failed."
    echo "Error: Could not remove /usr/doc/$d!"
    echo "       Your system may be in a very bad state - sorry."
    exit 1
  fi
done

# We're done.
echo "done."
exit


Reply to: