- pkg->epoch = strtoul(vstr, NULL, 10);
+ pkg_set_int(pkg, PKG_EPOCH, strtoul(vstr, NULL, 10));
- pkg->version = xstrdup(vstr);
- pkg->revision = strrchr(pkg->version, '-');
+ rev = strrchr(pkg_set_string(pkg, PKG_VERSION, vstr), '-');
/* these flags are a bit hackish... */
static int reading_conffiles = 0, reading_description = 0;
/* these flags are a bit hackish... */
static int reading_conffiles = 0, reading_description = 0;
- pkg->architecture = parse_simple("Architecture", line);
- pkg->arch_priority =
- get_arch_priority(pkg->architecture);
+ pkg->arch_priority = get_arch_priority(
+ pkg_set_string(pkg, PKG_ARCHITECTURE, line + strlen("Architecture") + 1));
+
} else if ((mask & PFM_AUTO_INSTALLED)
&& is_field("Auto-Installed", line)) {
char *tmp = parse_simple("Auto-Installed", line);
} else if ((mask & PFM_AUTO_INSTALLED)
&& is_field("Auto-Installed", line)) {
char *tmp = parse_simple("Auto-Installed", line);
/* The old opkg wrote out status files with the wrong
* case for MD5sum, let's parse it either way */
else if ((mask & PFM_MD5SUM) && is_field("MD5Sum:", line))
/* The old opkg wrote out status files with the wrong
* case for MD5sum, let's parse it either way */
else if ((mask & PFM_MD5SUM) && is_field("MD5Sum:", line))
else if ((mask & PFM_MAINTAINER)
&& is_field("Maintainer", line))
else if ((mask & PFM_MAINTAINER)
&& is_field("Maintainer", line))
break;
case 'P':
if ((mask & PFM_PACKAGE) && is_field("Package", line))
pkg->name = parse_simple("Package", line);
else if ((mask & PFM_PRIORITY) && is_field("Priority", line))
break;
case 'P':
if ((mask & PFM_PACKAGE) && is_field("Package", line))
pkg->name = parse_simple("Package", line);
else if ((mask & PFM_PRIORITY) && is_field("Priority", line))
else if ((mask & PFM_PROVIDES) && is_field("Provides", line))
pkg->provides_str =
parse_list(line, &pkg->provides_count, ',', 0);
else if ((mask & PFM_PROVIDES) && is_field("Provides", line))
pkg->provides_str =
parse_list(line, &pkg->provides_count, ',', 0);
#endif
else if ((mask & PFM_SIZE) && is_field("Size", line)) {
char *tmp = parse_simple("Size", line);
pkg->size = strtoul(tmp, NULL, 0);
free(tmp);
} else if ((mask & PFM_SOURCE) && is_field("Source", line))
#endif
else if ((mask & PFM_SIZE) && is_field("Size", line)) {
char *tmp = parse_simple("Size", line);
pkg->size = strtoul(tmp, NULL, 0);
free(tmp);
} else if ((mask & PFM_SOURCE) && is_field("Source", line))
else if ((mask & PFM_STATUS) && is_field("Status", line))
parse_status(pkg, line);
else if ((mask & PFM_SUGGESTS) && is_field("Suggests", line))
else if ((mask & PFM_STATUS) && is_field("Status", line))
parse_status(pkg, line);
else if ((mask & PFM_SUGGESTS) && is_field("Suggests", line))
goto dont_reset_flags;
} else if ((mask & PFM_CONFFILES) && reading_conffiles) {
parse_conffiles(pkg, line);
goto dont_reset_flags;
} else if ((mask & PFM_CONFFILES) && reading_conffiles) {
parse_conffiles(pkg, line);
- reading_description = 0;
+ if (reading_description && description) {
+ pkg_set_string(pkg, PKG_DESCRIPTION, description);
+ free(description);
+ reading_description = 0;
+ description = NULL;
+ }
+