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

Re: debconf: country code in a base-config script



On Fri, Nov 05, 2004 at 07:02:24PM +0200, Konstantinos Margaritis wrote:
> On Παρ 05 Νοε 2004 15:55, Tzafrir Cohen wrote:
> > Hi
> >
> > I want to configure some packages in the base-config script using
> > the value of the two-letter country code (e.g: "us", "gb", "il").
> >
> > The information is available in debconf. However the following
> > command seems t give an indication that the debconf database is
> > locked when run from a base-config script:
> >
> > country_answer=`echo GET debian-installer/country |
> > debconf-communicate 2>/dev/null` case "$country" in
> >   0*)country_lc=`echo $country_answer |sed -e 's/0 *//' | tr A-Z
> > a-z`;; *)
> >     # debconf failed
> >     logger "could not get country name from debconf using 'en'"
> >     country_lc='en'
> >     ;;
> > esac
> >
> > How can I read that value from debconf?
>
> First I would suggest for localization stuff to use the appropriate 
> package, localization-config. It offers the framework to do package 
> configuration based on the locale info, without so much as changing 
> base-config itself.
> There are some example scripts there that you could use as base.
> What in particular do you want to do?

However in my case I need the country code for a script that simply
needs a country code and not much more. No extra logic is involved
besides maintaining a list of valid country codes.

I also don't like the dependency on perl. So far I have managed to keep
my system withot the package 'perl' itself, and with only perl-base .

(BTW: some perl module packages depend on "perl", but actually need no
modules outside whatever is supplied in "perl-base" . Should they be
ammended to depend on "perl-base" instead?)

-- 
Tzafrir Cohen                       +---------------------------+
http://www.technion.ac.il/~tzafrir/ |vim is a mutt's best friend|
mailto:tzafrir@technion.ac.il       +---------------------------+



Reply to: