SHA256
1
0
forked from pool/kbd

Accepting request 838620 from Base:System

OBS-URL: https://build.opensuse.org/request/show/838620
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kbd?expand=0&rev=102
This commit is contained in:
Dominique Leuenberger 2020-10-03 16:53:50 +00:00 committed by Git OBS Bridge
commit 15caaa4678
10 changed files with 100 additions and 159 deletions

View File

@ -2,14 +2,14 @@ Index: docs/man/man1/dumpkeys.1.in
===================================================================
--- docs/man/man1/dumpkeys.1.in.orig
+++ docs/man/man1/dumpkeys.1.in
@@ -4,6 +4,7 @@
dumpkeys \- dump keyboard translation tables
.SH SYNOPSIS
@@ -6,6 +6,7 @@ dumpkeys \- dump keyboard translation ta
.B dumpkeys
+.RI [ \-C\ '<vc>' | \-\-console='<vc>' ]
[
.\".B \-1Vdfhiklnstv
+.RI [ \-C\ '<vc>' | \-\-console='<vc>' ]
.B \-h \-\-help \-i \-\-short\-info \-l \-s \-\-long\-info
.B \-n \-\-numeric \-f \-\-full\-table \-1 \-\-separate-lines
.BI \-S shape
@@ -212,6 +213,12 @@ loadkeys how to interpret the keymap. (F
.B \-V \-\-version
Prints version number and exits.
@ -21,62 +21,5 @@ Index: docs/man/man1/dumpkeys.1.in
+) option. This option supports exactly one device name.
+.LP
.SH FILES
.PD 0
.TP 20
Index: src/dumpkeys.c
===================================================================
--- src/dumpkeys.c.orig
+++ src/dumpkeys.c
@@ -41,6 +41,8 @@ usage(int rc)
" -t, --funcs-only display only the function key strings;\n"
" -k, --keys-only display only key bindings;\n"
" -d, --compose-only display only compose key combinations;\n"
+ " -C <vc>\n"
+ " --console=<vc> Indicate the virtual console device to be used;\n"
" -c, --charset="));
lk_list_charsets(stderr);
fprintf(stderr, _(
@@ -55,7 +57,7 @@ usage(int rc)
int main(int argc, char *argv[])
{
- const char *short_opts = "hilvsnf1tkdS:c:V";
+ const char *short_opts = "hilvsnf1tkdS:C:c:V";
const struct option long_opts[] = {
{ "help", no_argument, NULL, 'h' },
{ "short-info", no_argument, NULL, 'i' },
@@ -68,6 +70,7 @@ int main(int argc, char *argv[])
{ "keys-only", no_argument, NULL, 'k' },
{ "compose-only", no_argument, NULL, 'd' },
{ "charset", required_argument, NULL, 'c' },
+ { "console", required_argument, NULL, 'C' },
{ "verbose", no_argument, NULL, 'v' },
{ "version", no_argument, NULL, 'V' },
{ NULL, 0, NULL, 0 }
@@ -82,6 +85,7 @@ int main(int argc, char *argv[])
char funcs_only = 0;
char keys_only = 0;
char diac_only = 0;
+ char * console = NULL;
struct lk_ctx *ctx;
@@ -135,6 +139,9 @@ int main(int argc, char *argv[])
}
printf("charset \"%s\"\n", optarg);
break;
+ case 'C':
+ console = optarg;
+ break;
case 'V':
print_version_and_exit();
break;
@@ -150,7 +157,7 @@ int main(int argc, char *argv[])
if (optind < argc)
usage(EX_USAGE);
- if ((fd = getfd(NULL)) < 0)
+ if ((fd = getfd(console)) < 0)
kbd_error(EXIT_FAILURE, 0, _("Couldn't get a file descriptor referring to the console"));
/* check whether the keyboard is in Unicode mode */
.TP
.I @DATADIR@/keymaps

View File

@ -1,10 +1,10 @@
Index: kbd-2.2.0/src/kdfontop.c
Index: kbd-2.3.0/src/libkfont/kdfontop.c
===================================================================
--- kbd-2.2.0.orig/src/kdfontop.c
+++ kbd-2.2.0/src/kdfontop.c
@@ -169,6 +169,23 @@ int putfont(int fd, unsigned char *buf,
return 0;
}
--- kbd-2.3.0.orig/src/libkfont/kdfontop.c
+++ kbd-2.3.0/src/libkfont/kdfontop.c
@@ -321,6 +321,23 @@ kfont_put_font(struct kfont_context *ctx
if (ret <= 0)
return ret;
+#if 1
+ // We no longer try PIO_FONT* calls.
@ -19,16 +19,16 @@ Index: kbd-2.2.0/src/kdfontop.c
+ // b) Without the old compat calls, it should be easier to
+ // fix this in kernel side.
+ //
+ fprintf(stderr, "%s: putfont: %d,%dx%d: failed: %d\n", get_progname(), count, width, height, i);
+ fprintf(stderr, "%s: putfont: %d,%dx%d: failed: %d\n", get_progname(), count, width, height, ret);
+ perror("putfont: KDFONTOP");
+ return -1;
+#else
/* Second attempt: PIO_FONTX */
cfd.charcount = count;
cfd.charheight = height;
@@ -191,4 +208,5 @@ int putfont(int fd, unsigned char *buf,
return -1;
}
return 0;
ret = put_font_piofontx(ctx, fd, buf, count, width, height);
if (ret <= 0)
@@ -328,4 +345,5 @@ kfont_put_font(struct kfont_context *ctx
/* Third attempt: PIO_FONT */
return put_font_piofont(ctx, fd, buf, count, width, height);
+#endif
}

View File

@ -1,20 +1,20 @@
Index: kbd-2.2.0/src/loadkeys.c
Index: kbd-2.3.0/src/loadkeys.c
===================================================================
--- kbd-2.2.0.orig/src/loadkeys.c
+++ kbd-2.2.0/src/loadkeys.c
@@ -24,7 +24,7 @@
#include "paths.h"
#include "keymap.h"
--- kbd-2.3.0.orig/src/loadkeys.c
+++ kbd-2.3.0/src/loadkeys.c
@@ -27,6 +27,8 @@
-static const char *const dirpath1[] = { "", DATADIR "/" KEYMAPDIR "/**", KERNDIR "/", 0 };
+static const char *const dirpath1[] = { "", DATADIR "/" KEYMAPDIR "/**", DATADIR "/" XKBKEYMAPDIR "/", DATADIR "/" LEGACYKEYMAPDIR "/**", KERNDIR "/", 0 };
static const char *const suffixes[] = { "", ".kmap", ".map", 0 };
static void __attribute__((noreturn))
Index: kbd-2.2.0/src/paths.h
static const char *const dirpath1[] = {
"",
+ DATADIR "/" XKBKEYMAPDIR "/",
+ DATADIR "/" LEGACYKEYMAPDIR "/**",
DATADIR "/" KEYMAPDIR "/**",
KERNDIR "/",
NULL
Index: kbd-2.3.0/src/paths.h
===================================================================
--- kbd-2.2.0.orig/src/paths.h
+++ kbd-2.2.0/src/paths.h
--- kbd-2.3.0.orig/src/paths.h
+++ kbd-2.3.0/src/paths.h
@@ -5,6 +5,8 @@
* The following five subdirectories are defined:
*/

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8c769445fb7342e032105ede63848f3d9c90bd380115d47b378fd3452655bc6c
size 1132436

3
kbd-2.3.0-repack.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5756c79bad9765cdf52980b84ad5bd4333dcead39a65d602cef20a6a849749ea
size 783172

View File

@ -1,3 +1,48 @@
-------------------------------------------------------------------
Fri Sep 25 10:28:40 UTC 2020 - Dominique Leuenberger <dimstar@opensuse.org>
- Do not package libtswrap.so.0: it's only used by the test suite
in a LD_PRELOAD fashion.
-------------------------------------------------------------------
Thu Sep 24 00:08:45 UTC 2020 - Stanislav Brabec <sbrabec@suse.com>
- Update to version 2.3.0:
* Added libkfont library (internal yet).
* Added Canadian Multilingual Standard keyboard map.
* Added us1 that maps Right Alt to AltGr and Shift+Tab to
Alt+Tab.
* The dead_macron is used instead of macron in fi.map.
* Added retries when switching to the console (chvt, openvt).
* Added option -d to double size of font (setfont).
* Added long options, help messages.
* Added solar24x32 font.
* Updated eurlatgr font.
* Fixed problems with formatting man pages.
* Fixed search path error (boo#1176854).
- Refresh partially upstreamed kbd-1.15.2-dumpkeys-C-opt.patch
- Drop upstreamed libkeymap-Fix-mk_mapname-for-the-plain-map.patch
- Refresh kbd-1.15.2-setfont-no-cruft.patch and
kbd-1.15.5-loadkeys-search-path.patch
-------------------------------------------------------------------
Tue Sep 22 08:45:57 UTC 2020 - Guillaume GARDET <guillaume.gardet@opensuse.org>
- Refresh patch to fix build on non-x86 architecture broken
by previous commit:
* kbdsettings-nox86.patch
-------------------------------------------------------------------
Thu Sep 17 22:43:16 UTC 2020 - Stanislav Brabec <sbrabec@suse.com>
- Make kbdsettings working in both bash and dash (boo#1175040).
-------------------------------------------------------------------
Thu Sep 17 14:47:04 UTC 2020 - Stanislav Brabec <sbrabec@suse.com>
- Fix kbd-1.15.5-loadkeys-search-path.patch to prefer xkb keymaps
(boo#1176302).
-------------------------------------------------------------------
Thu Aug 20 11:34:32 UTC 2020 - Jiri Slaby <jslaby@suse.com>

View File

@ -24,16 +24,16 @@
%define legacy_folders amiga,atari,i386,include,mac,ppc,sun
Name: kbd
Version: 2.2.0
Version: 2.3.0
Release: 0
Summary: Keyboard and Font Utilities
# git: git://git.altlinux.org/people/legion/packages/kbd.git
License: GPL-2.0-or-later
Group: System/Console
URL: http://kbd-project.org/
# repack_kbd.sh on ftp://ftp.altlinux.org/pub/people/legion/kbd/kbd-%{version}.tar.xz
# repack_kbd.sh on ftp://ftp.altlinux.org/pub/people/legion/kbd/kbd-%%{version}.tar.xz
# or
# repack_kbd.sh on ftp://ftp.kernel.org/pub/linux/utils/kbd/kbd-%{version}.tar.xz
# repack_kbd.sh on ftp://ftp.kernel.org/pub/linux/utils/kbd/kbd-%%{version}.tar.xz
Source: %{name}-%{version}-repack.tar.xz
Source1: kbd_fonts.tar.bz2
Source2: suse-add.tar.bz2
@ -56,7 +56,6 @@ Patch2: kbd-1.15.2-unicode_scripts.patch
Patch3: kbd-1.15.2-docu-X11R6-xorg.patch
Patch4: kbd-1.15.2-sv-latin1-keycode10.patch
Patch5: kbd-1.15.2-setfont-no-cruft.patch
# TODO: no ideas how to port it.
Patch6: kbd-1.15.2-dumpkeys-C-opt.patch
Patch9: kbd-2.0.2-comment-typo-qwerty.patch
Patch10: kbd-2.0.2-doshell-reference.patch
@ -69,7 +68,7 @@ Patch13: kbd-1.15.5-loadkeys-search-path.patch
Patch14: kbdsettings-nox86.patch
# PATCH-FIX-SLE kbd-unicode-fxxx.patch sbrabec@suse.com bsc1085432 -- Do not cause error on UNICODE characters >= 0xF000 (e. g. ligature fi)
Patch15: kbd-unicode-fxxx.patch
Patch16: libkeymap-Fix-mk_mapname-for-the-plain-map.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bison
BuildRequires: check-devel
@ -77,6 +76,7 @@ BuildRequires: console-setup
BuildRequires: fdupes
BuildRequires: flex
BuildRequires: gcc >= 4.6
BuildRequires: libtool
BuildRequires: pam-devel
BuildRequires: pkgconfig
BuildRequires: suse-module-tools
@ -134,7 +134,6 @@ cp -fp %{SOURCE22} .
%patch14 -p0
%endif
%patch15 -p1
%patch16 -p1
%build
for i in `find data/keymaps/mac -type f` ; do
@ -152,12 +151,14 @@ pushd data/keymaps/i386
test -f olpc/pt.map || mv olpc/pt.map olpc/pt-olpc.map
test -f qwerty/cz.map || mv qwerty/cz.map qwerty/cz-qwerty.map
popd
./autogen.sh
%configure \
--disable-silent-rules \
--datadir=%{kbd} \
--enable-nls \
--localedir=%{_datadir}/locale \
--enable-optional-progs
--enable-optional-progs \
--disable-static
make %{?_smp_mflags}
gcc %{optflags} -o fbtest $RPM_SOURCE_DIR/fbtest.c
%ifarch %{ix86} x86_64
@ -188,6 +189,9 @@ install -m 644 fonts/*/* $K/consolefonts/
# Now call kbd install
echo "# Now call kbd install DESTDIR=%{buildroot} DATA_DIR=%{kbd} MAN_DIR=%{_mandir}"
make DESTDIR=%{buildroot} DATA_DIR=%{kbd} MAN_DIR=%{_mandir} install
# This is an internal library, these files have no use outside kbd.
rm %{buildroot}%{_libdir}/libtswrap.la
rm %{buildroot}%{_libdir}/libtswrap.so*
# ln -s iso01-12x22.psfu $K/consolefonts/suse12x22.psfu
install -m 644 data/consolefonts/README* $DOC/fonts/
mkdir -p $DOC/doc/

View File

@ -7,11 +7,12 @@
for i in NUM SCR CAPS; do
conf=$(eval echo KBD_${i}LOCK)
[ -z ${!conf} ] && continue
param=$(echo ${i,,} | sed 's/scr/scroll/')
eval confval=\"\$$conf\"
[ -z "$confval" ] && continue
param=$(echo $i | tr A-Z a-z | sed 's/scr/scroll/')
for tty in ${KBD_TTY:-tty1 tty2 tty3 tty4 tty5 tty6}; do
case "${!conf}" in
case "$confval" in
yes)
if [ $param = "num" ]; then
touch /run/numlock-on
@ -35,11 +36,11 @@ for i in NUM SCR CAPS; do
/usr/bin/setleds -D -$param < /dev/$tty
fi
else
echo "Value ${!conf} invalid for $conf"
echo "Value $confval invalid for $conf"
fi
;;
*)
echo "error: unknown value ${!conf} in $conf"
echo "error: unknown value $confval in $conf"
;;
esac
done

View File

@ -15,11 +15,11 @@
- /usr/bin/setleds -D -$param < /dev/$tty
- fi
- else
- echo "Value ${!conf} invalid for $conf"
- echo "Value $confval invalid for $conf"
- fi
- ;;
*)
echo "error: unknown value ${!conf} in $conf"
echo "error: unknown value $confval in $conf"
;;
--- sysconfig.keyboard
+++ sysconfig.keyboard

View File

@ -1,52 +0,0 @@
From: Alexey Gladkov <gladkov.alexey@gmail.com>
Date: Sun, 23 Feb 2020 18:24:59 +0100
Subject: libkeymap: Fix mk_mapname for the plain map
Patch-mainline: 2.3
Git-commit: 88ae58fe8a223d11307accc36cc293133a18e7ac
mk_mapname did not correctly return "plain" for the plain map (no modifier set)
if it had already been called, as it did not correctly reset the static buffer
that it uses for the map name. When mk_mapname is called for the first time
from the first loop in lk_dump_ctable, all is fine, since buf has not been used
yet and it is initialised to 0. However, when it is called again for the plain
map from the second loop in lk_dump_ctable, buf already contains a value (left
over from the last iteration in the first loop), and then strcat appends
"plain" to that value instead of overwriting it, resulting in a bogus value.
Reported-by: Javier Pello <javier.pello@urjc.es>
Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
src/libkeymap/dump.c | 2 +-
tests/data/dumpkeys-mktable/defkeymap.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libkeymap/dump.c b/src/libkeymap/dump.c
index 8531b5aa3d91..d67eefaada54 100644
--- a/src/libkeymap/dump.c
+++ b/src/libkeymap/dump.c
@@ -101,7 +101,7 @@ mk_mapname(char modifier)
int i;
if (!modifier) {
- strcat(buf, "plain");
+ strcpy(buf, "plain");
return buf;
}
buf[0] = 0;
diff --git a/tests/data/dumpkeys-mktable/defkeymap.c b/tests/data/dumpkeys-mktable/defkeymap.c
index e831316a1ff3..5d9a3aaeff8c 100644
--- a/tests/data/dumpkeys-mktable/defkeymap.c
+++ b/tests/data/dumpkeys-mktable/defkeymap.c
@@ -565,7 +565,7 @@ static unsigned short shift_altgr_ctrl_alt_map[NR_KEYS] = {
};
ushort *key_maps[MAX_NR_KEYMAPS] = {
- shift_altgr_ctrl_altplain_map, shift_map, altgr_map, shift_altgr_map,
+ plain_map, shift_map, altgr_map, shift_altgr_map,
ctrl_map, shift_ctrl_map, altgr_ctrl_map, shift_altgr_ctrl_map,
alt_map, shift_alt_map, altgr_alt_map, shift_altgr_alt_map,
ctrl_alt_map, shift_ctrl_alt_map, altgr_ctrl_alt_map, shift_altgr_ctrl_alt_map, 0
--
2.28.0