diff options
author | Michael Schroeder <mls@suse.de> | 2012-11-02 15:27:53 +0100 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2012-11-02 15:27:53 +0100 |
commit | 26f2f1fe6e2f6a27c45b01c2e53970ec25b32e93 (patch) | |
tree | 38bba17043688d19423d9a4b13ece38e8a0c12af /bindings | |
parent | 01226ce8a0d8cdcb27a15ed0f4362723ee71dcf7 (diff) | |
download | libsolv-26f2f1fe6e2f6a27c45b01c2e53970ec25b32e93.tar.gz libsolv-26f2f1fe6e2f6a27c45b01c2e53970ec25b32e93.tar.bz2 libsolv-26f2f1fe6e2f6a27c45b01c2e53970ec25b32e93.zip |
make pool.setarch() do the right thing
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/solv.i | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bindings/solv.i b/bindings/solv.i index 1fbe23a..f7d6e7c 100644 --- a/bindings/solv.i +++ b/bindings/solv.i @@ -334,6 +334,7 @@ typedef VALUE AppObjectPtr; #include <stdbool.h> #include <stdio.h> #include <sys/stat.h> +#include <sys/utsname.h> #include <sys/types.h> #include <unistd.h> @@ -1038,7 +1039,15 @@ typedef struct { Id id2langid(Id id, const char *lang, bool create=1) { return pool_id2langid($self, id, lang, create); } - void setarch(const char *arch) { + void setarch(const char *arch = 0) { + struct utsname un; + if (!arch) { + if (uname(&un)) { + perror("uname"); + return; + } + arch = un.machine; + } pool_setarch($self, arch); } Repo *add_repo(const char *name) { |