From 1952ce4d7974bba0873adb3e21404def125ae45e Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Tue, 29 Jun 2010 19:21:48 +0200 Subject: fix ipkg files output --- package/busybox/patches/001-ipkg.patch | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) (limited to 'package/busybox/patches/001-ipkg.patch') diff --git a/package/busybox/patches/001-ipkg.patch b/package/busybox/patches/001-ipkg.patch index 335a2334b..4e9d451a5 100644 --- a/package/busybox/patches/001-ipkg.patch +++ b/package/busybox/patches/001-ipkg.patch @@ -1007,8 +1007,8 @@ diff -Nur busybox-1.16.1.orig/archival/libipkg/hash_table.h busybox-1.16.1/archi +#endif /* _HASH_TABLE_H_ */ diff -Nur busybox-1.16.1.orig/archival/libipkg/ipkg_cmd.c busybox-1.16.1/archival/libipkg/ipkg_cmd.c --- busybox-1.16.1.orig/archival/libipkg/ipkg_cmd.c 1970-01-01 01:00:00.000000000 +0100 -+++ busybox-1.16.1/archival/libipkg/ipkg_cmd.c 2010-06-29 17:31:22.355873403 +0200 -@@ -0,0 +1,1386 @@ ++++ busybox-1.16.1/archival/libipkg/ipkg_cmd.c 2010-06-29 19:19:50.699618181 +0200 +@@ -0,0 +1,1366 @@ +/* ipkg_cmd.c - the itsy package management system + + Carl D. Worth @@ -2023,30 +2023,10 @@ diff -Nur busybox-1.16.1.orig/archival/libipkg/ipkg_cmd.c busybox-1.16.1/archiva + installed_files = pkg_get_installed_files(pkg); + pkg_version = pkg_version_str_alloc(pkg); + -+ if (buff) { -+ try_again: -+ used_len = snprintf(buff, buff_len, "Package %s (%s) is installed on %s and has the following files:\n", -+ pkg->name, pkg_version, pkg->dest->name) + 1; -+ if (used_len > buff_len) { -+ buff_len *= 2; -+ buff = realloc (buff, buff_len); -+ goto try_again; -+ } -+ for (iter = installed_files->head; iter; iter = iter->next) { -+ used_len += strlen (iter->data) + 1; -+ while (buff_len <= used_len) { -+ buff_len *= 2; -+ buff = realloc (buff, buff_len); -+ } -+ strncat(buff, iter->data, buff_len); -+ strncat(buff, "\n", buff_len); -+ } -+ if (ipkg_cb_list) ipkg_cb_list(pkg->name, -+ buff, -+ pkg_version_str_alloc(pkg), -+ pkg->state_status, -+ p_userdata); -+ free(buff); ++ printf("Package %s (%s) is installed on %s and has the following files:\n", ++ pkg->name, pkg_version, pkg->dest->name); ++ for (iter = installed_files->head; iter; iter = iter->next) { ++ puts(iter->data); + } + + free(pkg_version); -- cgit v1.2.3