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

How to migrate from /usr/doc to /usr/share/doc



Hi!

I've tried different solutions migrating from /usr/doc to /usr/share/doc
in my libapache-mod-jserv package (some of them didn't work), now I have
this in my postinst:

--- cut here ---

# First try to remove the .dhelp file in the old /usr/doc directory,
# then move the remaining files to the new /usr/share/doc directory
# (making backups of duplicate files) and finally remove the old
# directory and create the compatibility symlink
#
# IMPORTANT: I have to be sure that /usr/doc/libapache-mod-jserv
# and /usr/share/doc/libapache-mod-jserv are not the same
# directory (maybe /usr/doc will me a symlink to /usr/share/doc
# in the future)

if [ -d /usr/doc/libapache-mod-jserv -a \
     ! /usr/doc/libapache-mod-jserv -ef
       /usr/share/doc/libapache-mod-jserv ]; then

    rm -f /usr/doc/libapache-mod-jserv/.dhelp
    rmdir --ignore-fail-on-non-empty /usr/doc/libapache-mod-jserv

    if [ -e /usr/doc/libapache-mod-jserv ]; then
        cp -ab /usr/doc/libapache-mod-jserv /usr/share/doc
        rm -rf /usr/doc/libapache-mod-jserv
    fi

    ln -s /usr/share/doc/libapache-mod-jserv /usr/doc
fi

--- cut here ---

What do you think about this? Should I try to move all remaining files
in /usr/doc/package to /usr/share/doc/package?

-- 
Stefan Gybas


Reply to: