Bug#839591: Update keytab-lilo to work on modern Debian systems

2018-11-30 Thread Raphaël Halimi
Hi,

Here is a refreshed patch (in Git format) to be applied on version 1:24.2-4.

Since it adds a quilt patch, the warnings about white space errors from
git am are normal.

Regards,

-- 
Raphaël Halimi
From 1854cbba093384d44bb670eb8237ece85f52d6e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20Halimi?= 
Date: Sun, 2 Oct 2016 16:14:04 +0200
Subject: [PATCH 1/2] Add patch to fix keytab-lilo.pl

---
 debian/patches/10_fix-keytab-lilo.patch | 45 +
 debian/patches/series   |  1 +
 2 files changed, 46 insertions(+)
 create mode 100644 debian/patches/10_fix-keytab-lilo.patch

diff --git a/debian/patches/10_fix-keytab-lilo.patch b/debian/patches/10_fix-keytab-lilo.patch
new file mode 100644
index 000..343e7b5
--- /dev/null
+++ b/debian/patches/10_fix-keytab-lilo.patch
@@ -0,0 +1,45 @@
+Description: Various fixes for keytab-lilo
+ This patch updates keytab-lilo to work on modern Debian systems:
+   - Support for kbd 2.0.3 format (from Olivier Brunel, see
+ http://www.syslinux.org/archives/2015-December/024690.html)
+   - Use new keymaps ".kmap" extension (from syslinux upstream)
+   - Add headers (from syslinux upstream)
+Author: Raphaël Halimi 
+Origin: other
+Last-Update: 2016-10-02
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/keytab-lilo.pl
 b/keytab-lilo.pl
+@@ -1,4 +1,8 @@
+ #!/usr/bin/perl
++
++eval { use bytes; };
++eval { binmode STDOUT; };
++
+ $DEFAULT_MAP = "us";
+ $DEFAULT_EXT = ".kmap";
+ 
+@@ -6,8 +10,8 @@
+ {
+ print STDERR
+   "usage: $0 [ -p old_code=new_code ] ...\n".
+-  (" "x(8+length $0))."[path]default_layout[.map] ] ".
+-  "[path]kbd_layout[.map]\n";
++  (" "x(8+length $0))."[path]default_layout[.kmap] ] ".
++  "[path]kbd_layout[.kmap]\n";
+ exit 1;
+ }
+ 
+@@ -44,9 +48,9 @@
+ $empty = 1;
+ while () {
+ 	chop;
+-	if (/^(static\s+)?u_short\s+(\S+)_map\[\S*\]\s+=\s+{\s*$/) {
++	if (/^(static\s+)?(u_|unsigned )short\s+(\S+)_map\[\S*\]\s+=\s+{\s*$/) {
+ 	die "active at beginning of map" if defined $current;
+-	$current = $pfx.":".$2;
++	$current = $pfx.":".$3;
+ 	next;
+ 	}
+ 	undef $current if /^};\s*$/;
diff --git a/debian/patches/series b/debian/patches/series
index 69f49c8..39129ad 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@
 07_hardening-cflags+cppflags.patch
 08_small-typos-in-manpages.patch
 09_fix-manpage-lilo-conf-5.patch
+10_fix-keytab-lilo.patch
-- 
2.19.1



signature.asc
Description: OpenPGP digital signature


Bug#839591: Update keytab-lilo to work on modern Debian systems

2016-10-02 Thread Raphaël Halimi
Package: lilo
Version: 1:24.2-2
Severity: minor
Tags: patch

Hi,

keytab-lilo is useful to people maintaining a PXE server, because
syslinux uses the lilo keytable format for its keymaps.

Here is a patch to make keytab-lilo work out-of-the-box (provided you
add a Recommends or Suggests on console-data).

Regards,

-- 
Raphaël Halimi

Description: Various fixes for keytab-lilo
 This patch updates keytab-lilo to work on modern Debian systems:
   - Support for kbd 2.0.3 format (from Olivier Brunel, see
 http://www.syslinux.org/archives/2015-December/024690.html)
   - Use new keymaps ".kmap" extension (from syslinux upstream)
   - Add headers (from syslinux upstream)
Author: Raphaël Halimi 
Origin: other
Last-Update: 2016-10-02
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/keytab-lilo.pl
+++ b/keytab-lilo.pl
@@ -1,4 +1,8 @@
 #!/usr/bin/perl
+
+eval { use bytes; };
+eval { binmode STDOUT; };
+
 $DEFAULT_MAP = "us";
 $DEFAULT_EXT = ".kmap";
 
@@ -6,8 +10,8 @@
 {
 print STDERR
   "usage: $0 [ -p old_code=new_code ] ...\n".
-  (" "x(8+length $0))."[path]default_layout[.map] ] ".
-  "[path]kbd_layout[.map]\n";
+  (" "x(8+length $0))."[path]default_layout[.kmap] ] ".
+  "[path]kbd_layout[.kmap]\n";
 exit 1;
 }
 
@@ -44,9 +48,9 @@
 $empty = 1;
 while () {
 	chop;
-	if (/^(static\s+)?u_short\s+(\S+)_map\[\S*\]\s+=\s+{\s*$/) {
+	if (/^(static\s+)?(u_|unsigned )short\s+(\S+)_map\[\S*\]\s+=\s+{\s*$/) {
 	die "active at beginning of map" if defined $current;
-	$current = $pfx.":".$2;
+	$current = $pfx.":".$3;
 	next;
 	}
 	undef $current if /^};\s*$/;



signature.asc
Description: OpenPGP digital signature