diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-11-05 20:37:48 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-11-05 20:37:48 +0200 |
commit | f2a7667482475bbb9bf3acbcf57b755fee987a83 (patch) | |
tree | d1ae6fee58e5cd675c3abb6406ca322d11e89073 /lib/rpmrc.c | |
parent | a9169c46abddfe620c6ae83f3064b50c8bb35852 (diff) | |
download | librpm-tizen-f2a7667482475bbb9bf3acbcf57b755fee987a83.tar.gz librpm-tizen-f2a7667482475bbb9bf3acbcf57b755fee987a83.tar.bz2 librpm-tizen-f2a7667482475bbb9bf3acbcf57b755fee987a83.zip |
Nuke the ugly hardwired "known arch" list from label parsing
- we have list of known archs in rpmrc, might as well use it
- avoids having to patch & recompile rpm just to have rpmtsInitIterator()
recognize new archs when it's runtime configurable otherwise
- checking against compatible arch would be saner except then people could
get into even more trouble using --ignorearch...
Diffstat (limited to 'lib/rpmrc.c')
-rw-r--r-- | lib/rpmrc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 49b3e7e86..69d55d635 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -21,6 +21,7 @@ #include "rpmio/rpmlua.h" #include "rpmio/rpmio_internal.h" /* XXX for rpmioSlurp */ +#include "lib/misc.h" #include "debug.h" @@ -1327,6 +1328,14 @@ int rpmMachineScore(int type, const char * name) return (info != NULL ? info->score : 0); } +int rpmIsKnownArch(const char *name) +{ + canonEntry canon = lookupInCanonTable(name, + tables[RPM_MACHTABLE_INSTARCH].canons, + tables[RPM_MACHTABLE_INSTARCH].canonsLength); + return (canon != NULL || strcmp(name, "noarch") == 0); +} + /** \ingroup rpmrc * Set current arch/os names. * NULL as argument is set to the default value (munged uname()) |