-int pkg_hash_add_from_file(opkg_conf_t *conf, const char *file_name,
- pkg_src_t *src, pkg_dest_t *dest, int is_status_file)
-{
- hash_table_t *hash = &conf->pkg_hash;
- char **raw;
- char **raw_start;
- pkg_t *pkg;
-
- raw = raw_start = read_raw_pkgs_from_file(file_name);
- if (!raw)
- return -ENOMEM;
-
- while(*raw){ /* don't worry, we'll increment raw in the parsing function */
- pkg = pkg_new();
- if (!pkg)
- return -ENOMEM;
-
- if (pkg_parse_raw(pkg, &raw, src, dest) == 0) {
- if (!pkg->architecture) {
- char *version_str = pkg_version_str_alloc(pkg);
- pkg->architecture = pkg_get_default_arch(conf);
- opkg_message(conf, OPKG_ERROR, "Package %s version %s has no architecture specified, defaulting to %s.\n",
- pkg->name, version_str, pkg->architecture);
- free(version_str);
- }
- hash_insert_pkg(hash, pkg, is_status_file,conf);
- } else {
- pkg_deinit (pkg);
- free(pkg);
- }
- }
+ if (!pkg->architecture) {
+ char *version_str = pkg_version_str_alloc(pkg);
+ opkg_msg(ERROR, "Package %s version %s has no "
+ "architecture specified, ignoring.\n",
+ pkg->name, version_str);
+ free(version_str);
+ continue;
+ }