From b634d68b94652470582a11a3406ebaf7cf34b9e5 Mon Sep 17 00:00:00 2001 From: Paul Barker Date: Wed, 12 Mar 2014 09:25:58 -0400 Subject: pkg_hash: Fix invalid architecture notices If pkg->architecture is NULL, the message "no valid architecture" is correct. However if pkg->architecture is not NULL but pkg->arch_priority is zero, then the architecture is valid but is not compatible with the current system. Signed-off-by: Paul Barker --- (limited to 'libopkg') diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c index 4bc0c3a..4618869 100644 --- a/libopkg/pkg_hash.c +++ b/libopkg/pkg_hash.c @@ -137,7 +137,7 @@ pkg_hash_add_from_file(const char *file_name, continue; } - if (!pkg->architecture || !pkg->arch_priority) { + if (!pkg->architecture) { char *version_str = pkg_version_str_alloc(pkg); opkg_msg(NOTICE, "Package %s version %s has no " "valid architecture, ignoring.\n", @@ -145,6 +145,14 @@ pkg_hash_add_from_file(const char *file_name, free(version_str); continue; } + if (!pkg->arch_priority) { + char *version_str = pkg_version_str_alloc(pkg); + opkg_msg(DEBUG, "Package %s version %s is built for architecture %s " + "which cannot be installed here, ignoring.\n", + pkg->name, version_str, pkg->architecture); + free(version_str); + continue; + } hash_insert_pkg(pkg, is_status_file); -- cgit v0.9.1