#include <stdbool.h>
#include <stdio.h>
#include <sys/stat.h>
+#include <sys/utsname.h>
#include <sys/types.h>
#include <unistd.h>
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) {
}
my $pool = solv::Pool->new();
-$pool->setarch((POSIX::uname())[4]);
+$pool->setarch();
$pool->set_loadcallback(\&load_stub);
my $sysrepo = Repo::system->new('@System', 'system');
repos.append(repo)
pool = solv.Pool()
-pool.setarch(os.uname()[4])
+pool.setarch()
pool.set_loadcallback(load_stub)
# now load all enabled repos into the pool
end
pool = Solv::Pool.new()
-# require 'sys/uname' ; sysarch = Sys::Uname.machine
-sysarch = `uname -p`.strip
-pool.setarch(sysarch)
+pool.setarch()
pool.set_loadcallback { |repodata|
repo = repodata.repo.appdata