aboutsummaryrefslogtreecommitdiffstats
path: root/main/kbd
diff options
context:
space:
mode:
Diffstat (limited to 'main/kbd')
-rw-r--r--main/kbd/0001-libkbdfile-Check-compression-suffix-even-if-the-suff.patch68
-rw-r--r--main/kbd/APKBUILD6
2 files changed, 72 insertions, 2 deletions
diff --git a/main/kbd/0001-libkbdfile-Check-compression-suffix-even-if-the-suff.patch b/main/kbd/0001-libkbdfile-Check-compression-suffix-even-if-the-suff.patch
new file mode 100644
index 0000000000..f3e8628af0
--- /dev/null
+++ b/main/kbd/0001-libkbdfile-Check-compression-suffix-even-if-the-suff.patch
@@ -0,0 +1,68 @@
+From 7e27102b6fc6991a6a4eca422b513781a26b1639 Mon Sep 17 00:00:00 2001
+From: Alexey Gladkov <gladkov.alexey@gmail.com>
+Date: Wed, 21 Aug 2019 13:29:16 +0200
+Subject: [PATCH] libkbdfile: Check compression suffix even if the suffix is
+ part of filename
+
+Link: https://github.com/legionus/kbd/issues/32
+
+Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
+---
+ src/libkbdfile/kbdfile.c | 25 ++++++++++++-------------
+ src/libkbdfile/kbdfile.h | 2 ++
+ 2 files changed, 14 insertions(+), 13 deletions(-)
+
+diff --git a/src/libkbdfile/kbdfile.c b/src/libkbdfile/kbdfile.c
+index fb8e035..487b434 100644
+--- a/src/libkbdfile/kbdfile.c
++++ b/src/libkbdfile/kbdfile.c
+@@ -344,20 +344,13 @@ StartScan:
+ snprintf(fp->pathname, sizeof(fp->pathname), "%s/%s%s%s", dir, fnam, suf[index], (dc ? dc->ext : ""));
+
+ if (!dc) {
+- fp->flags &= ~KBDFILE_PIPE;
+- fp->fd = fopen(fp->pathname, "r");
++ rc = maybe_pipe_open(fp);
++ goto EndScan;
++ }
+
+- if (!(fp->fd)) {
+- strerror_r(errno, errbuf, sizeof(errbuf));
+- ERR(fp->ctx, "fopen: %s: %s", fp->pathname, errbuf);
+- rc = -1;
+- goto EndScan;
+- }
+- } else {
+- if (pipe_open(dc, fp) < 0) {
+- rc = -1;
+- goto EndScan;
+- }
++ if (pipe_open(dc, fp) < 0) {
++ rc = -1;
++ goto EndScan;
+ }
+ }
+
+@@ -457,3 +450,9 @@ kbdfile_open(struct kbdfile_ctx *ctx, const char *filename)
+
+ return fp;
+ }
++
++int
++kbdfile_is_compressed(struct kbdfile *fp)
++{
++ return (fp->flags & KBDFILE_PIPE);
++}
+diff --git a/src/libkbdfile/kbdfile.h b/src/libkbdfile/kbdfile.h
+index 412179a..0318a8e 100644
+--- a/src/libkbdfile/kbdfile.h
++++ b/src/libkbdfile/kbdfile.h
+@@ -45,6 +45,8 @@ int kbdfile_set_pathname(struct kbdfile *fp, const char *pathname);
+ FILE *kbdfile_get_file(struct kbdfile *fp);
+ int kbdfile_set_file(struct kbdfile *fp, FILE *x);
+
++int kbdfile_is_compressed(struct kbdfile *fp);
++
+ #include <syslog.h>
+
+ void
diff --git a/main/kbd/APKBUILD b/main/kbd/APKBUILD
index c5e7a1116a..119509db26 100644
--- a/main/kbd/APKBUILD
+++ b/main/kbd/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=kbd
pkgver=2.2.0
-pkgrel=0
+pkgrel=1
pkgdesc="Tools for configuring the console (keyboard, virtual terminals, etc.)"
url="http://ftp.altlinux.org/pub/people/legion/kbd"
arch="all"
@@ -17,6 +17,7 @@ source="https://www.kernel.org/pub/linux/utils/kbd/kbd-$pkgver.tar.gz
error.h
fix-tests.patch
+ 0001-libkbdfile-Check-compression-suffix-even-if-the-suff.patch
"
_datadir=/usr/share
@@ -177,4 +178,5 @@ sha512sums="17f70402126e545c318a5de0265875135b6ebdc0ff9905cb8094dc74a5b27a9d6ced
64b5ab4c362350521da8f507d22c0b77784da99bbe1b32f0c001cd826f63c607e3f9cd6af01f06a61af8bd709760bbf2bb3cfe2010c33925f2987a1af6ef4998 loadkeys.initd
12028796552a5ffed1d5cb19d37fc6a73fb4f2e2bf34d837a81171c7ebee98d6c3f557715bf79706d79ce053b9b2450cd8cf1c4ea045428fb7d8a5915ae3ed78 loadkeys.confd
c66f6b0d8c8b8d285c740bdbe7130dee272ac01cd5e73b35a58cedf1a77fe8d9e062631b804fb58014d8eb9861c8f28aed07bc022ef31662bcc61b5c85a21752 error.h
-bb67e5bb933a48f4a04402e07d7d67169a97485e6b469f8ccd4436466eb17ec2ddcf0ef74d22b3aae9e813feaee5bef0822ec50c384e0276a8c91f9325502a5f fix-tests.patch"
+bb67e5bb933a48f4a04402e07d7d67169a97485e6b469f8ccd4436466eb17ec2ddcf0ef74d22b3aae9e813feaee5bef0822ec50c384e0276a8c91f9325502a5f fix-tests.patch
+edd53405ae22c19c0c4384318fde7bdea27de5428931b304b1d1a02bc268aea147ec9ff2c7296f7f22ee1b544c6ba30688d77e85a3f8751d4c5bcbe80fd0e518 0001-libkbdfile-Check-compression-suffix-even-if-the-suff.patch"