apt/apt-0.5.15lorg2-alt-pkgInitConfig-cpu.patch
Dmitry V. Levin e97a90dec9 0.5.15lorg2-alt3
- Resolved a few issues introduced after cnc6.
2006-04-02 12:15:03 +00:00

30 lines
947 B
Diff

--- apt-0.5.15lorg2/apt-pkg/init.cc.orig 2006-04-02 12:00:56 +0000
+++ apt-0.5.15lorg2/apt-pkg/init.cc 2006-04-02 12:01:38 +0000
@@ -15,6 +15,7 @@
#include <apti18n.h>
#include <config.h>
#include <sys/stat.h>
+#include <sys/utsname.h>
// CNC:2003-03-17
#include <apt-pkg/luaiface.h>
@@ -37,9 +38,16 @@ const char *pkgOS = COMMON_OS;
is prepended, this allows a fair degree of flexability. */
bool pkgInitConfig(Configuration &Cnf)
{
+ const char *cpu = NULL;
+ struct utsname name;
+ if (uname(&name) == 0)
+ cpu = strdup(name.machine);
+ if (cpu == NULL)
+ cpu = COMMON_CPU;
+
// General APT things
if (strcmp(COMMON_OS,"linux") == 0 ||
strcmp(COMMON_OS,"unknown") == 0)
- Cnf.CndSet("APT::Architecture",COMMON_CPU);
+ Cnf.CndSet("APT::Architecture",cpu);
else
Cnf.CndSet("APT::Architecture",COMMON_OS "-" COMMON_CPU);
Cnf.CndSet("APT::Architecture",COMMON_OS "-" cpu);