diff options
author | Erich Eckner <git@eckner.net> | 2021-05-26 17:16:30 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2021-05-26 17:16:30 +0200 |
commit | 889d5ee579890e1e5333e277eafecab8df2f8880 (patch) | |
tree | 4b8194ddce1b69f4737cbb080a75d8a9305a3c00 /core/pacman | |
parent | 9f822cabe7af7c4b0cc7cdcfbac21bd8a5b3b9c1 (diff) | |
download | packages-889d5ee579890e1e5333e277eafecab8df2f8880.tar.xz |
core/pacman: fix patch
Diffstat (limited to 'core/pacman')
-rw-r--r-- | core/pacman/PKGBUILD | 2 | ||||
-rw-r--r-- | core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch | 61 |
2 files changed, 8 insertions, 55 deletions
diff --git a/core/pacman/PKGBUILD b/core/pacman/PKGBUILD index 7706a130..22f66813 100644 --- a/core/pacman/PKGBUILD +++ b/core/pacman/PKGBUILD @@ -24,7 +24,7 @@ if [ ! "${CARCH}" = "i686" ]; then fi source+=('replace-i686-by-pentium4-when-architecture-is-auto.patch') -sha256sums+=('e5d371dd890ba7916a7f363eea46da363a6b5b8794640f387945458d15323136') +sha256sums+=('0c73e8d94d164a58cbd7e52987ec4f2dd9ab9b64518db5b602bf615da0ef9764') eval "$( { diff --git a/core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch b/core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch index 6c073a4a..7e51a7ac 100644 --- a/core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch +++ b/core/pacman/replace-i686-by-pentium4-when-architecture-is-auto.patch @@ -1,5 +1,5 @@ diff --git a/src/pacman/conf.c b/src/pacman/conf.c -index 0f0c2cfb..87873891 100644 +index 0f0c2cfb..b05c456d 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -18,6 +18,7 @@ @@ -16,7 +16,7 @@ index 0f0c2cfb..87873891 100644 newarch = strdup(un.machine); + if(strcmp(newarch, "i686") == 0) { + unsigned int eax, ebx, ecx, edx; -+ __get_cpuid(0, &eax, &ebx, &ecx, &edx); ++ __get_cpuid(1, &eax, &ebx, &ecx, &edx); + if (ecx & bit_SSE2) + newarch = strdup("pentium4"); + } @@ -24,7 +24,7 @@ index 0f0c2cfb..87873891 100644 arch = newarch; } diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c -index 7e810127..255c6269 100644 +index 7e810127..ab9ee5c9 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -26,6 +26,7 @@ @@ -35,16 +35,15 @@ index 7e810127..255c6269 100644 #include <ctype.h> /* isspace */ #include <limits.h> #include <getopt.h> -@@ -274,8 +275,19 @@ static void setuseragent(void) +@@ -274,8 +275,18 @@ static void setuseragent(void) int len; uname(&un); -+ char machine[9]; -+ strncpy(machine, un.machine, sizeof machine); -+ machine[sizeof machine-1] = '\0'; ++ char machine[8]; ++ strncpy(machine, un.machine, 8); + if(strcmp(machine, "i686") == 0) { + int eax, ebx, ecx, edx; -+ __cpuid(0, &eax, &ebx, &ecx, %edx); ++ __get_cpuid(1, &eax, &ebx, &ecx, &edx); + if (ecx & bit_SSE2) { + strncpy(machine, "pentium4", sizeof machine); + machine[sizeof machine-1] = '\0'; @@ -56,49 +55,3 @@ index 7e810127..255c6269 100644 if(len >= 100) { pm_printf(ALPM_LOG_WARNING, _("HTTP_USER_AGENT truncated\n")); } -diff --git a/test/pacman/tests/upgrade082.py b/test/pacman/tests/upgrade082.py -index 0bdbdf71..8c30ec32 100644 ---- a/test/pacman/tests/upgrade082.py -+++ b/test/pacman/tests/upgrade082.py -@@ -3,6 +3,18 @@ - import os - machine = os.uname()[4] - -+if machine == 'i686': -+ import re -+ fo = open('/proc/cpuinfo') -+ for line in fo: -+ name_value = [s.strip() for s in line.split(':', 1)] -+ if len(name_value) != 2: -+ continue -+ name, value = name_value -+ if name == "flags": -+ if re.match(r'.*?\bsse2\b', value) is not None: -+ machine = 'pentium4' -+ - p = pmpkg("dummy") - p.files = ["bin/dummy", - "usr/man/man1/dummy.1"] -diff --git a/test/pacman/tests/upgrade083.py b/test/pacman/tests/upgrade083.py -index 097ae02c..7195e35b 100644 ---- a/test/pacman/tests/upgrade083.py -+++ b/test/pacman/tests/upgrade083.py -@@ -3,6 +3,18 @@ - import os - machine = os.uname()[4] - -+if machine == 'i686': -+ import re -+ fo = open('/proc/cpuinfo') -+ for line in fo: -+ name_value = [s.strip() for s in line.split(':', 1)] -+ if len(name_value) != 2: -+ continue -+ name, value = name_value -+ if name == "flags": -+ if re.match(r'.*?\bsse2\b', value) is not None: -+ machine = 'pentium4' -+ - p = pmpkg("dummy") - p.files = ["bin/dummy", - "usr/man/man1/dummy.1"] |