index : packages | |
Archlinux32 package modifications | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2019-05-13 10:48:09 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-05-13 10:48:09 +0200 |
commit | efbae17abe758123c683511216f87d5e2c36218a (patch) | |
tree | c1ef03e4654e4c4fc621c7aa2e9f5553c2acfaab /core/pacman/pentium4-auto-config.patch | |
parent | fee5b4e56f025f50812b49ccc2f81ce7b1445d43 (diff) |
-rw-r--r-- | core/pacman/pentium4-auto-config.patch | 37 |
diff --git a/core/pacman/pentium4-auto-config.patch b/core/pacman/pentium4-auto-config.patch new file mode 100644 index 00000000..5401a64b --- /dev/null +++ b/core/pacman/pentium4-auto-config.patch @@ -0,0 +1,37 @@ +diff --git a/src/pacman/conf.c b/src/pacman/conf.c +index 3b79fbc7..2325f688 100644 +--- a/src/pacman/conf.c ++++ b/src/pacman/conf.c +@@ -308,6 +308,11 @@ int config_set_arch(const char *arch) + struct utsname un; + uname(&un); + config->arch = strdup(un.machine); ++ if(strcmp(config->arch, "i686") == 0) { ++ __builtin_cpu_init(); ++ if (__builtin_cpu_supports("sse2")) ++ config->arch = strdup("pentium4"); ++ } + } else { + config->arch = strdup(arch); + } +diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c +index 3bb622e6..abb6f933 100644 +--- a/src/pacman/pacman.c ++++ b/src/pacman/pacman.c +@@ -274,8 +274,15 @@ static void setuseragent(void) + int len; + + uname(&un); ++ char machine[8]; ++ strncpy(machine, un.machine, 8); ++ if(strcmp(machine, "i686") == 0) { ++ __builtin_cpu_init(); ++ if (__builtin_cpu_supports("sse2")) ++ strncpy(machine, "pentium4", 8); ++ } + len = snprintf(agent, 100, "pacman/%s (%s %s) libalpm/%s", +- PACKAGE_VERSION, un.sysname, un.machine, alpm_version()); ++ PACKAGE_VERSION, un.sysname, machine, alpm_version()); + if(len >= 100) { + pm_printf(ALPM_LOG_WARNING, _("HTTP_USER_AGENT truncated\n")); + } |