X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=libopkg%2Fopkg_install.c;h=e6f8a1b6276ede518a5c59b2f9347f1de8e5dd7a;hb=546bc72356c7a6b435540852b10625b7531f2117;hp=5ccb8a8f2769e0dc2ececc3698c4d37a6276e937;hpb=e2e66a62227b2805c4577b33e36ee4fc7d090e86;p=oweals%2Fopkg-lede.git diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c index 5ccb8a8..e6f8a1b 100644 --- a/libopkg/opkg_install.c +++ b/libopkg/opkg_install.c @@ -884,8 +884,6 @@ static int check_data_file_clashes_change(pkg_t * pkg, pkg_t * old_pkg) str_list_t *files_list; str_list_elt_t *iter, *niter; - char *root_filename = NULL; - files_list = pkg_get_installed_files(pkg); if (files_list == NULL) return -1; @@ -894,12 +892,7 @@ static int check_data_file_clashes_change(pkg_t * pkg, pkg_t * old_pkg) str_list_next(files_list, iter); iter; iter = niter, niter = str_list_next(files_list, niter)) { char *filename = (char *)iter->data; - if (root_filename) { - free(root_filename); - root_filename = NULL; - } - root_filename = root_filename_alloc(filename); - if (file_exists(root_filename) && (!file_is_dir(root_filename))) { + if (file_exists(filename) && (!file_is_dir(filename))) { pkg_t *owner; owner = file_hash_get_file_owner(filename); @@ -926,10 +919,6 @@ static int check_data_file_clashes_change(pkg_t * pkg, pkg_t * old_pkg) } } - if (root_filename) { - free(root_filename); - root_filename = NULL; - } pkg_free_installed_files(pkg); return 0; @@ -1090,13 +1079,6 @@ static int install_data_files(pkg_t * pkg) 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) @@ -1149,15 +1131,12 @@ static int resolve_conffiles(pkg_t * pkg) if (file_exists(cf_backup)) { /* Let's compute md5 to test if files are changed */ -#ifdef HAVE_MD5 if (cf->value && strlen(cf->value) > 33) { chksum = file_sha256sum_alloc(cf_backup); } else { chksum = file_md5sum_alloc(cf_backup); } -#else - chksum = file_sha256sum_alloc(cf_backup); -#endif + if (chksum && cf->value && strcmp(cf->value, chksum) != 0) { if (conf->force_maintainer) { @@ -1268,9 +1247,7 @@ int opkg_install_pkg(pkg_t * pkg, int from_upgrade) abstract_pkg_t *ab_pkg = NULL; int old_state_flag; char *file_md5, *pkg_md5; -#ifdef HAVE_SHA256 char *file_sha256, *pkg_sha256; -#endif sigset_t newset, oldset; const char *local_filename; time_t now; @@ -1349,7 +1326,7 @@ int opkg_install_pkg(pkg_t * pkg, int from_upgrade) } /* check that the repository is valid */ -#if defined(HAVE_GPGME) || defined(HAVE_OPENSSL) || defined(HAVE_USIGN) +#if defined(HAVE_USIGN) char *list_file_name, *sig_file_name, *lists_dir; /* check to ensure the package has come from a repository */ @@ -1384,7 +1361,6 @@ int opkg_install_pkg(pkg_t * pkg, int from_upgrade) } #endif -#ifdef HAVE_MD5 /* Check for md5 values */ pkg_md5 = pkg_get_md5(pkg); if (pkg_md5) { @@ -1405,9 +1381,7 @@ int opkg_install_pkg(pkg_t * pkg, int from_upgrade) if (file_md5) free(file_md5); } -#endif -#ifdef HAVE_SHA256 /* Check for sha256 value */ pkg_sha256 = pkg_get_sha256(pkg); if (pkg_sha256) { @@ -1429,7 +1403,7 @@ int opkg_install_pkg(pkg_t * pkg, int from_upgrade) if (file_sha256) free(file_sha256); } -#endif + if (conf->download_only) { if (conf->nodeps == 0) { err = satisfy_dependencies_for(pkg);