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

HELP: config file treatment for new texlive packages



Hi all!

I have submitted a preliminary treatment of config files for the new
2007 packages, but I need you masters for checking. Currently no unroll
treatment, and it is implemented as follows:
- for files which are only present in /etc/texmf/texlive:
	if unchanged remove, otherwise move to new location
- for files which are only present in tetex packages:
	if unchanged remove, otherwise move to new location
- for files which are in both tetex and texlive (only xdvi.cfg AFAIS)
	if tetex version unchanged remove, otherwise move
	if texlive version unchanged remove, otherwise move
	so the texlive version takes precedence of the tetex version
	Why: If one has the texlive version I assume that he has
	texlive installed, so we want to transfer this file


Note that it is NOT run time tested, just now written. So please read
with attention.

The implementation is not very intelligent, so please tell me what you
think:
	handle_config_file_preinst $cfgfile
with this code (from all/debian/common.functions)
get_md5sum ()
{
    file="$1"
    rest="$2";
    set $rest
    while [ $# -gt 0 ]; do
        if [ $file = $1 ]; then
            echo $2
            return 0
        else
            shift 2
        fi
    done
    echo "$file: md5sum not known. Exiting" >&2
    exit 1
}
check_move ()
{
    orig="$1"
    new="$2"
    mdorigtype="$3"
    # should we check for texlive and other and warn?
    if [ $mdorigtype = tetex ] ; then
        listing="$tetex3_md5sumlist";
    else
        listing="$texlive2005_md5sumlist";
    fi
    if [ -r "$orig" ] ; then
        mdorig=$(get_md5sum "$orig" "$listing")
        if [ $(md5sum "$orig" | cut -f 1 -d ' ') = "$mdorig" ] ; then
            rm "$orig"
        else
            mkdir -p $(dirname "$new")
            mv "$orig" "$new"
        fi
    fi
}

tetex3_md5sumlist="
  /etc/texmf/xdvi.cfg 09e4201e223198f1254f85a8479add09
  /etc/texmf/texdoctk.dat c296904ec784378c25dcc63a85bd69be
"

texlive2005_md5sumlist="
  /etc/texmf/texlive/texdoctk/texdocrc.defaults 4ab115654062c336e990f7141dfc1d99
  /etc/texmf/texlive/dvips/canonex.cfg 25e2dda33d7b3cc567eed3d3ebea47d9
  /etc/texmf/texlive/dvips/config.bakoma c2f5efba7d7e5175e90ecd739fc1ae5f
  /etc/texmf/texlive/dvips/config.canonex 25e2dda33d7b3cc567eed3d3ebea47d9
  /etc/texmf/texlive/dvips/config.cms 27c2be17b92b8390e9821843b5311070
  /etc/texmf/texlive/dvips/config.cx c9a7b64b890fa8fc43532cb5736978da
  /etc/texmf/texlive/dvips/config.deskjet 201238bb0aae1f59599912eea8393759
  /etc/texmf/texlive/dvips/config.dvired 5acebd7fe2287bb9bd000565c946461d
  /etc/texmf/texlive/dvips/config.epson 693e2acaa6865772046a33af92952c24
  /etc/texmf/texlive/dvips/config.ibmvga da8a721b8ade144ccb61e9313d2bf44e
  /etc/texmf/texlive/dvips/config.ljfour 73636946aea418ca6b4800378c70c859
  /etc/texmf/texlive/dvips/config.luc 370c9827d33a122fae258afb5605bd2e
  /etc/texmf/texlive/dvips/config.mbn 0c88427928e8920f2a0d96499bdea1b2
  /etc/texmf/texlive/dvips/config.mga 81f64858ef3c3741c33baa2e243d2953
  /etc/texmf/texlive/dvips/config.mirrorprint d2bd406d82edc32d8f03a0a7a55c8704
  /etc/texmf/texlive/dvips/config.ot2 f3d0b9ff0ecb0c23950428fa7e5c776f
  /etc/texmf/texlive/dvips/config.ps b594c85c42008267520948fd9b3a9689
  /etc/texmf/texlive/dvips/config.qms c1ceb51abdda2a1b5372135c5f1c7dfe
  /etc/texmf/texlive/dvips/config.toshiba 2efd2dcc42b44a1f53a4fa8609f9a2f3
  /etc/texmf/texlive/dvips/config.unms b3b0ee3cd6e7a7240488b840dab0e431
  /etc/texmf/texlive/dvips/config.xyp 52e2197df84f0879d1bc103666483029
  /etc/texmf/texlive/dvips/cx.cfg c9a7b64b890fa8fc43532cb5736978da
  /etc/texmf/texlive/dvips/deskjet.cfg 201238bb0aae1f59599912eea8393759
  /etc/texmf/texlive/dvips/dfaxhigh.cfg 4b3d24e544b98cb95a86b66b239e1ac1
  /etc/texmf/texlive/dvips/dvired.cfg 5acebd7fe2287bb9bd000565c946461d
  /etc/texmf/texlive/dvips/epson.cfg 693e2acaa6865772046a33af92952c24
  /etc/texmf/texlive/dvips/ibmvga.cfg da8a721b8ade144ccb61e9313d2bf44e
  /etc/texmf/texlive/dvips/ljfour.cfg 73636946aea418ca6b4800378c70c859
  /etc/texmf/texlive/dvips/qms.cfg c1ceb51abdda2a1b5372135c5f1c7dfe
  /etc/texmf/texlive/dvips/toshiba.cfg 2efd2dcc42b44a1f53a4fa8609f9a2f3
  /etc/texmf/texlive/dvips/alt-rule.pro f53e1278cfd6df6133d9b693236869c2
  /etc/texmf/texlive/xdvi.cfg 4a062704c6de2e46359fcd30ba35aed9
  /etc/texmf/texlive/dvipdfm.cfg e6e2038358b76b743150a40008a18da0
"

#
# handle_config_file_preinst/postinst/prerm/postrm
# handle those config files which are left over from old texlive and
# tetex installations
handle_config_file_preinst ()
{
    cfgfile="$1"
    case "$cfgfile" in 
        # files which were only present in /etc/texmf/texlive:
        /etc/texmf/texdoctk/texdocrc.defaults)
            check_move /etc/texmf/texlive/texdoctk/texdocrc.defaults /etc/texmf/texdoctk/texdocrc.defaults texlive
            ;;
        /etc/texmf/dvipdfm/dvipdfm.cfg)
            check_move /etc/texmf/texlive/dvipdfm.cfg /etc/texmf/dvipdfm/dvipdfm.cfg texlive
            ;;
        /etc/texmf/dvips/config/*)
            check_move /etc/texmf/texlive/dvips/$(basename "$cfgfile") $cfgfile texlive
            ;;
        # files which were only present in tetex
        /etc/texmf/texdoctk/texdoctk.dat
            check_move /etc/texmf/texdoctk.dat /etc/texmf/texdoctk/texdoctk.dat tetex
            ;;
        # files which were present in both tetex and texlive
        /etc/texmf/xdvi/xdvi.cfg)
            # old tetex version
            check_move /etc/texmf/xdvi.cfg /etc/texmf/xdvi/xdvi.cfg tetex
            # old texlive version takes precedence of old tetex version
            check_move /etc/texmf/texlive/xdvi.cfg /etc/texmf/xdvi/xdvi.cfg texlive
            ;;
        *)
            echo "Please report a bug and indicate the following file" >&2
            echo "  $cfgfile">&2
            echo "and that it is not dealt with as config file. Thanks!" >&2
            exit 1
            ;;
    esac
}


Thanks for any comments!

Best wishes

Norbert

-------------------------------------------------------------------------------
Dr. Norbert Preining <preining@logic.at>                    Università di Siena
Debian Developer <preining@debian.org>                         Debian TeX Group
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
SCETHROG (n.)
One of those peculiar beards-without-moustaches worn by religious
Belgians and American scientists which help them look like trolls.
			--- Douglas Adams, The Meaning of Liff



Reply to: