Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
yast2-config-keyboard
yast2-config-language
yast2-config-timezone
yast2/console

svn path=/trunk/country/; revision=2838
  • Loading branch information
kkaempf committed Jun 24, 2002
0 parents commit 3057e5c
Show file tree
Hide file tree
Showing 110 changed files with 5,626 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .cvsignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Makefile
Makefile.am
Makefile.in
aclocal.m4
autom4te.cache
config.cache
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
configure.in
depcomp
install-sh
libtool
ltconfig
ltmain.sh
missing
mkinstalldirs
stamp-h*
1 change: 1 addition & 0 deletions MAINTAINER
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Thomas Fehr <tom@suse.de>
18 changes: 18 additions & 0 deletions Makefile.cvs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# Makefile.cvs
#
configure: all
./configure

all:
y2tool y2autoconf
y2tool y2automake
autoreconf --force --install

install: configure
make
make install

reconf: all
./config.status --recheck
./config.status
2 changes: 2 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
yast2-config-XXpkgXX is part of YaST2
See the file COPYRIGHT.english for license terms
1 change: 1 addition & 0 deletions RPMNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
yast2-country
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.6.0
12 changes: 12 additions & 0 deletions configure.in.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## YCP module configure.in.in

## Initialize
@YAST2-INIT-COMMON@
@YAST2-INIT-YCP@

## some common checks
@YAST2-CHECKS-COMMON@
@YAST2-CHECKS-YCP@

## and generate the output...
@YAST2-OUTPUT@
2 changes: 2 additions & 0 deletions console/.cvsignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Makefile
Makefile.in
3 changes: 3 additions & 0 deletions console/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#
# Makefile.am for country/console
SUBDIRS = agents data src
4 changes: 4 additions & 0 deletions console/agents/.cvsignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Makefile
Makefile.in
bak
bak/*
5 changes: 5 additions & 0 deletions console/agents/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# Makefile.am for country/console/agents
#
scrconf_DATA = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/*.scr))
EXTRA_DIST = $(scrconf_DATA)
17 changes: 17 additions & 0 deletions console/agents/cfg_console.scr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* File:
* cfg_console.scr
* Summary:
* SCR Agent for reading/writing /etc/sysconfig/console
* using the sysconfig-agent
*
* $Id$
*
* Read/Sets the values defined in <tt>/etc/sysconfig/console</tt>
* in an easy manner.
*/
.sysconfig.console

`ag_ini(
SysConfigFile("/etc/sysconfig/console")
)
4 changes: 4 additions & 0 deletions console/data/.cvsignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Makefile
Makefile.in
bak
bak/*
6 changes: 6 additions & 0 deletions console/data/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# Makefile.am for country/console/data
#
#
ydata_DATA = consolefonts.ycp
EXTRA_DIST = $(ydata_DATA)
73 changes: 73 additions & 0 deletions console/data/consolefonts.ycp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
$[
// LANG font unicode map screen map, console magic encoding
"en_GB@euro" : [ "lat9w-16.psfu", "", "trivial", "(K", "ISO-8859-15" ],
"en_GB" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],
"en_US" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],
"en" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],

"de_DE@euro" : [ "lat9w-16.psfu", "", "trivial", "(B", "ISO-8859-15" ],
"de_DE" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],
"de_CH" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],
"de" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],

"fr_FR@euro" : [ "lat9w-16.psfu", "", "trivial", "(B", "ISO-8859-15" ],
"fr_FR" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],
"fr_CH" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],
"fr" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],

"it_IT@euro" : [ "lat9w-16.psfu", "", "trivial", "(K", "ISO-8859-15" ],
"it_IT" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],
"it" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],

"es_ES@euro" : [ "lat9w-16.psfu", "", "trivial", "(B", "ISO-8859-15" ],
"es_ES" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],
"es" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],

"nl_NL@euro" : [ "lat9w-16.psfu", "", "trivial", "(K", "ISO-8859-15" ],
"nl_NL" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],
"nl" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],

"pt_PT@euro" : [ "lat9w-16.psfu", "", "trivial", "(K", "ISO-8859-15" ],
"pt_PT" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],
"pt_BR" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],
"pt" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],

"ca_ES@euro" : [ "lat9w-16.psfu", "", "trivial", "(K", "ISO-8859-15" ],
"ca_ES" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],
"ca" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],

"gl_ES@euro" : [ "lat9w-16.psfu", "", "trivial", "(K", "ISO-8859-15" ],
"gl_ES" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],
"gl" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],

"br_FR@euro" : [ "lat9w-16.psfu", "", "trivial", "(K", "ISO-8859-15" ],
"br_FR" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],
"br" : [ "lat1-16.psfu", "", "none", "(B", "ISO-8859-1" ],

"el_GR" : [ "lat7-16.psfu", "", "trivial", "(K", "ISO-8859-7" ],
"el" : [ "lat7-16.psfu", "", "trivial", "(K", "ISO-8859-7" ],

"pl_PL" : [ "lat2-16.psfu", "", "trivial", "(K", "ISO-8859-2" ],
"pl" : [ "lat2-16.psfu", "", "trivial", "(K", "ISO-8859-2" ],

"cs_CZ" : [ "lat2-16.psfu", "", "trivial", "(K", "ISO-8859-2" ],
"cs" : [ "lat2-16.psfu", "", "trivial", "(K", "ISO-8859-2" ],

"sk_SK" : [ "lat2-16.psfu", "", "trivial", "(K", "ISO-8859-2" ],
"sk" : [ "lat2-16.psfu", "", "trivial", "(K", "ISO-8859-2" ],

"hu_HU" : [ "lat2-16.psfu", "", "trivial", "(K", "ISO-8859-2" ],
"hu" : [ "lat2-16.psfu", "", "trivial", "(K", "ISO-8859-2" ],

"lt_LT" : [ "lt-brim-8x14.psfu","", "trivial", "(K", "ISO-8859-13" ],
"lt" : [ "lt-brim-8x14.psfu","", "trivial", "(K", "ISO-8859-13" ],

"ru_RU.KOI8-R" : [ "Cyr_a8x16.psfu", "", "koi2alt", "(K", "KOI8-R" ],
"ru" : [ "Cyr_a8x16.psfu", "", "koi2alt", "(K", "ISO-8859-5" ],

"ja_JP.sjis" : [ "lat9w-16.psfu", "", "trivial", "(K", "sjis" ],
"ja" : [ "lat1-16.psfu", "", "none", "(K", "sjis" ],

"tr_TR" : [ "lat5-16.psfu", "", "none", "(K", "ISO-8859-9" ],
"tr" : [ "lat5-16.psfu", "", "none", "(K", "ISO-8859-9" ]
]
196 changes: 196 additions & 0 deletions console/src/Console.ycp
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
/**
* File:
* Console.ycp
*
* Module:
* Console
*
* Depends:
* Language
*
* Summary:
* provide console specific stuff (esp. font and encoding)
*<BR>
* sysconfig /etc/sysconfig/console:<BR>
*<UL>
*<LI> CONSOLE_FONT string console font</LI>
*<LI> CONSOLE_SCREENMAP string console screenmap</LI>
*<LI> CONSOLE_UNICODEMAP string console unicode map</LI>
*<LI> CONSOLE_MAGIC string console magic control sequence</LI>
*<LI> CONSOLE_ENCODING string console encoding</LI>
*</UL>
*
* $Id$
*
* Author:
* Klaus Kaempf <kkaempf@suse.de>
*
*/

{
module "Console";

import "Mode";

/**
* @return encoding string defining current (ISO) encoding
*/
global string encoding = "ISO-8859-1";

// current base language, used in Check
string language = "en_US";

string font = "lat1-16.psfu";
string unicodeMap = "";
string screenMap = "none";
string magic = "(B";

// non-empty if serial console (written /etc/inittab)
// -> S0:123:respawn:/sbin/agetty -L 9600<n8> ttyS0
// something like "ttyS0,9600" from /etc/install.inf
string serial = "";

/**
* activate a language specific console font
*
* @param string language ISO code of language
* @return string encoding encoding for console i/o
*/

global define string SelectFont (string lang)
``{

list consolefont = [];

map consolefonts = WFM::Read (.local.yast2, "consolefonts.ycp");
map languages_map = WFM::Read (.local.yast2, "language.ycp");

list language_info = languages_map[lang]:nil;
if (language_info != nil)
{
string fqlanguage = lang
+ language_info[2]:"" // mandatory-LANG-modifier
+ language_info[3]:""; // optional-LANG-modifier
consolefont = consolefonts[fqlanguage]:[];
}
else
{
consolefont = consolefonts[lang]:[];
}

if ((size (consolefont) == 0)
&& (size (lang) > 2))
{
consolefont = consolefonts[substring(lang, 0, 2)]:[];
}

if (size (consolefont) > 0)
{
language = lang;

font = consolefont[0]:"";
unicodeMap = consolefont[1]:"";
screenMap = consolefont[2]:"";
magic = consolefont[3]:"";
encoding = consolefont[4]:"";

if (Mode::braille)
{
SCR::Execute (.target.bash, "/usr/bin/setfont");
}
else
{
UI::SetConsoleFont (magic, font, screenMap, unicodeMap, encoding);
}
}

return encoding;
};

/**
* save data to system (rc.config agent)
*/

global define void Save ()
``{
SCR::Write (.sysconfig.console.CONSOLE_FONT, font);
SCR::Write (.sysconfig.console.CONSOLE_SCREENMAP, screenMap);
SCR::Write (.sysconfig.console.CONSOLE_UNICODEMAP, unicodeMap);
SCR::Write (.sysconfig.console.CONSOLE_MAGIC, magic);

SCR::Write (.sysconfig.console.CONSOLE_ENCODING.comment, "\n# Encoding used for output of non-ascii characters.\n#\n");
SCR::Write (.sysconfig.console.CONSOLE_ENCODING, encoding);
SCR::Write (.sysconfig.console, nil);

if (serial != "")
{
list splitserial = splitstring (serial, ",");
string tty = splitserial[0]:"";
string baud = splitserial[1]:"";
if ((tty != "") && (baud != ""))
{
string initline = sformat ("S0:123:respawn:/sbin/agetty -L %1 %2", baud, tty);
//SCR::Write (.etc.inittab.S0, initline);
SCR::Execute (.target.bash, "/bin/grep -v S0 /etc/inittab >/tmp/inittab");
SCR::Execute (.target.bash, "/bin/echo '" + initline + "' >>/tmp/inittab");
SCR::Execute (.target.bash, "/bin/mv /tmp/inittab /etc/inittab");
SCR::Execute (.target.bash, "/bin/echo " + tty + " >>/etc/securetty");
}
}
}

/**
* restore data to system (rc.config agent)
* returns encoding
*/

global define string Restore ()
``{
font = SCR::Read (.sysconfig.console.CONSOLE_FONT);
screenMap = SCR::Read (.sysconfig.console.CONSOLE_SCREENMAP);
unicodeMap = SCR::Read (.sysconfig.console.CONSOLE_UNICODEMAP);
magic = SCR::Read (.sysconfig.console.CONSOLE_MAGIC);
encoding = SCR::Read (.sysconfig.console.CONSOLE_ENCODING);
if (Mode::braille)
{
SCR::Execute (.target.bash, "/usr/bin/setfont");
}
else
{
UI::SetConsoleFont (magic, font, screenMap, unicodeMap, encoding);
}
return encoding;
}

/**
* Check current configuration
* This function should be called to check consistency with
* other modules (mentioned as Depends in the header)
* @return 0 if no change
* 1 change due to dependency with other module
* 2 inconsistency detected
*
*/

global define boolean Check ()
``{

return 0;
}

/**
* constructor
* does nothing in initial mode
* restores console configuration from /etc/sysconfig
* in normal mode
*/

global define void Console ()
``{
if (Mode::initial)
string serial = Mode::installMap["console"]:"";
else
Restore();
return;
}
}
5 changes: 5 additions & 0 deletions console/src/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# Makefile.am for country/console/src
#
module_DATA = Console.ycp
EXTRA_DIST = $(module_DATA)
Loading

0 comments on commit 3057e5c

Please sign in to comment.