During installs, install_data_files calls set_flags_from_control to
capture the case where fields, such as "Essential", are present in the
package control file but are missing on the Packages file. This
operation is expensive (re-parses the control file) and is catering to a
case that should not be supported on the first place.
Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
[Jo-Philipp Wich: remove function prototype as well]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
return err;
}
- /* The "Essential" control field may only be present in the control
- * file and not in the Packages list. Ensure we capture it regardless.
- *
- * XXX: This should be fixed outside of opkg, in the Package list.
- */
- set_flags_from_control(pkg);
-
opkg_msg(DEBUG, "Calling pkg_write_filelist.\n");
err = pkg_write_filelist(pkg);
if (err)
return ab_pkg;
}
-void set_flags_from_control(pkg_t * pkg)
-{
- char *file_name;
- FILE *fp;
-
- sprintf_alloc(&file_name, "%s/%s.control", pkg->dest->info_dir,
- pkg->name);
-
- fp = fopen(file_name, "r");
- if (fp == NULL) {
- opkg_perror(ERROR, "Failed to open %s", file_name);
- free(file_name);
- return;
- }
-
- free(file_name);
-
- if (pkg_parse_from_stream(pkg, fp, PFM_ALL ^ PFM_ESSENTIAL)) {
- opkg_msg(DEBUG,
- "Unable to read control file for %s. May be empty.\n",
- pkg->name);
- }
-
- fclose(fp);
-
- return;
-}
-
static const char *pkg_state_want_to_str(pkg_state_want_t sw)
{
int i;
void pkg_formatted_info(FILE * fp, pkg_t * pkg);
void pkg_formatted_field(FILE * fp, pkg_t * pkg, const char *field);
-void set_flags_from_control(pkg_t * pkg);
-
void pkg_print_status(pkg_t * pkg, FILE * file);
str_list_t *pkg_get_installed_files(pkg_t * pkg);
void pkg_free_installed_files(pkg_t * pkg);