summaryrefslogtreecommitdiff
path: root/bindings
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2012-11-02 15:27:53 +0100
committerMichael Schroeder <mls@suse.de>2012-11-02 15:27:53 +0100
commit26f2f1fe6e2f6a27c45b01c2e53970ec25b32e93 (patch)
tree38bba17043688d19423d9a4b13ece38e8a0c12af /bindings
parent01226ce8a0d8cdcb27a15ed0f4362723ee71dcf7 (diff)
downloadlibsolv-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.i11
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) {