libopkg: switch to GPL2 SHA256 implementation
[oweals/opkg-lede.git] / libopkg / pkg.c
index 023cf75c466797960dfe9483fc2dcff1e702f486..114cf05705666ab43c57903faafe6ba29e257eeb 100644 (file)
@@ -15,8 +15,6 @@
    General Public License for more details.
 */
 
-#include "config.h"
-
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
@@ -346,6 +344,11 @@ int pkg_init_from_file(pkg_t * pkg, const char *filename)
 
        pkg_init(pkg);
 
+       if (!(pkg->state_flag & SF_NEED_DETAIL)) {
+               opkg_msg(DEBUG, "applying abpkg flag to %s\n", filename);
+               pkg->state_flag |= SF_NEED_DETAIL;
+       }
+
        pkg_set_string(pkg, PKG_LOCAL_FILENAME, filename);
 
        tmp = xstrdup(filename);
@@ -844,13 +847,11 @@ void pkg_formatted_field(FILE * fp, pkg_t * pkg, const char *field)
                        if (p) {
                                fprintf(fp, "Section: %s\n", p);
                        }
-#if defined HAVE_SHA256
                } else if (strcasecmp(field, "SHA256sum") == 0) {
                        p = pkg_get_string(pkg, PKG_SHA256SUM);
                        if (p) {
                                fprintf(fp, "SHA256sum: %s\n", p);
                        }
-#endif
                } else if (strcasecmp(field, "Size") == 0) {
                        i = pkg_get_int(pkg, PKG_SIZE);
                        if (i) {