[arch-commits] Commit in systemd/trunk (2 files)

Christian Hesse eworm at archlinux.org
Fri Apr 16 10:37:40 UTC 2021


    Date: Friday, April 16, 2021 @ 10:37:40
  Author: eworm
Revision: 412703

upgpkg: systemd 248-5: work around issue in systemd-boot

Added:
  systemd/trunk/0003-PARTIAL-REVERT-commit-tree-wide-replace-strverscmp-and-str_verscmp-with-strverscmp_improved.patch
Modified:
  systemd/trunk/PKGBUILD

--------------------------------------------------------------------------------------------------------+
 0003-PARTIAL-REVERT-commit-tree-wide-replace-strverscmp-and-str_verscmp-with-strverscmp_improved.patch |   78 ++++++++++
 PKGBUILD                                                                                               |   10 +
 2 files changed, 86 insertions(+), 2 deletions(-)

Added: 0003-PARTIAL-REVERT-commit-tree-wide-replace-strverscmp-and-str_verscmp-with-strverscmp_improved.patch
===================================================================
--- 0003-PARTIAL-REVERT-commit-tree-wide-replace-strverscmp-and-str_verscmp-with-strverscmp_improved.patch	                        (rev 0)
+++ 0003-PARTIAL-REVERT-commit-tree-wide-replace-strverscmp-and-str_verscmp-with-strverscmp_improved.patch	2021-04-16 10:37:40 UTC (rev 412703)
@@ -0,0 +1,78 @@
+From 9021729667e019defea0d4c1bdf563d629d7d837 Mon Sep 17 00:00:00 2001
+From: Ernesto Castellotti <mail at ernestocastellotti.it>
+Date: Sat, 10 Apr 2021 18:59:14 +0200
+Subject: [PATCH] PARTIAL REVERT commit tree-wide: replace strverscmp() and
+ str_verscmp() with strverscmp_improved
+
+This is a workaround for the issue https://github.com/systemd/systemd/issues/19191
+---
+ src/boot/efi/boot.c | 49 ++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 48 insertions(+), 1 deletion(-)
+
+diff --git a/src/boot/efi/boot.c b/src/boot/efi/boot.c
+index 35248db009bf..75c7e2c61d19 100644
+--- a/src/boot/efi/boot.c
++++ b/src/boot/efi/boot.c
+@@ -914,6 +914,53 @@ static VOID config_entry_free(ConfigEntry *entry) {
+         FreePool(entry);
+ }
+ 
++static BOOLEAN is_digit(CHAR16 c) {
++        return (c >= '0') && (c <= '9');
++}
++static UINTN c_order(CHAR16 c) {
++        if (c == '\0')
++                return 0;
++        if (is_digit(c))
++                return 0;
++        else if ((c >= 'a') && (c <= 'z'))
++                return c;
++        else
++                return c + 0x10000;
++}
++static INTN str_verscmp(CHAR16 *s1, CHAR16 *s2) {
++        CHAR16 *os1 = s1;
++        CHAR16 *os2 = s2;
++        while (*s1 || *s2) {
++                INTN first;
++                while ((*s1 && !is_digit(*s1)) || (*s2 && !is_digit(*s2))) {
++                        INTN order;
++                        order = c_order(*s1) - c_order(*s2);
++                        if (order != 0)
++                                return order;
++                        s1++;
++                        s2++;
++                }
++                while (*s1 == '0')
++                        s1++;
++                while (*s2 == '0')
++                        s2++;
++                first = 0;
++                while (is_digit(*s1) && is_digit(*s2)) {
++                        if (first == 0)
++                                first = *s1 - *s2;
++                        s1++;
++                        s2++;
++                }
++                if (is_digit(*s1))
++                        return 1;
++                if (is_digit(*s2))
++                        return -1;
++                if (first != 0)
++                        return first;
++        }
++        return StrCmp(os1, os2);
++}
++
+ static CHAR8 *line_get_key_value(
+                 CHAR8 *content,
+                 CHAR8 *sep,
+@@ -1478,7 +1525,7 @@ static INTN config_entry_compare(ConfigEntry *a, ConfigEntry *b) {
+         if (a->tries_left == 0 && b->tries_left != 0)
+                 return -1;
+ 
+-        r = strverscmp_improved(a->id, b->id);
++        r = str_verscmp(a->id, b->id);
+         if (r != 0)
+                 return r;
+ 

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-04-16 10:24:35 UTC (rev 412702)
+++ PKGBUILD	2021-04-16 10:37:40 UTC (rev 412703)
@@ -7,7 +7,7 @@
 _tag='e13126bd95857eb9344e030edbb4c603aab63884' # git rev-parse v${_tag_name}
 _tag_name=248
 pkgver="${_tag_name/-/}"
-pkgrel=4
+pkgrel=5
 arch=('x86_64')
 url='https://www.github.com/systemd/systemd'
 makedepends=('acl' 'cryptsetup' 'docbook-xsl' 'gperf' 'lz4' 'xz' 'pam' 'libelf'
@@ -15,7 +15,7 @@
              'libmicrohttpd' 'libxcrypt' 'libxslt' 'util-linux' 'linux-api-headers'
              'python-lxml' 'quota-tools' 'shadow' 'gnu-efi-libs' 'git'
              'meson' 'libseccomp' 'pcre2' 'audit' 'kexec-tools' 'libxkbcommon'
-             'bash-completion' 'p11-kit' 'systemd' 'libfido2' 'tpm2-tss')
+             'bash-completion' 'p11-kit' 'systemd' 'libfido2' 'tpm2-tss' 'rsync')
 options=('strip')
 validpgpkeys=('63CDA1E5D3FC22B998D20DD6327F26951A015CC4'  # Lennart Poettering <lennart at poettering.net>
               '5C251B5FC54EB2F80F407AAAC54CA336CFEB557E') # Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
@@ -23,6 +23,7 @@
         "git+https://github.com/systemd/systemd#tag=v${_tag_name%.*}?signed"
         '0001-Use-Arch-Linux-device-access-groups.patch'
         '0002-Disable-SYSTEMD_URLIFY-by-default.patch'
+        '0003-PARTIAL-REVERT-commit-tree-wide-replace-strverscmp-and-str_verscmp-with-strverscmp_improved.patch'
         'initcpio-hook-udev'
         'initcpio-install-systemd'
         'initcpio-install-udev'
@@ -44,6 +45,7 @@
             'SKIP'
             '882e486b6d88c8bafc50088845e41a49686e98981967f72ca1fb4ef07a01767400632f4b648fd31857d2a2a24a8fd65bcc2a8983284dd4fff2380732741d4c41'
             '313f3d6cc3d88f718509007e029213a82d84b196afdadc6ef560580acf70ab480aaecd7622f51726cc1af7d7841c6ec5390f72890b055a54fc74722341395651'
+            '34541f1967536524329867f9f341f8d9250d9d771c60dc3e6a22ccb82fc01f103cfd3f9903329777591ccbecd2446622a5d6b3804fa0411482b85c70593ee8ad'
             'f0d933e8c6064ed830dec54049b0a01e27be87203208f6ae982f10fb4eddc7258cb2919d594cbfb9a33e74c3510cfd682f3416ba8e804387ab87d1a217eb4b73'
             'f599e1a35cba2c4e83e37c2299fac23ae128d8f68081283e71e1729384975dee1c4b677787f31a17890aeb98c8d2fc90405a202644290708ef9c027315022b17'
             'a25b28af2e8c516c3a2eec4e64b8c7f70c21f974af4a955a4a9d45fd3e3ff0d2a98b4419fe425d47152d5acae77d64e69d8d014a7209524b75a81b0edb10bf3a'
@@ -89,6 +91,10 @@
 
   # https://github.com/gwsw/less/issues/140
   patch -Np1 -i ../0002-Disable-SYSTEMD_URLIFY-by-default.patch
+
+  # https://bugs.archlinux.org/task/70264
+  # https://github.com/systemd/systemd/issues/19191
+  patch -Np1 -i ../0003-PARTIAL-REVERT-commit-tree-wide-replace-strverscmp-and-str_verscmp-with-strverscmp_improved.patch
 }
 
 build() {



More information about the arch-commits mailing list