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

Bug#209395: teTeX: language.dat mislinked



Hilmar Preusse <hille42@web.de> schrieb:

> I didn't have a look at the archive. If that question was not
> evaluated on debian-devel: Could anybody please do that? I don't read
> debian-devel as I'm not a official Debian developer. I'm afraid that
> story could even be raised to a Policy violation. So I'd like to get
> it fixed before sarge.

I am not sure whether this is a violation of a "must" clause, or only of
a "should" clause or the like. Essentially we have to read 10.7.3, I
think:

,----
| Configuration file handling must conform to the following behavior:
| 
|     * local changes must be preserved during a package upgrade
`----

And I think the best way to achive this would be to have language.dat in
/etc/texmf and

a) parse language.dat in config, and use the known languages that we find
   uncommented as default in our debconf question

b) not rewrite language.dat, but only remove and add comments.

Thus, any additional languages, comment lines and the order of lines
will be preserved. Only languages known to debconf will be handled, and
if the users doesn't change anything in the debconf interface, his old,
manual changes will be preserved, too.

b) should be rather easy. Just instead of using the default
language.dat, as we do now, we run our sed stuff on the real one. What's
missing is putting in comments, but that shouldn't be too hard.

a) may be harder - I thought. But in fact it doesn't seem to hard. Below
is a concept for a script to accomplish the parsing in config. It is
completely untested, but should show how I think we can do it.

Regards, Frank

#!/bin/sh

LDAT=/var/lib/texmf/language.dat

parse_file (){
  languages="inhyph bahyph hrhyph czhyph dehypht dehyphn dkhyphen nehyph fi8hyph frhyph grhyph ithyph lahyph huhyph nohyph nohyphb nohyphbc plhyph pt8hyph rohyphen ruhyphen skhyph sihyph23 sphyph trhyph ukhyphen ukrhyph ukrhyph.t2a ukrhyph.lcy ukrhyph.ot2"
  file=$1
  temp=`tempfile`

  # get non-comment, non-blank, non-alias lines
  egrep -v '^[[:blank:]]*%|^[[:blank:]]*$|^[[:blank:]]*=' $file > $temp
  lines=`wc -l $temp`
  counter=0
  for language in $languages; do
    if grep  $language $temp >/dev/null 2>&1; then
      assign_default $language
    fi
  done
  # now remove the ", " from the beginning of the variable, it is there becaue
  # when assign_default was called for the first time, default was empty
  default=${default#, }
}

assign_default () {
  case $1 in
    ukhyphen)
      default="$default, british" ;;
    frhyph) 
      default="$default, french[=patois]" ;;
    dehypht)
      default="$default, german[=austrian-alte_Rechtschreibung]" ;;
    dehyphn)
      default="$default, ngerman[=naustrian-neue_Rechtschreibung]" ;;
    inhyph)
      default="$default, bahasa" ;;
    bahyph)
      default="$default, basque" ;;
    hrhyph)
      default="$default, croatian" ;;
    czhyph)
      default="$default, czech" ;;
    dkhyphen)
      default="$default, danish" ;;
    nehyph)
      default="$default, dutch" ;;
    fi8hyph)
      default="$default, finnish" ;;
    grhyph)
      default="$default, greek" ;;
    ithyph
      default="$default, italian" ;;
    lahyph)
      default="$default, latin" ;;
    huhyph)
      default="$default, magyar" ;;
    nohyph)
      default="$default, norsk[old]" ;;
    nohyphb)
      default="$default, norsk[nohyphb.tex]" ;;
    nohyphbc)
      default="$default, norsk[nohyphbc.tex]" ;;
    plhyph)
      default="$default, polish" ;;
    pt8hyph)    
      default="$default, portuges" ;;
    rohyphen)
      default="$default, romanian" ;;
    ruhyphen)
      default="$default, russian" ;;
    skhyph)
      default="$default, slovak" ;;
    sihyph23)
      default="$default, slovene" ;;
    sphyph)
      default="$default, spanish" ;;
    trhyph)
      default="$default, turkish" ;;
    ukrhyph)
      default="$default, ukrainian[ukrhyph.tex]" ;;
    ukrhyph.t2a)    
      default="$default, ukranian[ukrhyph.t2a]" ;;
    ukrhyph.lcy)
      default="$default, ukranian[ukrhyph.lcy]" ;;
    ukrhyph.ot2)
      default="$default, ukranian[ukrhyph.ot2]" ;;
  esac
}



# let's do the work
parse_file $LDAT 
db_set tetex-bin/hyphen $default
db_get tetex-bin/hyphen


-- 
Frank Küster, Biozentrum der Univ. Basel
Abt. Biophysikalische Chemie




Reply to: