mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 1/4] opkg: version bump 0.1.8 -> 0.2.0
@ 2014-01-14  7:19 Robert Schwebel
  2014-01-14  7:19 ` [ptxdist] [PATCH 2/4] host-opkg-utils: version bump Robert Schwebel
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Robert Schwebel @ 2014-01-14  7:19 UTC (permalink / raw)
  To: ptxdist; +Cc: Robert Schwebel

The opkg packet is maintained again, upstream has released a new version
recently. We remove the old patch series; it was pulled in from the opkg
repository and is included in 0.2.0.

Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
---
 ...25-Downgrade-message-from-ERROR-to-NOTICE.patch |   29 -
 ...0526-Upgrade-message-from-NOTICE-to-ERROR.patch |   30 -
 ...-reserved-word-in-header.-Remove-void-cas.patch |   86 -
 ...o-print-cmd_name-before-its-initialised.-.patch |   26 -
 ...ge-for-the-case-that-no-installation-cand.patch |   29 -
 ...p-maximum-message-length-from-256-to-4096.patch |   31 -
 ...a-file-belongs-to-the-package-before-remo.patch |   31 -
 ...ata_file_clashes-for-offline-root-mode.-a.patch |   66 -
 ...pdate-the-obs_file_hash-in-offline-root-m.patch |   26 -
 ...offline-root-path-from-the-file_name-in-f.patch |   37 -
 ...-file-removal-message-from-INFO-to-NOTICE.patch |   26 -
 ...ship-of-a-file-if-the-previous-owner-has-.patch |   35 -
 .../0537-Minor-cleanup-simplification.patch        |   72 -
 ...einstall-by-removing-special-case-code.-J.patch |  212 --
 .../opkg-0.1.8/0539-s-ipkgetcdir-opkgetcdir.patch  |   36 -
 .../0540-Improve-error-propagation.patch           |  183 --
 ...nt-in-how-to-check-return-codes-for-these.patch |   33 -
 ...k-the-lock-file-in-the-event-that-it-cann.patch |   70 -
 ...finite-loop-in-list_upgradable-in-libopkg.patch |   28 -
 ...n-of-symlinks-to-files-with-long-names-gr.patch |   65 -
 .../0545-This-was-done-some-time-ago.patch         |   28 -
 ...ever-be-done-offline-roots-often-point-at.patch |   25 -
 ...es-for-opkg-cl-and-opkg-keys.-From-David-.patch |  480 ----
 ...-these-two-files-in-the-last-commit.-Oops.patch |   52 -
 .../0549-And-remove-the-autogenerated-files.patch  |  241 --
 ...0-Fix-segfault-using-the-verbosity-option.patch |   50 -
 ...ove-outdated-comment-regarding-an-old-bug.patch |   32 -
 ...ling-whitespace.-Sorry-if-this-breaks-you.patch | 2392 --------------------
 ...blacklisting-a-package-in-the-status-file.patch |   56 -
 ...554-Add-generated-man-pages-to-.gitignore.patch |   24 -
 ...Depended-and-Recommended-packages-can-be-.patch |   28 -
 ...nded-packages-to-the-depended_upon_by-fie.patch |  102 -
 .../opkg-0.1.8/0557-Remove-stray-semicolon.patch   |   26 -
 ...ading-.-for-the-control-file-name-but-don.patch |   47 -
 ...orce-postinstall-option-this-allows-forci.patch |   92 -
 ...60-fix-compile-issues-on-OS-X-and-FreeBSD.patch |   51 -
 ...oading-part-of-opkg_conf_init-out-into-op.patch |  182 --
 ...g_conf_init-to-initialize-the-pair-lists-.patch |   93 -
 ...-update-manpages-to-reflect-r559-and-r562.patch |   42 -
 ...sk-PFM_FOO-should-instead-be-mask-PFM_FOO.patch |   62 -
 ...se-M-for-printing-maintainer-field-to-be-.patch |   28 -
 ...regression-testing-code-and-tests-for-som.patch |  547 -----
 ...256-code-by-default.-This-makes-opkg-GPLv.patch |   28 -
 ...-opkg_conf_deinit-if-opkg_conf_init-fails.patch |   46 -
 ...t-call-opkg_conf_deinit-if-opkg_conf_init.patch |   48 -
 ...x-this-time.-From-Sergey-Jin-Bostandzhyan.patch |  109 -
 ...-code-sprintf_alloc-cannot-fail.-Opkg-wil.patch |   29 -
 ...ist-changed-conffiles-command-based-on-pa.patch |  103 -
 .../0577-Remove-an-erroneous-comment.patch         |   25 -
 .../0578-This-is-not-a-bug-any-longer.patch        |   28 -
 ...ackage-should-not-return-garbage-if-it-ca.patch |   42 -
 patches/opkg-0.1.8/0580-Fix-indentation.patch      |   95 -
 .../opkg-0.1.8/0581-Rewrite-sprintf_alloc.patch    |  111 -
 ...-return-codes-from-vsnprintf-and-vfprintf.patch |   50 -
 .../0583-Remove-an-unnecessary-allocation.patch    |   32 -
 ...format-specifier-attribute-for-opkg_messa.patch |   27 -
 ...matting-issues-found-with-the-last-commit.patch |   56 -
 ...ackage-name-corresponding-to-a-failed-scr.patch |   29 -
 ...ge-removal-if-the-prerm-script-of-a-packa.patch |  147 --
 ...ement-with-empty-body-due-to-stray-semico.patch |   28 -
 ...9-Fix-missing-declarations-found-by-Clang.patch |   25 -
 ...590-Remove-stray-exit-in-the-regress-test.patch |   25 -
 ...-the-function-name-when-just-outputting-a.patch |   49 -
 ...0592-Don-t-gitignore-the-regress-Makefile.patch |   25 -
 .../0593-Add-regress-test-for-issue72.patch        |   93 -
 .../0594-Don-t-truncate-long-symlink-paths.patch   |  107 -
 ...al-undefined-references-to-FILE-for-libop.patch |   28 -
 ...ate-the-regress-offline_root-from-scratch.patch |   33 -
 ...-causing-segfaults-when-an-upgraded-packa.patch |   26 -
 ...-intercept.-Patch-from-Andreas-Oberritter.patch |   37 -
 patches/opkg-0.1.8/0600-Add-missing-space.patch    |   26 -
 ..._root-config-option.-Opkg-checks-this-loc.patch |   84 -
 ...check_version-before-using-other-gpgpe-fu.patch |   33 -
 ...age-sources-that-fail-the-signature-check.patch |   32 -
 ...-ing-an-external-gunzip-binary-instead-of.patch |  163 --
 ...er-of-the-file_name-after-the-offline-roo.patch |   37 -
 ...ub-commands-that-were-missing-from-the-he.patch |   29 -
 ...07-Add-regress-test-for-the-bug-from-r605.patch |   70 -
 ...leak-when-defined-HAVE_GPGME-and-defined-.patch |   33 -
 .../0609-Fix-opkg_re_read_config_files.patch       |   58 -
 ...-opkg_download-calls-to-reduce-the-severi.patch |  158 --
 ...e_util-with-some-of-the-non-public-functi.patch |  273 ---
 ...andle-the-apt-alike-configuration-entries.patch |  765 -------
 .../0613-Fix-mistype-in-define-clause.patch        |   26 -
 ...-new-pkg_src-list-in-global-configuration.patch |  148 --
 ...l-the-valid-Packages-files-for-dist-entri.patch |   73 -
 ...ntents-of-lists-files-coming-from-dist-en.patch |  121 -
 ...ude-the-source-URI-in-the-cached-filename.patch |   51 -
 .../0618-Fix-compilation-after-r617.patch          |   26 -
 ...arse_from_stream_nomalloc-into-parse_util.patch |  289 ---
 ...-specific-pointer-typedef-for-parse_line-.patch |  152 --
 ...ase-file-parsing-to-use-parse_from_stream.patch |   61 -
 patches/opkg-0.1.8/autogen.sh                      |    1 -
 patches/opkg-0.1.8/series                          |   92 -
 rules/opkg.make                                    |    6 +-
 95 files changed, 3 insertions(+), 10116 deletions(-)
 delete mode 100644 patches/opkg-0.1.8/0525-Downgrade-message-from-ERROR-to-NOTICE.patch
 delete mode 100644 patches/opkg-0.1.8/0526-Upgrade-message-from-NOTICE-to-ERROR.patch
 delete mode 100644 patches/opkg-0.1.8/0527-Don-t-use-c-reserved-word-in-header.-Remove-void-cas.patch
 delete mode 100644 patches/opkg-0.1.8/0528-Don-t-try-to-print-cmd_name-before-its-initialised.-.patch
 delete mode 100644 patches/opkg-0.1.8/0529-Add-a-message-for-the-case-that-no-installation-cand.patch
 delete mode 100644 patches/opkg-0.1.8/0530-Bump-maximum-message-length-from-256-to-4096.patch
 delete mode 100644 patches/opkg-0.1.8/0531-Check-that-a-file-belongs-to-the-package-before-remo.patch
 delete mode 100644 patches/opkg-0.1.8/0532-Fix-check_data_file_clashes-for-offline-root-mode.-a.patch
 delete mode 100644 patches/opkg-0.1.8/0533-Correctly-update-the-obs_file_hash-in-offline-root-m.patch
 delete mode 100644 patches/opkg-0.1.8/0534-String-the-offline-root-path-from-the-file_name-in-f.patch
 delete mode 100644 patches/opkg-0.1.8/0535-Promote-file-removal-message-from-INFO-to-NOTICE.patch
 delete mode 100644 patches/opkg-0.1.8/0536-Claim-ownership-of-a-file-if-the-previous-owner-has-.patch
 delete mode 100644 patches/opkg-0.1.8/0537-Minor-cleanup-simplification.patch
 delete mode 100644 patches/opkg-0.1.8/0538-Fix-force-reinstall-by-removing-special-case-code.-J.patch
 delete mode 100644 patches/opkg-0.1.8/0539-s-ipkgetcdir-opkgetcdir.patch
 delete mode 100644 patches/opkg-0.1.8/0540-Improve-error-propagation.patch
 delete mode 100644 patches/opkg-0.1.8/0541-Be-consistent-in-how-to-check-return-codes-for-these.patch
 delete mode 100644 patches/opkg-0.1.8/0542-Don-t-unlink-the-lock-file-in-the-event-that-it-cann.patch
 delete mode 100644 patches/opkg-0.1.8/0543-Fix-infinite-loop-in-list_upgradable-in-libopkg.patch
 delete mode 100644 patches/opkg-0.1.8/0544-Fix-creation-of-symlinks-to-files-with-long-names-gr.patch
 delete mode 100644 patches/opkg-0.1.8/0545-This-was-done-some-time-ago.patch
 delete mode 100644 patches/opkg-0.1.8/0546-This-will-never-be-done-offline-roots-often-point-at.patch
 delete mode 100644 patches/opkg-0.1.8/0547-Add-man-pages-for-opkg-cl-and-opkg-keys.-From-David-.patch
 delete mode 100644 patches/opkg-0.1.8/0548-Forgot-these-two-files-in-the-last-commit.-Oops.patch
 delete mode 100644 patches/opkg-0.1.8/0549-And-remove-the-autogenerated-files.patch
 delete mode 100644 patches/opkg-0.1.8/0550-Fix-segfault-using-the-verbosity-option.patch
 delete mode 100644 patches/opkg-0.1.8/0551-Remove-outdated-comment-regarding-an-old-bug.patch
 delete mode 100644 patches/opkg-0.1.8/0552-Remove-trailing-whitespace.-Sorry-if-this-breaks-you.patch
 delete mode 100644 patches/opkg-0.1.8/0553-Allow-blacklisting-a-package-in-the-status-file.patch
 delete mode 100644 patches/opkg-0.1.8/0554-Add-generated-man-pages-to-.gitignore.patch
 delete mode 100644 patches/opkg-0.1.8/0555-Ensure-Pre-Depended-and-Recommended-packages-can-be-.patch
 delete mode 100644 patches/opkg-0.1.8/0556-Add-Recommended-packages-to-the-depended_upon_by-fie.patch
 delete mode 100644 patches/opkg-0.1.8/0557-Remove-stray-semicolon.patch
 delete mode 100644 patches/opkg-0.1.8/0558-Accept-a-leading-.-for-the-control-file-name-but-don.patch
 delete mode 100644 patches/opkg-0.1.8/0559-implement-force-postinstall-option-this-allows-forci.patch
 delete mode 100644 patches/opkg-0.1.8/0560-fix-compile-issues-on-OS-X-and-FreeBSD.patch
 delete mode 100644 patches/opkg-0.1.8/0561-split-the-loading-part-of-opkg_conf_init-out-into-op.patch
 delete mode 100644 patches/opkg-0.1.8/0562-utilize-opkg_conf_init-to-initialize-the-pair-lists-.patch
 delete mode 100644 patches/opkg-0.1.8/0563-update-manpages-to-reflect-r559-and-r562.patch
 delete mode 100644 patches/opkg-0.1.8/0564-mask-PFM_FOO-should-instead-be-mask-PFM_FOO.patch
 delete mode 100644 patches/opkg-0.1.8/0565-Use-uppercase-M-for-printing-maintainer-field-to-be-.patch
 delete mode 100644 patches/opkg-0.1.8/0566-Add-simple-regression-testing-code-and-tests-for-som.patch
 delete mode 100644 patches/opkg-0.1.8/0569-Disable-sha256-code-by-default.-This-makes-opkg-GPLv.patch
 delete mode 100644 patches/opkg-0.1.8/0570-Don-t-call-opkg_conf_deinit-if-opkg_conf_init-fails.patch
 delete mode 100644 patches/opkg-0.1.8/0572-Revert-Don-t-call-opkg_conf_deinit-if-opkg_conf_init.patch
 delete mode 100644 patches/opkg-0.1.8/0573-A-proper-fix-this-time.-From-Sergey-Jin-Bostandzhyan.patch
 delete mode 100644 patches/opkg-0.1.8/0574-Remove-dead-code-sprintf_alloc-cannot-fail.-Opkg-wil.patch
 delete mode 100644 patches/opkg-0.1.8/0576-Implement-list-changed-conffiles-command-based-on-pa.patch
 delete mode 100644 patches/opkg-0.1.8/0577-Remove-an-erroneous-comment.patch
 delete mode 100644 patches/opkg-0.1.8/0578-This-is-not-a-bug-any-longer.patch
 delete mode 100644 patches/opkg-0.1.8/0579-opkg_find_package-should-not-return-garbage-if-it-ca.patch
 delete mode 100644 patches/opkg-0.1.8/0580-Fix-indentation.patch
 delete mode 100644 patches/opkg-0.1.8/0581-Rewrite-sprintf_alloc.patch
 delete mode 100644 patches/opkg-0.1.8/0582-Check-return-codes-from-vsnprintf-and-vfprintf.patch
 delete mode 100644 patches/opkg-0.1.8/0583-Remove-an-unnecessary-allocation.patch
 delete mode 100644 patches/opkg-0.1.8/0584-Use-printf-format-specifier-attribute-for-opkg_messa.patch
 delete mode 100644 patches/opkg-0.1.8/0585-Fix-formatting-issues-found-with-the-last-commit.patch
 delete mode 100644 patches/opkg-0.1.8/0586-Print-the-package-name-corresponding-to-a-failed-scr.patch
 delete mode 100644 patches/opkg-0.1.8/0587-Abort-package-removal-if-the-prerm-script-of-a-packa.patch
 delete mode 100644 patches/opkg-0.1.8/0588-Fix-if-statement-with-empty-body-due-to-stray-semico.patch
 delete mode 100644 patches/opkg-0.1.8/0589-Fix-missing-declarations-found-by-Clang.patch
 delete mode 100644 patches/opkg-0.1.8/0590-Remove-stray-exit-in-the-regress-test.patch
 delete mode 100644 patches/opkg-0.1.8/0591-Don-t-print-the-function-name-when-just-outputting-a.patch
 delete mode 100644 patches/opkg-0.1.8/0592-Don-t-gitignore-the-regress-Makefile.patch
 delete mode 100644 patches/opkg-0.1.8/0593-Add-regress-test-for-issue72.patch
 delete mode 100644 patches/opkg-0.1.8/0594-Don-t-truncate-long-symlink-paths.patch
 delete mode 100644 patches/opkg-0.1.8/0595-Fix-potential-undefined-references-to-FILE-for-libop.patch
 delete mode 100644 patches/opkg-0.1.8/0596-Create-the-regress-offline_root-from-scratch.patch
 delete mode 100644 patches/opkg-0.1.8/0598-Fixed-a-bug-causing-segfaults-when-an-upgraded-packa.patch
 delete mode 100644 patches/opkg-0.1.8/0599-Fix-depmod-intercept.-Patch-from-Andreas-Oberritter.patch
 delete mode 100644 patches/opkg-0.1.8/0600-Add-missing-space.patch
 delete mode 100644 patches/opkg-0.1.8/0601-Add-overlay_root-config-option.-Opkg-checks-this-loc.patch
 delete mode 100644 patches/opkg-0.1.8/0602-Call-gpgme_check_version-before-using-other-gpgpe-fu.patch
 delete mode 100644 patches/opkg-0.1.8/0603-Delete-package-sources-that-fail-the-signature-check.patch
 delete mode 100644 patches/opkg-0.1.8/0604-Allow-vfork-ing-an-external-gunzip-binary-instead-of.patch
 delete mode 100644 patches/opkg-0.1.8/0605-Get-the-owner-of-the-file_name-after-the-offline-roo.patch
 delete mode 100644 patches/opkg-0.1.8/0606-List-some-sub-commands-that-were-missing-from-the-he.patch
 delete mode 100644 patches/opkg-0.1.8/0607-Add-regress-test-for-the-bug-from-r605.patch
 delete mode 100644 patches/opkg-0.1.8/0608-Fix-memory-leak-when-defined-HAVE_GPGME-and-defined-.patch
 delete mode 100644 patches/opkg-0.1.8/0609-Fix-opkg_re_read_config_files.patch
 delete mode 100644 patches/opkg-0.1.8/0610-Add-flag-in-opkg_download-calls-to-reduce-the-severi.patch
 delete mode 100644 patches/opkg-0.1.8/0611-Create-parse_util-with-some-of-the-non-public-functi.patch
 delete mode 100644 patches/opkg-0.1.8/0612-Code-to-handle-the-apt-alike-configuration-entries.patch
 delete mode 100644 patches/opkg-0.1.8/0613-Fix-mistype-in-define-clause.patch
 delete mode 100644 patches/opkg-0.1.8/0614-Introduce-a-new-pkg_src-list-in-global-configuration.patch
 delete mode 100644 patches/opkg-0.1.8/0615-Download-all-the-valid-Packages-files-for-dist-entri.patch
 delete mode 100644 patches/opkg-0.1.8/0616-Read-the-contents-of-lists-files-coming-from-dist-en.patch
 delete mode 100644 patches/opkg-0.1.8/0617-Don-t-include-the-source-URI-in-the-cached-filename.patch
 delete mode 100644 patches/opkg-0.1.8/0618-Fix-compilation-after-r617.patch
 delete mode 100644 patches/opkg-0.1.8/0619-Move-pkg_parse_from_stream_nomalloc-into-parse_util.patch
 delete mode 100644 patches/opkg-0.1.8/0620-Introduce-a-specific-pointer-typedef-for-parse_line-.patch
 delete mode 100644 patches/opkg-0.1.8/0621-Modify-Release-file-parsing-to-use-parse_from_stream.patch
 delete mode 120000 patches/opkg-0.1.8/autogen.sh
 delete mode 100644 patches/opkg-0.1.8/series

diff --git a/patches/opkg-0.1.8/0525-Downgrade-message-from-ERROR-to-NOTICE.patch b/patches/opkg-0.1.8/0525-Downgrade-message-from-ERROR-to-NOTICE.patch
deleted file mode 100644
index 4b81b7a..0000000
--- a/patches/opkg-0.1.8/0525-Downgrade-message-from-ERROR-to-NOTICE.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 631201787e18b0e6b0d4e619d3830ecf37ec1166 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 4 Mar 2010 22:47:57 +0000
-Subject: [PATCH] Downgrade message from ERROR to NOTICE.
-
-This is a normal condition for feeds which supply multiple target
-architectures, as pointed out by Koen Kooi.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@525 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/pkg_hash.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c
-index 5850082..a7e3f52 100644
---- a/libopkg/pkg_hash.c
-+++ b/libopkg/pkg_hash.c
-@@ -107,7 +107,7 @@ pkg_hash_add_from_file(const char *file_name,
- 
- 		if (!pkg->architecture || !pkg->arch_priority) {
- 			char *version_str = pkg_version_str_alloc(pkg);
--			opkg_msg(ERROR, "Package %s version %s has no "
-+			opkg_msg(NOTICE, "Package %s version %s has no "
- 					"valid architecture, ignoring.\n",
- 					pkg->name, version_str);
- 			free(version_str);
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0526-Upgrade-message-from-NOTICE-to-ERROR.patch b/patches/opkg-0.1.8/0526-Upgrade-message-from-NOTICE-to-ERROR.patch
deleted file mode 100644
index b205a0b..0000000
--- a/patches/opkg-0.1.8/0526-Upgrade-message-from-NOTICE-to-ERROR.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From c047b9ed89fa790806450825d5b725a2b1c13d5c Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 4 Mar 2010 22:48:08 +0000
-Subject: [PATCH] Upgrade message from NOTICE to ERROR.
-
-Koen pointed out that this information is important enough for users that it
-should be deferred until the end of the output, so that its not lost in a
-small scroll buffer.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@526 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_install.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
-index 484c9e9..9f1dbac 100644
---- a/libopkg/opkg_install.c
-+++ b/libopkg/opkg_install.c
-@@ -1103,7 +1103,7 @@ resolve_conffiles(pkg_t *pkg)
-                   } else {
-                       char *new_conffile;
-                       sprintf_alloc(&new_conffile, "%s-opkg", root_filename);
--                      opkg_msg(NOTICE, "Existing conffile %s "
-+                      opkg_msg(ERROR, "Existing conffile %s "
-                            "is different from the conffile in the new package."
-                            " The new conffile will be placed at %s.\n",
-                            root_filename, new_conffile);
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0527-Don-t-use-c-reserved-word-in-header.-Remove-void-cas.patch b/patches/opkg-0.1.8/0527-Don-t-use-c-reserved-word-in-header.-Remove-void-cas.patch
deleted file mode 100644
index 3d34b58..0000000
--- a/patches/opkg-0.1.8/0527-Don-t-use-c-reserved-word-in-header.-Remove-void-cas.patch
+++ /dev/null
@@ -1,86 +0,0 @@
-From 517ebc96f447796f0cb3e102761e98a8afaa504c Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Sun, 14 Mar 2010 23:18:40 +0000
-Subject: [PATCH] Don't use c++ reserved word in header. Remove void* cast.
-
-Fixes compilation of header when used with C++. A slightly modified patch
-from Paul Eggleton.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@527 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/list.h |   28 ++++++++++++++--------------
- 1 files changed, 14 insertions(+), 14 deletions(-)
-
-diff --git a/libopkg/list.h b/libopkg/list.h
-index 0bd87b9..48e4dd5 100644
---- a/libopkg/list.h
-+++ b/libopkg/list.h
-@@ -20,13 +20,13 @@
- #ifndef _LINUX_LIST_H
- #define _LINUX_LIST_H
- 
--#define LIST_POISON1  ((void *) 0x00100100)
--#define LIST_POISON2  ((void *) 0x00200200)
--
- struct list_head {
-     struct list_head *next, *prev;
- };
- 
-+#define LIST_POISON1  ((struct list_head *) 0x00100100)
-+#define LIST_POISON2  ((struct list_head *) 0x00200200)
-+
- #define LIST_HEAD_INIT(name) { &(name), &(name) }
- 
- #define LIST_HEAD(name) \
-@@ -36,37 +36,37 @@ struct list_head {
- 	(ptr)->next = (ptr); (ptr)->prev = (ptr); \
- } while (0)
- 
--static inline void __list_add(struct list_head *new,
-+static inline void __list_add(struct list_head *newitem,
-                               struct list_head *prev,
-                               struct list_head *next) {
--    next->prev = new;
--    new->next = next;
--    new->prev = prev;
--    prev->next = new;
-+    next->prev = newitem;
-+    newitem->next = next;
-+    newitem->prev = prev;
-+    prev->next = newitem;
- }
- 
- /**
-  * list_add - add a new entry
-- * @new: new entry to be added
-+ * @newitem: new entry to be added
-  * @head: list head to add it after
-  *
-  * Insert a new entry after the specified head.
-  * This is good for implementing stacks.
-  */
--static inline void list_add(struct list_head *new, struct list_head *head) {
--    __list_add(new, head, head->next);
-+static inline void list_add(struct list_head *newitem, struct list_head *head) {
-+    __list_add(newitem, head, head->next);
- }
- 
- /**
-  * list_add_tail - add a new entry
-- * @new: new entry to be added
-+ * @newitem: new entry to be added
-  * @head: list head to add it before
-  *
-  * Insert a new entry before the specified head.
-  * This is useful for implementing queues.
-  */
--static inline void list_add_tail(struct list_head *new, struct list_head *head) {
--    __list_add(new, head->prev, head);
-+static inline void list_add_tail(struct list_head *newitem, struct list_head *head) {
-+    __list_add(newitem, head->prev, head);
- }
- 
- 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0528-Don-t-try-to-print-cmd_name-before-its-initialised.-.patch b/patches/opkg-0.1.8/0528-Don-t-try-to-print-cmd_name-before-its-initialised.-.patch
deleted file mode 100644
index b2a15bf..0000000
--- a/patches/opkg-0.1.8/0528-Don-t-try-to-print-cmd_name-before-its-initialised.-.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 4fc11f66f297250e52b6bc6b2ce63c2597fd65e8 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 13 Apr 2010 23:16:40 +0000
-Subject: [PATCH] Don't try to print cmd_name before its initialised. From Amanous, Issue #48.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@528 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- src/opkg-cl.c |    2 --
- 1 files changed, 0 insertions(+), 2 deletions(-)
-
-diff --git a/src/opkg-cl.c b/src/opkg-cl.c
-index 448387e..ae63012 100644
---- a/src/opkg-cl.c
-+++ b/src/opkg-cl.c
-@@ -274,8 +274,6 @@ main(int argc, char *argv[])
- 
- 	opts = args_parse(argc, argv);
- 	if (opts == argc || opts < 0) {
--		fprintf (stderr, "%s: unknown sub-command %s\n", argv[0],
--			 cmd_name);
- 		fprintf(stderr, "opkg must have one sub-command argument\n");
- 		usage();
- 	}
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0529-Add-a-message-for-the-case-that-no-installation-cand.patch b/patches/opkg-0.1.8/0529-Add-a-message-for-the-case-that-no-installation-cand.patch
deleted file mode 100644
index 3727146..0000000
--- a/patches/opkg-0.1.8/0529-Add-a-message-for-the-case-that-no-installation-cand.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From d09cea362eb6d39f75fc4b2566f2f2ed35e58757 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 29 Apr 2010 06:59:56 +0000
-Subject: [PATCH] Add a message for the case that no installation candidate can be found.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@529 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_install.c |    4 +++-
- 1 files changed, 3 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
-index 9f1dbac..c8e6dc9 100644
---- a/libopkg/opkg_install.c
-+++ b/libopkg/opkg_install.c
-@@ -1138,8 +1138,10 @@ opkg_install_by_name(const char *pkg_name)
- 			old->version);
-     
-      new = pkg_hash_fetch_best_installation_candidate_by_name(pkg_name);
--     if (new == NULL)
-+     if (new == NULL) {
-+	opkg_msg(NOTICE, "Unknown package '%s'.\n", pkg_name);
- 	return -1;
-+     }
- 
-      opkg_msg(DEBUG2, "Versions from pkg_hash_fetch:");
-      if ( old ) 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0530-Bump-maximum-message-length-from-256-to-4096.patch b/patches/opkg-0.1.8/0530-Bump-maximum-message-length-from-256-to-4096.patch
deleted file mode 100644
index c0ca515..0000000
--- a/patches/opkg-0.1.8/0530-Bump-maximum-message-length-from-256-to-4096.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From affb6d55b8f3e21796ea86e40113c617c8d3a893 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Wed, 2 Jun 2010 00:05:02 +0000
-Subject: [PATCH] Bump maximum message length from 256 to 4096.
-
-Errors seen in the wild can easily exceed 256 chars, especially when there is
-no limit imposed on maximum file path lengths under most systems. This should
-probably be changed at some point, to use realloc instead of a static buffer
-on the stack.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@530 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_message.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/opkg_message.c b/libopkg/opkg_message.c
-index 4a24039..e5324e6 100644
---- a/libopkg/opkg_message.c
-+++ b/libopkg/opkg_message.c
-@@ -92,7 +92,7 @@ opkg_message (message_level_t level, const char *fmt, ...)
- 	va_start (ap, fmt);
- 
- 	if (level == ERROR) {
--#define MSG_LEN 256
-+#define MSG_LEN 4096
- 		char msg[MSG_LEN];
- 		if (vsnprintf(msg, MSG_LEN, fmt, ap) >= MSG_LEN) {
- 			fprintf(stderr, "%s: Message truncated!\n",
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0531-Check-that-a-file-belongs-to-the-package-before-remo.patch b/patches/opkg-0.1.8/0531-Check-that-a-file-belongs-to-the-package-before-remo.patch
deleted file mode 100644
index 7679f4a..0000000
--- a/patches/opkg-0.1.8/0531-Check-that-a-file-belongs-to-the-package-before-remo.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 5161628bdab57405a6fa6eec0366439d6d375c63 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 8 Jun 2010 01:05:01 +0000
-Subject: [PATCH] Check that a file belongs to the package before removing it
-
-Fixes the test case in Issue #50.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@531 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_remove.c |    5 +++++
- 1 files changed, 5 insertions(+), 0 deletions(-)
-
-diff --git a/libopkg/opkg_remove.c b/libopkg/opkg_remove.c
-index a866c04..4920587 100644
---- a/libopkg/opkg_remove.c
-+++ b/libopkg/opkg_remove.c
-@@ -341,6 +341,11 @@ remove_data_files_and_list(pkg_t *pkg)
-      for (iter = str_list_first(installed_files); iter; iter = str_list_next(installed_files, iter)) {
- 	  file_name = (char *)iter->data;
- 
-+	  owner = file_hash_get_file_owner(file_name);
-+	  if (owner != pkg)
-+		  /* File may have been claimed by another package. */
-+		  continue;
-+
- 	  if (file_is_dir(file_name)) {
- 	       str_list_append(&installed_dirs, file_name);
- 	       continue;
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0532-Fix-check_data_file_clashes-for-offline-root-mode.-a.patch b/patches/opkg-0.1.8/0532-Fix-check_data_file_clashes-for-offline-root-mode.-a.patch
deleted file mode 100644
index 70a57c1..0000000
--- a/patches/opkg-0.1.8/0532-Fix-check_data_file_clashes-for-offline-root-mode.-a.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From 66a14488ce415c2fb01d8dc383631681e8dc81ee Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 10 Jun 2010 07:30:15 +0000
-Subject: [PATCH] Fix check_data_file_clashes() for offline root mode. (almost anyway)
-
-pkg_get_installed_files() returns a list of files with the offline root path
-already included, so don't add it again.
-
-Fix some error message formatting while here.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@532 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_install.c |   15 ++++++---------
- 1 files changed, 6 insertions(+), 9 deletions(-)
-
-diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
-index c8e6dc9..f67593d 100644
---- a/libopkg/opkg_install.c
-+++ b/libopkg/opkg_install.c
-@@ -748,7 +748,7 @@ check_data_file_clashes(pkg_t *pkg, pkg_t *old_pkg)
-      */
-      str_list_t *files_list;
-      str_list_elt_t *iter, *niter;
--
-+     char *filename;
-      int clashes = 0;
- 
-      files_list = pkg_get_installed_files(pkg);
-@@ -758,14 +758,12 @@ check_data_file_clashes(pkg_t *pkg, pkg_t *old_pkg)
-      for (iter = str_list_first(files_list), niter = str_list_next(files_list, iter); 
-              iter; 
-              iter = niter, niter = str_list_next(files_list, iter)) {
--	  char *root_filename;
--	  char *filename = (char *) iter->data;
--	  root_filename = root_filename_alloc(filename);
--	  if (file_exists(root_filename) && (! file_is_dir(root_filename))) {
-+	  filename = (char *) iter->data;
-+	  if (file_exists(filename) && (! file_is_dir(filename))) {
- 	       pkg_t *owner;
- 	       pkg_t *obs;
- 
--	       if (backup_exists_for(root_filename)) {
-+	       if (backup_exists_for(filename)) {
- 		    continue;
- 	       }
- 
-@@ -816,14 +814,13 @@ check_data_file_clashes(pkg_t *pkg, pkg_t *old_pkg)
- 			    "\tBut that file is already provided by package ",
- 			    pkg->name, filename);
- 	       if (owner) {
--		    opkg_msg(ERROR, "%s\n", owner->name);
-+		    opkg_message(ERROR, "%s\n", owner->name);
- 	       } else {
--		    opkg_msg(ERROR, "<no package>\n"
-+		    opkg_message(ERROR, "<no package>\n"
- 			"Please move this file out of the way and try again.\n");
- 	       }
- 	       clashes++;
- 	  }
--	  free(root_filename);
-      }
-      pkg_free_installed_files(pkg);
- 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0533-Correctly-update-the-obs_file_hash-in-offline-root-m.patch b/patches/opkg-0.1.8/0533-Correctly-update-the-obs_file_hash-in-offline-root-m.patch
deleted file mode 100644
index b8941cb..0000000
--- a/patches/opkg-0.1.8/0533-Correctly-update-the-obs_file_hash-in-offline-root-m.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 2b696d8b96d28277137305526e5217752509b033 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 10 Jun 2010 07:30:28 +0000
-Subject: [PATCH] Correctly update the obs_file_hash in offline root mode.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@533 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_install.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
-index f67593d..4889ad8 100644
---- a/libopkg/opkg_install.c
-+++ b/libopkg/opkg_install.c
-@@ -174,7 +174,7 @@ update_file_ownership(pkg_t *new_pkg, pkg_t *old_pkg)
-                   iter = niter, niter = str_list_next(old_list, niter)) {
- 	       char *old_file = (char *)iter->data;
- 	       pkg_t *owner = file_hash_get_file_owner(old_file);
--	       if (owner == old_pkg) {
-+	       if (!owner || (owner == old_pkg)) {
- 		    /* obsolete */
- 		    hash_table_insert(&conf->obs_file_hash, old_file, old_pkg);
- 	       }
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0534-String-the-offline-root-path-from-the-file_name-in-f.patch b/patches/opkg-0.1.8/0534-String-the-offline-root-path-from-the-file_name-in-f.patch
deleted file mode 100644
index b4b5f27..0000000
--- a/patches/opkg-0.1.8/0534-String-the-offline-root-path-from-the-file_name-in-f.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From b4cebed6238b42ad45e79a6cf28749d0626658c6 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Fri, 11 Jun 2010 02:07:29 +0000
-Subject: [PATCH] String the offline root path from the file_name in file_hash_get_file_owner().
-
-file_hash_set_file_owner() strips the offline root path, so this reciprocal
-function should do likewise. This makes behaviour consistent with and without
-an offline root.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@534 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/pkg_hash.c |    9 ++++++++-
- 1 files changed, 8 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c
-index a7e3f52..f72ed26 100644
---- a/libopkg/pkg_hash.c
-+++ b/libopkg/pkg_hash.c
-@@ -623,7 +623,14 @@ hash_insert_pkg(pkg_t *pkg, int set_status)
- pkg_t *
- file_hash_get_file_owner(const char *file_name)
- {
--	return hash_table_get(&conf->file_hash, file_name); 
-+	if (conf->offline_root) {
-+		unsigned int len = strlen(conf->offline_root);
-+		if (strncmp(file_name, conf->offline_root, len) == 0) {
-+			file_name += len;
-+		}
-+	}
-+
-+	return hash_table_get(&conf->file_hash, file_name);
- }
- 
- void
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0535-Promote-file-removal-message-from-INFO-to-NOTICE.patch b/patches/opkg-0.1.8/0535-Promote-file-removal-message-from-INFO-to-NOTICE.patch
deleted file mode 100644
index 7ed46c5..0000000
--- a/patches/opkg-0.1.8/0535-Promote-file-removal-message-from-INFO-to-NOTICE.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 154f3993b8112021e79beac00128547d333b808d Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Fri, 11 Jun 2010 02:07:45 +0000
-Subject: [PATCH] Promote file removal message from INFO to NOTICE.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@535 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_install.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
-index 4889ad8..88fed59 100644
---- a/libopkg/opkg_install.c
-+++ b/libopkg/opkg_install.c
-@@ -970,7 +970,7 @@ remove_obsolesced_files(pkg_t *pkg, pkg_t *old_pkg)
- 	  }
-  
- 	  /* old file is obsolete */
--	  opkg_msg(INFO, "Removing obsolete file %s.\n", old);
-+	  opkg_msg(NOTICE, "Removing obsolete file %s.\n", old);
- 	  if (!conf->noaction) {
- 	       err = unlink(old);
- 	       if (err) {
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0536-Claim-ownership-of-a-file-if-the-previous-owner-has-.patch b/patches/opkg-0.1.8/0536-Claim-ownership-of-a-file-if-the-previous-owner-has-.patch
deleted file mode 100644
index 349ec3f..0000000
--- a/patches/opkg-0.1.8/0536-Claim-ownership-of-a-file-if-the-previous-owner-has-.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-From 5a23a432b0a45ff4774a9968895ee87d60e70f03 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Fri, 11 Jun 2010 02:07:58 +0000
-Subject: [PATCH] Claim ownership of a file if the previous owner has obsoleted it.
-
-This commit, along with the last few, should fix Issue #50.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@536 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_install.c |    9 ++++++---
- 1 files changed, 6 insertions(+), 3 deletions(-)
-
-diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
-index 88fed59..16b5be9 100644
---- a/libopkg/opkg_install.c
-+++ b/libopkg/opkg_install.c
-@@ -156,9 +156,12 @@ update_file_ownership(pkg_t *new_pkg, pkg_t *old_pkg)
-              iter = niter, niter = str_list_next(new_list, niter)) {
- 	  char *new_file = (char *)iter->data;
- 	  pkg_t *owner = file_hash_get_file_owner(new_file);
--	  if (!new_file)
--	       opkg_msg(ERROR, "Null new_file for new_pkg=%s\n", new_pkg->name);
--	  if (!owner || (owner == old_pkg))
-+	  pkg_t *obs = hash_table_get(&conf->obs_file_hash, new_file);
-+
-+	  opkg_msg(DEBUG2, "%s: new_pkg=%s wants file %s, from owner=%s\n",
-+		__func__, new_pkg->name, new_file, owner?owner->name:"<NULL>");
-+
-+	  if (!owner || (owner == old_pkg) || obs)
- 	       file_hash_set_file_owner(new_file, new_pkg);
-      }
- 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0537-Minor-cleanup-simplification.patch b/patches/opkg-0.1.8/0537-Minor-cleanup-simplification.patch
deleted file mode 100644
index ec0f013..0000000
--- a/patches/opkg-0.1.8/0537-Minor-cleanup-simplification.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From 3e60267249bb3d164fa94a29770c2b923626f823 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 21 Jun 2010 23:34:12 +0000
-Subject: [PATCH] Minor cleanup/simplification.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@537 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/pkg.c |   21 ++++++++++++++-------
- 1 files changed, 14 insertions(+), 7 deletions(-)
-
-diff --git a/libopkg/pkg.c b/libopkg/pkg.c
-index 467dcef..9b3c6df 100644
---- a/libopkg/pkg.c
-+++ b/libopkg/pkg.c
-@@ -1072,6 +1072,7 @@ pkg_get_installed_files(pkg_t *pkg)
-      char *line;
-      char *installed_file_name;
-      unsigned int rootdirlen = 0;
-+     int list_from_package;
- 
-      pkg->installed_files_ref_cnt++;
- 
-@@ -1081,17 +1082,23 @@ pkg_get_installed_files(pkg_t *pkg)
- 
-      pkg->installed_files = str_list_alloc();
- 
--     /* For uninstalled packages, get the file list directly from the package.
--	For installed packages, look at the package.list file in the database.
--     */
--     if (pkg->state_status == SS_NOT_INSTALLED || pkg->dest == NULL) {
-+     /*
-+      * For installed packages, look at the package.list file in the database.
-+      * For uninstalled packages, get the file list directly from the package.
-+      */
-+     if (pkg->state_status == SS_NOT_INSTALLED || pkg->dest == NULL)
-+	     list_from_package = 1;
-+     else
-+	     list_from_package = 0;
-+
-+     if (list_from_package) {
- 	  if (pkg->local_filename == NULL) {
- 	       return pkg->installed_files;
- 	  }
- 	  /* XXX: CLEANUP: Maybe rewrite this to avoid using a temporary
- 	     file. In other words, change deb_extract so that it can
- 	     simply return the file list as a char *[] rather than
--	     insisting on writing in to a FILE * as it does now. */
-+	     insisting on writing it to a FILE * as it does now. */
- 	  sprintf_alloc(&list_file_name, "%s/%s.list.XXXXXX",
- 					  conf->tmp_dir, pkg->name);
- 	  fd = mkstemp(list_file_name);
-@@ -1147,7 +1154,7 @@ pkg_get_installed_files(pkg_t *pkg)
- 	  }
- 	  file_name = line;
- 
--	  if (pkg->state_status == SS_NOT_INSTALLED || pkg->dest == NULL) {
-+	  if (list_from_package) {
- 	       if (*file_name == '.') {
- 		    file_name++;
- 	       }
-@@ -1173,7 +1180,7 @@ pkg_get_installed_files(pkg_t *pkg)
- 
-      fclose(list_file);
- 
--     if (pkg->state_status == SS_NOT_INSTALLED || pkg->dest == NULL) {
-+     if (list_from_package) {
- 	  unlink(list_file_name);
- 	  free(list_file_name);
-      }
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0538-Fix-force-reinstall-by-removing-special-case-code.-J.patch b/patches/opkg-0.1.8/0538-Fix-force-reinstall-by-removing-special-case-code.-J.patch
deleted file mode 100644
index f163c6c..0000000
--- a/patches/opkg-0.1.8/0538-Fix-force-reinstall-by-removing-special-case-code.-J.patch
+++ /dev/null
@@ -1,212 +0,0 @@
-From 7fc9b3b1705f104eb66510d771994fb46b01d1e6 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 21 Jun 2010 23:34:25 +0000
-Subject: [PATCH] Fix --force-reinstall by removing special case code. Just remove the pkg first.
-
-This should fix Issue #51.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@538 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_cmd.c     |   11 +++++++++++
- libopkg/opkg_install.c |   30 ++++++++++--------------------
- libopkg/opkg_remove.c  |    1 +
- libopkg/pkg_hash.c     |   33 +++++++++++++++++++++------------
- libopkg/pkg_hash.h     |    1 +
- 5 files changed, 44 insertions(+), 32 deletions(-)
-
-diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
-index 63de047..b0e5552 100644
---- a/libopkg/opkg_cmd.c
-+++ b/libopkg/opkg_cmd.c
-@@ -424,12 +424,23 @@ error:
- }
- 
- static int
-+opkg_remove_cmd(int argc, char **argv);
-+
-+static int
- opkg_install_cmd(int argc, char **argv)
- {
-      int i, r;
-      char *arg;
-      int err=0;
- 
-+     if (conf->force_reinstall) {
-+	     int saved_force_depends = conf->force_depends;
-+	     conf->force_depends = 1;
-+	     (void)opkg_remove_cmd(argc, argv);
-+	     conf->force_depends = saved_force_depends;
-+	     conf->force_reinstall = 0;
-+     }
-+
-      signal(SIGINT, sigint_handler);
- 
-      /*
-diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
-index 16b5be9..49e14fc 100644
---- a/libopkg/opkg_install.c
-+++ b/libopkg/opkg_install.c
-@@ -470,19 +470,10 @@ opkg_install_check_downgrade(pkg_t *pkg, pkg_t *old_pkg, int message)
- 	       pkg->dest = old_pkg->dest;
- 	       rc = 0;
- 	  } else /* cmp == 0 */ {
--	       if (conf->force_reinstall) {
-                if(!conf->download_only)
--                   opkg_msg(NOTICE, "Reinstalling %s (%s) on %s...\n",
--                           pkg->name, new_version, old_pkg->dest->name);
--		    pkg->dest = old_pkg->dest;
--		    rc = 0;
--	       } else {
--                   if(!conf->download_only)
--                       opkg_msg(NOTICE, "%s (%s) already install on %s."
--                               " Not reinstalling.\n",
--                               pkg->name, new_version, old_pkg->dest->name);
--		    rc = 1;
--	       }
-+                   opkg_msg(NOTICE, "%s (%s) already install on %s.\n",
-+			pkg->name, new_version, old_pkg->dest->name);
-+	       rc = 1;
- 	  } 
- 	  free(old_version);
- 	  free(new_version);
-@@ -1145,8 +1136,8 @@ opkg_install_by_name(const char *pkg_name)
- 
-      opkg_msg(DEBUG2, "Versions from pkg_hash_fetch:");
-      if ( old ) 
--        opkg_msg(DEBUG2, " old %s ", old->version);
--     opkg_msg(DEBUG2, " new %s\n", new->version);
-+        opkg_message(DEBUG2, " old %s ", old->version);
-+     opkg_message(DEBUG2, " new %s\n", new->version);
- 
-      new->state_flag |= SF_USER;
-      if (old) {
-@@ -1165,7 +1156,7 @@ opkg_install_by_name(const char *pkg_name)
- 		       "\n\t%s is available "
- 		       "\n\t%d was comparison result\n",
- 		       pkg_name, old_version, new_version, cmp);
--	  if (cmp == 0 && !conf->force_reinstall) {
-+	  if (cmp == 0) {
- 	       opkg_msg(NOTICE,
- 			    "Package %s (%s) installed in %s is up to date.\n",
- 			    old->name, old_version, old->dest->name);
-@@ -1219,7 +1210,7 @@ opkg_install_pkg(pkg_t *pkg, int from_upgrade)
- 		       pkg->architecture, pkg->name);
- 	  return -1;
-      }
--     if (pkg->state_status == SS_INSTALLED && conf->force_reinstall == 0 && conf->nodeps == 0) {
-+     if (pkg->state_status == SS_INSTALLED && conf->nodeps == 0) {
- 	  err = satisfy_dependencies_for(pkg);
- 	  if (err)
- 		  return -1;
-@@ -1252,7 +1243,7 @@ opkg_install_pkg(pkg_t *pkg, int from_upgrade)
- 	installing pkg A, A deps B & B deps on A. So both B and A are
- 	installed. Then A's installation is started resulting in an
- 	uncecessary upgrade */ 
--     if (pkg->state_status == SS_INSTALLED && conf->force_reinstall == 0)
-+     if (pkg->state_status == SS_INSTALLED)
- 	     return 0;
-     
-      err = verify_pkg_installable(pkg);
-@@ -1426,7 +1417,7 @@ opkg_install_pkg(pkg_t *pkg, int from_upgrade)
- 		  return 0;
- 
- 	  /* point of no return: no unwinding after this */
--	  if (old_pkg && !conf->force_reinstall) {
-+	  if (old_pkg) {
- 	       old_pkg->state_want = SW_DEINSTALL;
- 
- 	       if (old_pkg->state_flag & SF_NOPRUNE) {
-@@ -1485,9 +1476,8 @@ opkg_install_pkg(pkg_t *pkg, int from_upgrade)
- 	  opkg_msg(DEBUG, "pkg=%s old_state_flag=%x state_flag=%x\n",
- 			  pkg->name, old_state_flag, pkg->state_flag);
- 
--	  if (old_pkg && !conf->force_reinstall) {
-+	  if (old_pkg)
- 	       old_pkg->state_status = SS_NOT_INSTALLED;
--	  }
- 
- 	  time(&pkg->installed_time);
- 
-diff --git a/libopkg/opkg_remove.c b/libopkg/opkg_remove.c
-index 4920587..792ab37 100644
---- a/libopkg/opkg_remove.c
-+++ b/libopkg/opkg_remove.c
-@@ -367,6 +367,7 @@ remove_data_files_and_list(pkg_t *pkg)
- 	  	opkg_msg(INFO, "Not deleting %s. (noaction)\n",
- 				file_name);
- 
-+	  file_hash_remove(file_name);
-      }
- 
-      /* Remove empty directories */
-diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c
-index f72ed26..67c1781 100644
---- a/libopkg/pkg_hash.c
-+++ b/libopkg/pkg_hash.c
-@@ -619,17 +619,31 @@ hash_insert_pkg(pkg_t *pkg, int set_status)
- 	pkg->parent = ab_pkg;
- }
- 
--
--pkg_t *
--file_hash_get_file_owner(const char *file_name)
-+static const char *
-+strip_offline_root(const char *file_name)
- {
-+	unsigned int len;
-+
- 	if (conf->offline_root) {
--		unsigned int len = strlen(conf->offline_root);
--		if (strncmp(file_name, conf->offline_root, len) == 0) {
-+		len = strlen(conf->offline_root);
-+		if (strncmp(file_name, conf->offline_root, len) == 0)
- 			file_name += len;
--		}
- 	}
- 
-+	return file_name;
-+}
-+
-+void
-+file_hash_remove(const char *file_name)
-+{
-+	file_name = strip_offline_root(file_name);
-+	hash_table_remove(&conf->file_hash, file_name);
-+}
-+
-+pkg_t *
-+file_hash_get_file_owner(const char *file_name)
-+{
-+	file_name = strip_offline_root(file_name);
- 	return hash_table_get(&conf->file_hash, file_name);
- }
- 
-@@ -642,12 +656,7 @@ file_hash_set_file_owner(const char *file_name, pkg_t *owning_pkg)
- 	if (file_name[file_name_len -1] == '/')
- 		return;
- 
--	if (conf->offline_root) {
--		unsigned int len = strlen(conf->offline_root);
--		if (strncmp(file_name, conf->offline_root, len) == 0) {
--			file_name += len;
--		}
--	}
-+	file_name = strip_offline_root(file_name);
- 
- 	hash_table_insert(&conf->file_hash, file_name, owning_pkg); 
- 
-diff --git a/libopkg/pkg_hash.h b/libopkg/pkg_hash.h
-index d847b73..0ae01e7 100644
---- a/libopkg/pkg_hash.h
-+++ b/libopkg/pkg_hash.h
-@@ -47,6 +47,7 @@ pkg_t *pkg_hash_fetch_installed_by_name(const char *pkg_name);
- pkg_t *pkg_hash_fetch_installed_by_name_dest(const char *pkg_name,
- 					     pkg_dest_t *dest);
- 
-+void file_hash_remove(const char *file_name);
- pkg_t *file_hash_get_file_owner(const char *file_name);
- void file_hash_set_file_owner(const char *file_name, pkg_t *pkg);
- 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0539-s-ipkgetcdir-opkgetcdir.patch b/patches/opkg-0.1.8/0539-s-ipkgetcdir-opkgetcdir.patch
deleted file mode 100644
index af8f726..0000000
--- a/patches/opkg-0.1.8/0539-s-ipkgetcdir-opkgetcdir.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From 863691e01b76c0788bd93f37aedc4d8b36465d09 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 28 Jun 2010 00:25:22 +0000
-Subject: [PATCH] s/ipkgetcdir/opkgetcdir/
-
-From David Bachelart via Issue #53.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@539 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- configure.ac |    6 +++---
- 1 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 0583897..f386b52 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -225,13 +225,13 @@ if test x$opkglibdir = x; then
-         opkglibdir=/usr/lib
- fi
- 
--ipkgetcdir=
-+opkgetcdir=
- AC_ARG_WITH(opkgetcdir,
--[  --with-ipkgetcdir=DIR   specifies directory for opkg.conf file,
-+[  --with-opkgetcdir=DIR   specifies directory for opkg.conf file,
-                            "/opkg" is always added so if you want your files
-                            to be in /usr/etc/opkg instead of /etc/opkg
-                            you should indicate
--                           --with-ipkgetcdir=/usr/etc ],
-+                           --with-opkgetcdir=/usr/etc ],
- [case "${withval}" in
- yes)    AC_MSG_ERROR(bad value ${withval} given for opkg.conf directory ) ;;
- no)     ;;
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0540-Improve-error-propagation.patch b/patches/opkg-0.1.8/0540-Improve-error-propagation.patch
deleted file mode 100644
index 6efe1b1..0000000
--- a/patches/opkg-0.1.8/0540-Improve-error-propagation.patch
+++ /dev/null
@@ -1,183 +0,0 @@
-From ad9f6e4ca18c3b297635dc7c991c42783921dd0b Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 29 Jun 2010 01:53:39 +0000
-Subject: [PATCH] Improve error propagation.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@540 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_cmd.c |   70 +++++++++++++++++++++++++--------------------------
- 1 files changed, 34 insertions(+), 36 deletions(-)
-
-diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
-index b0e5552..1c9f6fc 100644
---- a/libopkg/opkg_cmd.c
-+++ b/libopkg/opkg_cmd.c
-@@ -405,15 +405,13 @@ opkg_configure_packages(char *pkg_name)
- 		    pkg->state_flag &= ~SF_PREFER;
- 		    opkg_state_changed++;
- 	       } else {
--		    if (!err)
--			err = r;
-+		    err = -1;
- 	       }
- 	  }
-      }
- 
--     r = opkg_finalize_intercepts (ic);
--     if (r && !err)
--	 err = r;
-+     if (opkg_finalize_intercepts (ic))
-+	 err = -1;
- 
- error:
-      pkg_vec_free(all);
-@@ -429,9 +427,9 @@ opkg_remove_cmd(int argc, char **argv);
- static int
- opkg_install_cmd(int argc, char **argv)
- {
--     int i, r;
-+     int i;
-      char *arg;
--     int err=0;
-+     int err = 0;
- 
-      if (conf->force_reinstall) {
- 	     int saved_force_depends = conf->force_depends;
-@@ -450,23 +448,21 @@ opkg_install_cmd(int argc, char **argv)
- 	  arg = argv[i];
- 
-           opkg_msg(DEBUG2, "%s\n", arg);
--          err = opkg_prepare_url_for_install(arg, &argv[i]);
--          if (err)
--              return err;
-+          if (opkg_prepare_url_for_install(arg, &argv[i]))
-+              return -1;
-      }
-      pkg_info_preinstall_check();
- 
-      for (i=0; i < argc; i++) {
- 	  arg = argv[i];
--          err = opkg_install_by_name(arg);
--	  if (err) {
-+          if (opkg_install_by_name(arg) != 0) {
- 	       opkg_msg(ERROR, "Cannot install package %s.\n", arg);
-+	       err = -1;
- 	  }
-      }
- 
--     r = opkg_configure_packages(NULL);
--     if (!err)
--	  err = r;
-+     if (opkg_configure_packages(NULL) != 0)
-+	  err = -1;
- 
-      write_status_files_if_changed();
- 
-@@ -476,9 +472,9 @@ opkg_install_cmd(int argc, char **argv)
- static int
- opkg_upgrade_cmd(int argc, char **argv)
- {
--     int i, r;
-+     int i;
-      pkg_t *pkg;
--     int err;
-+     int err = 0;
- 
-      signal(SIGINT, sigint_handler);
- 
-@@ -486,9 +482,8 @@ opkg_upgrade_cmd(int argc, char **argv)
- 	  for (i=0; i < argc; i++) {
- 	       char *arg = argv[i];
- 
--               err = opkg_prepare_url_for_install(arg, &arg);
--               if (err)
--                   return err;
-+               if (opkg_prepare_url_for_install(arg, &arg))
-+                   return -1;
- 	  }
- 	  pkg_info_preinstall_check();
- 
-@@ -505,10 +500,12 @@ opkg_upgrade_cmd(int argc, char **argv)
- 	       } else {
- 		    pkg = pkg_hash_fetch_installed_by_name(argv[i]);
- 	       }
--	       if (pkg)
--		    opkg_upgrade_pkg(pkg);
--	       else {
--		    opkg_install_by_name(arg);
-+	       if (pkg) {
-+		    if (opkg_upgrade_pkg(pkg))
-+			    err = -1;
-+	       } else {
-+		    if (opkg_install_by_name(arg))
-+			    err = -1;
-                }
- 	  }
-      } else {
-@@ -519,18 +516,18 @@ opkg_upgrade_cmd(int argc, char **argv)
- 	  pkg_hash_fetch_all_installed(installed);
- 	  for (i = 0; i < installed->len; i++) {
- 	       pkg = installed->pkgs[i];
--	       opkg_upgrade_pkg(pkg);
-+	       if (opkg_upgrade_pkg(pkg))
-+		       err = -1;
- 	  }
- 	  pkg_vec_free(installed);
-      }
- 
--     r = opkg_configure_packages(NULL);
--     if (!err)
--	  err = r;
-+     if (opkg_configure_packages(NULL))
-+	  err = -1;
- 
-      write_status_files_if_changed();
- 
--     return 0;
-+     return err;
- }
- 
- static int
-@@ -550,7 +547,8 @@ opkg_download_cmd(int argc, char **argv)
- 	       continue;
- 	  }
- 
--	  err = opkg_download_pkg(pkg, ".");
-+	  if (opkg_download_pkg(pkg, "."))
-+		  err = -1;
- 
- 	  if (err) {
- 	       opkg_msg(ERROR, "Failed to download %s.\n", pkg->name);
-@@ -713,7 +711,7 @@ opkg_configure_cmd(int argc, char **argv)
- static int
- opkg_remove_cmd(int argc, char **argv)
- {
--     int i, a, done, r, err = 0;
-+     int i, a, done, err = 0;
-      pkg_t *pkg;
-      pkg_t *pkg_to_remove;
-      pkg_vec_t *available;
-@@ -745,15 +743,15 @@ opkg_remove_cmd(int argc, char **argv)
- 	         opkg_msg(ERROR, "Package %s is not installed.\n", pkg->name);
- 	         continue;
-             }
--            if (pkg->state_status == SS_NOT_INSTALLED) {    // Added the control, so every already removed package could be skipped
-+            if (pkg->state_status == SS_NOT_INSTALLED) {
- 	         opkg_msg(ERROR, "Package %s not installed.\n", pkg->name);
-                  continue;
-             }
--            r = opkg_remove_pkg(pkg_to_remove, 0);
--	    if (!err)
--	         err = r;
- 
--            done = 1;
-+            if (opkg_remove_pkg(pkg_to_remove, 0))
-+	         err = -1;
-+	    else
-+                 done = 1;
-         }
-      }
- 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0541-Be-consistent-in-how-to-check-return-codes-for-these.patch b/patches/opkg-0.1.8/0541-Be-consistent-in-how-to-check-return-codes-for-these.patch
deleted file mode 100644
index 75aaebe..0000000
--- a/patches/opkg-0.1.8/0541-Be-consistent-in-how-to-check-return-codes-for-these.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 7bf2f7c967e7face05909894fb57b7ee5ce664d3 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 29 Jun 2010 01:56:10 +0000
-Subject: [PATCH] Be consistent in how to check return codes for these functions.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@541 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_cmd.c |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
-index 1c9f6fc..c5ba3f4 100644
---- a/libopkg/opkg_cmd.c
-+++ b/libopkg/opkg_cmd.c
-@@ -455,13 +455,13 @@ opkg_install_cmd(int argc, char **argv)
- 
-      for (i=0; i < argc; i++) {
- 	  arg = argv[i];
--          if (opkg_install_by_name(arg) != 0) {
-+          if (opkg_install_by_name(arg)) {
- 	       opkg_msg(ERROR, "Cannot install package %s.\n", arg);
- 	       err = -1;
- 	  }
-      }
- 
--     if (opkg_configure_packages(NULL) != 0)
-+     if (opkg_configure_packages(NULL))
- 	  err = -1;
- 
-      write_status_files_if_changed();
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0542-Don-t-unlink-the-lock-file-in-the-event-that-it-cann.patch b/patches/opkg-0.1.8/0542-Don-t-unlink-the-lock-file-in-the-event-that-it-cann.patch
deleted file mode 100644
index 253fc10..0000000
--- a/patches/opkg-0.1.8/0542-Don-t-unlink-the-lock-file-in-the-event-that-it-cann.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 9709cebaa23d60afa0a59d0a3e4713103d907bef Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 8 Jul 2010 00:44:21 +0000
-Subject: [PATCH] Don't unlink the lock file in the event that it cannot be locked.
-
-Fixes Issue #54.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@542 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_conf.c |   15 +++++++++------
- 1 files changed, 9 insertions(+), 6 deletions(-)
-
-diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
-index cd636f1..a145ae7 100644
---- a/libopkg/opkg_conf.c
-+++ b/libopkg/opkg_conf.c
-@@ -486,7 +486,10 @@ opkg_conf_init(void)
- 
- 	if (lockf(lock_fd, F_TLOCK, (off_t)0) == -1) {
- 		opkg_perror(ERROR, "Could not lock %s", lock_file);
--		goto err3;
-+		if (close(lock_fd) == -1)
-+			opkg_perror(ERROR, "Couldn't close descriptor %d (%s)",
-+				lock_fd, lock_file);
-+		goto err2;
- 	}
- 
- 	if (conf->tmp_dir)
-@@ -502,7 +505,7 @@ opkg_conf_init(void)
- 	conf->tmp_dir = mkdtemp(tmp);
- 	if (conf->tmp_dir == NULL) {
- 		opkg_perror(ERROR, "Creating temp dir %s failed", tmp);
--		goto err4;
-+		goto err3;
- 	}
- 
- 	pkg_hash_init();
-@@ -533,14 +536,14 @@ opkg_conf_init(void)
- 	}
- 
- 	if (resolve_pkg_dest_list(&tmp_dest_nv_pair_list))
--		goto err5;
-+		goto err4;
- 
- 	nv_pair_list_deinit(&tmp_dest_nv_pair_list);
- 
- 	return 0;
- 
- 
--err5:
-+err4:
- 	free(conf->lists_dir);
- 
- 	pkg_hash_deinit();
-@@ -549,10 +552,10 @@ err5:
- 
- 	if (rmdir(conf->tmp_dir) == -1)
- 		opkg_perror(ERROR, "Couldn't remove dir %s", conf->tmp_dir);
--err4:
-+err3:
- 	if (lockf(lock_fd, F_ULOCK, (off_t)0) == -1)
- 		opkg_perror(ERROR, "Couldn't unlock %s", lock_file);
--err3:
-+
- 	if (close(lock_fd) == -1)
- 		opkg_perror(ERROR, "Couldn't close descriptor %d (%s)",
- 				lock_fd, lock_file);
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0543-Fix-infinite-loop-in-list_upgradable-in-libopkg.patch b/patches/opkg-0.1.8/0543-Fix-infinite-loop-in-list_upgradable-in-libopkg.patch
deleted file mode 100644
index afd2724..0000000
--- a/patches/opkg-0.1.8/0543-Fix-infinite-loop-in-list_upgradable-in-libopkg.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From d8753f35f12f07b795ba06b8a237842727726f63 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 12 Jul 2010 23:37:21 +0000
-Subject: [PATCH] Fix infinite loop in list_upgradable in libopkg.
-
-From Sebastian Krzyszkowiak.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@543 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/opkg.c b/libopkg/opkg.c
-index 705156a..be38d4f 100644
---- a/libopkg/opkg.c
-+++ b/libopkg/opkg.c
-@@ -760,7 +760,7 @@ opkg_list_upgradable_packages(opkg_package_callback_t callback, void *user_data)
- 
- 	head = prepare_upgrade_list();
- 	for (node = active_list_next(head, head); node;
--	     active_list_next(head, node)) {
-+	     node = active_list_next(head, node)) {
- 		old = list_entry(node, pkg_t, list);
- 		new = pkg_hash_fetch_best_installation_candidate_by_name(old->name);
- 		if (new == NULL)
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0544-Fix-creation-of-symlinks-to-files-with-long-names-gr.patch b/patches/opkg-0.1.8/0544-Fix-creation-of-symlinks-to-files-with-long-names-gr.patch
deleted file mode 100644
index 204827a..0000000
--- a/patches/opkg-0.1.8/0544-Fix-creation-of-symlinks-to-files-with-long-names-gr.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From 97a819864c3f143c4da81e17f32330ba2f1a170c Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Wed, 4 Aug 2010 00:45:57 +0000
-Subject: [PATCH] Fix creation of symlinks to files with long names (greater than 100 chars).
-
-From "paradox.kahn", see Issue #55.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@544 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libbb/unarchive.c |   18 +++++++++++-------
- 1 files changed, 11 insertions(+), 7 deletions(-)
-
-diff --git a/libbb/unarchive.c b/libbb/unarchive.c
-index bf57a04..b063c63 100644
---- a/libbb/unarchive.c
-+++ b/libbb/unarchive.c
-@@ -466,7 +466,7 @@ get_header_tar(FILE *tar_stream)
- 	}
- 
- 	if (fread(tar.raw, 1, 512, tar_stream) != 512) {
--		/* Unfortunatly its common for tar files to have all sorts of
-+		/* Unfortunately its common for tar files to have all sorts of
- 		 * trailing garbage, fail silently */
- //		error_msg("Couldnt read header");
- 		return(NULL);
-@@ -505,10 +505,6 @@ get_header_tar(FILE *tar_stream)
-         if (longname) {
-                 tar_entry->name = longname;
-                 longname = NULL;
--        }
--        else if (linkname) {
--                tar_entry->name = linkname;
--                linkname = NULL;
-         } else
- #endif
-         {
-@@ -534,7 +530,16 @@ get_header_tar(FILE *tar_stream)
- 	tar_entry->gid   = strtol(tar.formated.gid, NULL, 8);
- 	tar_entry->size  = strtol(tar.formated.size, NULL, 8);
- 	tar_entry->mtime = strtol(tar.formated.mtime, NULL, 8);
--	tar_entry->link_name  = *tar.formated.linkname != '\0' ? xstrndup(tar.formated.linkname, 100) : NULL;
-+#ifdef CONFIG_FEATURE_TAR_GNU_EXTENSIONS
-+	if (linkname) {
-+		tar_entry->link_name = linkname;
-+		linkname = NULL;
-+	} else
-+#endif
-+	{
-+		tar_entry->link_name = *tar.formated.linkname != '\0' ?
-+			xstrndup(tar.formated.linkname, 100) : NULL;
-+	}
- 	tar_entry->device = (strtol(tar.formated.devmajor, NULL, 8) << 8) +
- 		strtol(tar.formated.devminor, NULL, 8);
- 
-@@ -586,7 +591,6 @@ get_header_tar(FILE *tar_stream)
- 			linkname[tar_entry->size] = '\0';
- 			archive_offset += tar_entry->size;
- 
--			tar_entry->name = linkname;
- 			return(get_header_tar(tar_stream));
- 		}
- 	case 'D':
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0545-This-was-done-some-time-ago.patch b/patches/opkg-0.1.8/0545-This-was-done-some-time-ago.patch
deleted file mode 100644
index 7a5bf70..0000000
--- a/patches/opkg-0.1.8/0545-This-was-done-some-time-ago.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 0e4ead567cedfcd827fd8c4850aa4a9d83aeec85 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 10 Aug 2010 05:37:59 +0000
-Subject: [PATCH] This was done some time ago.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@545 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- TODO |    4 ----
- 1 files changed, 0 insertions(+), 4 deletions(-)
-
-diff --git a/TODO b/TODO
-index eb29da9..969bad8 100644
---- a/TODO
-+++ b/TODO
-@@ -20,10 +20,6 @@ See issue list: http://code.google.com/p/opkg/issues/list
- 
-  * Reduce memory used per pkg_t and peak memory use in general.
- 
-- * Refactor opkg_conf_t *conf.
--   Make it global instead of passing it to every function.
--   Remove args_t args in favour of conf.
--
-  * #includes are a mess.
- 
-  * Refactor opkg_install_pkg() into more precise functions.
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0546-This-will-never-be-done-offline-roots-often-point-at.patch b/patches/opkg-0.1.8/0546-This-will-never-be-done-offline-roots-often-point-at.patch
deleted file mode 100644
index 1eabfa6..0000000
--- a/patches/opkg-0.1.8/0546-This-will-never-be-done-offline-roots-often-point-at.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 44bc1bfda88ca36f92354ffad7abd3d4ced1535f Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 10 Aug 2010 05:38:10 +0000
-Subject: [PATCH] This will never be done, offline roots often point at other architectures.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@546 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- TODO |    2 --
- 1 files changed, 0 insertions(+), 2 deletions(-)
-
-diff --git a/TODO b/TODO
-index 969bad8..0777b1c 100644
---- a/TODO
-+++ b/TODO
-@@ -38,7 +38,5 @@ FEATURES
- 
-  * Start with all "XXX: FEATURE" comments. Remove them if they are bogus.
- 
-- * Implement chrooting to an offline_root for running maintainer scripts.
--
-  * Improve dpkg compatibility, according to the Debian Policy Manual.
-    http://www.debian.org/doc/debian-policy/ch-controlfields.html
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0547-Add-man-pages-for-opkg-cl-and-opkg-keys.-From-David-.patch b/patches/opkg-0.1.8/0547-Add-man-pages-for-opkg-cl-and-opkg-keys.-From-David-.patch
deleted file mode 100644
index 2c32861..0000000
--- a/patches/opkg-0.1.8/0547-Add-man-pages-for-opkg-cl-and-opkg-keys.-From-David-.patch
+++ /dev/null
@@ -1,480 +0,0 @@
-From 904a922a270d449494c3dcd2be35d2ac219fbd30 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 10 Aug 2010 05:38:23 +0000
-Subject: [PATCH] Add man pages for opkg-cl and opkg-keys. From David Bachelart (Issue #56).
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@547 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- man/Makefile.am   |    2 +
- man/opkg-cl.1     |  176 +++++++++++++++++++++++++++++++++++++++++++++++++++++
- man/opkg-cl.1.in  |  176 +++++++++++++++++++++++++++++++++++++++++++++++++++++
- man/opkg-key.1    |   37 +++++++++++
- man/opkg-key.1.in |   37 +++++++++++
- 5 files changed, 428 insertions(+), 0 deletions(-)
- create mode 100644 man/Makefile.am
- create mode 100644 man/opkg-cl.1
- create mode 100644 man/opkg-cl.1.in
- create mode 100644 man/opkg-key.1
- create mode 100644 man/opkg-key.1.in
-
-diff --git a/man/Makefile.am b/man/Makefile.am
-new file mode 100644
-index 0000000..6d0a535
---- /dev/null
-+++ b/man/Makefile.am
-@@ -0,0 +1,2 @@
-+man_MANS=opkg-cl.1 \
-+  opkg-key.1
-diff --git a/man/opkg-cl.1 b/man/opkg-cl.1
-new file mode 100644
-index 0000000..439caf7
---- /dev/null
-+++ b/man/opkg-cl.1
-@@ -0,0 +1,176 @@
-+.TH "opkg" 1 "August 2010" "opkg 0.1.8" "User Commands"
-+.SH NAME
-+opkg-cl \- command line utility to install, upgrade and uninstall opkg
-+software packages
-+.
-+.SH SYNOPSIS
-+.B \fBopkg-cl\fP [\fIOPTIONS...\fP] \fIsub-command\fP [\fIARGUMENTS...\fP]
-+.
-+.SH DESCRIPTION
-+\fBopkg-cl\fP is a simple utility to install, upgrade and uninstall opkg
-+software packages. Opkg is a lightweight package management system based 
-+on Ipkg.
-+.
-+.SH "OPTIONS AND COMMANDS"
-+.SS SUB-COMMANDS : PACKAGE MANIPULATION
-+.TP
-+\fBupdate\fR
-+Update list of available packages
-+.TP
-+\fBupgrade\fR
-+Upgrade installed packages
-+.TP
-+\fBinstall <\fIpackage(s)\fP>\fR
-+Install \fIpackage(s)\fP
-+.TP
-+\fBconfigure <\fIpackage(s)\fP>\fR
-+Configure unpacked \fIpackage(s)\fP
-+.TP
-+\fBremove <\fIpackages\fP|\fIregexp\fP>\fR
-+Remove \fIpackage(s)\fP. \fIregexp\fP could be something like 'pkgname*' '*file*' or similar
-+.TP
-+\fBflag <\fIflag\fP> <\fIpackages\fP>\fR
-+Flag \fIpackage(s)\fP. Available flags (one per invocation):
-+.TS
-+tab(@);
-+l. 
-+hold
-+noprune
-+user
-+ok
-+installed
-+unpacked
-+.TE
-+.SS INFORMATIONAL SUB-COMMANDS
-+.TP
-+\fBlist\fR
-+List available packages
-+.TP
-+\fBlist-installed\fR
-+List installed packages
-+.TP
-+\fBlist-upgradable\fR
-+List installed and upgradable packages
-+.TP
-+\fBfiles <\fIpackage\fP>\fR
-+List files belonging to \fIpackage\fP
-+.TP
-+\fBsearch <\fIfile\fP|\fIregexp\fP>\fR
-+List package providing \fIfile\fP
-+.TP
-+\fBinfo [\fIpackage\fP|\fIregexp\fP]\fR
-+Display all info for selected packages
-+.TP
-+\fBstatus [\fIpackage\fP|\fIregexp\fP]\fR
-+Display all statuses for selected packages
-+.TP
-+\fBdownload <\fIpackage\fP>\fR
-+Download \fIpackage\fP to current directory
-+.TP
-+\fBcompare-version <\fIversion1\fP> <\fIoperator\fP> <\fIversion2\fP>\fR
-+compare versions using following operators :
-+.TS
-+tab(@);
-+c l. 
-+<<@less than
-+<@less than or equal to
-+<=@less than or equal to
-+ =@equal to
-+>=@greater than or equal to
-+>@greater than or equal to
-+>>@greater than
-+.TE
-+.TP
-+\fBprint-architecture\fR
-+List installable package architectures
-+.TP
-+\fBwhatdepends [\fI\-A\fP] <\fIpackage(s)\fP|\fIregexp\fP>\fR
-+.TP
-+\fBwhatdependsrec [\fI\-A\fP] <\fIpackage(s)\fP|\fIregexp\fP>\fR
-+.TP
-+\fBwhatprovides [\fI\-A\fP] <\fIpackage(s)\fP|\fIregexp\fP>\fR
-+.TP
-+\fBwhatconflicts [\fI\-A\fP] <\fIpackage(s)\fP|\fIregexp\fP>\fR
-+.TP
-+\fBwhatreplaces [\fI\-A\fP] <\fIpackage(s)\fP|\fIregexp\fP>\fR
-+
-+.SS OPTIONS
-+.TP 
-+\fB\-A\fR
-+Query all packages not just those installed
-+.
-+.TP
-+\fB\-v <\fIlevel\fP>, --verbosity <\fIlevel\fP>\fR
-+Set verbosity level to \fIlevel\fP. Verbosity levels :
-+.TS
-+tab(@);
-+l l.
-+0@errors only
-+1@normal messages (default)
-+2@informative messages
-+3@debug
-+4@debug level 2
-+.TE
-+.
-+.TP
-+\fB\-f <\fIconf_file\fP>, \fB\--conf <\fIconf_file\fP>\fR
-+Use \fIconf_file\fP as the opkg configuration file
-+.TP
-+\fB\--cache <\fIdirectory\fP>\fR
-+Use a package cache
-+.TP
-+\fB\-d <\fIdest_name\fP>, \fB\--dest <\fIdest_name\fP>\fR
-+Use \fIdest_name\fP as the the root directory for
-+package installation, removal, upgrading. \fIdest_name\fP should be a 
-+defined dest name from the configuration file, (but can also be a
-+directory name in a pinch).
-+.TP 
-+\fB\-o <\fIdirectory\fP>, \fB\--offline-root <\fIdirectory\fP>\fR
-+Use \fIdirectory\fP as the root directory for offline installation of 
-+packages.
-+.SS FORCE OPTIONS
-+.TP 
-+\fB\--force-depends \fR
-+Install/remove despite failed dependencies
-+.TP 
-+\fB\--force-maintainer \fR
-+Overwrite preexisting config files
-+.TP 
-+\fB\--force-reinstall \fR
-+Reinstall package(s)
-+.TP 
-+\fB\--force-overwrite\fR
-+Overwrite files from other package(s)
-+.TP 
-+\fB\--force-downgrade\fR
-+Allow opkg-cl to downgrade packages
-+.TP 
-+\fB\--force-space \fR
-+Disable free space checks
-+.TP 
-+\fB\--noaction\fR
-+No action \- test only
-+.TP 
-+\fB\--download-only\fR
-+No action \- download only
-+.TP 
-+\fB\--nodeps\fR
-+Do not follow dependencies
-+.TP 
-+\fB\--force-removal-of-dependent-packages\fR
-+Remove package and all dependencies
-+.TP 
-+\fB\--autoremove\fR
-+Remove packages that were installed automatically to satisfy dependencies
-+.TP 
-+\fB\-t <\fIdirectory\fP>, \--tmp-dir <\fIdirectory\fP>\fR
-+Specify \fIdirectory\fP as temporary directory
-+.
-+.SH "REPORTING BUGS"
-+Report bugs to http://code.google.com/p/opkg/issues/list
-+.
-+.P
-+Copyright \(co Opkg development team.
-+.P
-+Copyright \(co Ipkg development team.
-+.
-diff --git a/man/opkg-cl.1.in b/man/opkg-cl.1.in
-new file mode 100644
-index 0000000..9c617f0
---- /dev/null
-+++ b/man/opkg-cl.1.in
-@@ -0,0 +1,176 @@
-+.TH "@PACKAGE_NAME@" 1 "@CLEAN_DATE@" "@PACKAGE_STRING@" "User Commands"
-+.SH NAME
-+opkg-cl \- command line utility to install, upgrade and uninstall opkg
-+software packages
-+.
-+.SH SYNOPSIS
-+.B \fBopkg-cl\fP [\fIOPTIONS...\fP] \fIsub-command\fP [\fIARGUMENTS...\fP]
-+.
-+.SH DESCRIPTION
-+\fBopkg-cl\fP is a simple utility to install, upgrade and uninstall opkg
-+software packages. Opkg is a lightweight package management system based 
-+on Ipkg.
-+.
-+.SH "OPTIONS AND COMMANDS"
-+.SS SUB-COMMANDS : PACKAGE MANIPULATION
-+.TP
-+\fBupdate\fR
-+Update list of available packages
-+.TP
-+\fBupgrade\fR
-+Upgrade installed packages
-+.TP
-+\fBinstall <\fIpackage(s)\fP>\fR
-+Install \fIpackage(s)\fP
-+.TP
-+\fBconfigure <\fIpackage(s)\fP>\fR
-+Configure unpacked \fIpackage(s)\fP
-+.TP
-+\fBremove <\fIpackages\fP|\fIregexp\fP>\fR
-+Remove \fIpackage(s)\fP. \fIregexp\fP could be something like 'pkgname*' '*file*' or similar
-+.TP
-+\fBflag <\fIflag\fP> <\fIpackages\fP>\fR
-+Flag \fIpackage(s)\fP. Available flags (one per invocation):
-+.TS
-+tab(@);
-+l. 
-+hold
-+noprune
-+user
-+ok
-+installed
-+unpacked
-+.TE
-+.SS INFORMATIONAL SUB-COMMANDS
-+.TP
-+\fBlist\fR
-+List available packages
-+.TP
-+\fBlist-installed\fR
-+List installed packages
-+.TP
-+\fBlist-upgradable\fR
-+List installed and upgradable packages
-+.TP
-+\fBfiles <\fIpackage\fP>\fR
-+List files belonging to \fIpackage\fP
-+.TP
-+\fBsearch <\fIfile\fP|\fIregexp\fP>\fR
-+List package providing \fIfile\fP
-+.TP
-+\fBinfo [\fIpackage\fP|\fIregexp\fP]\fR
-+Display all info for selected packages
-+.TP
-+\fBstatus [\fIpackage\fP|\fIregexp\fP]\fR
-+Display all statuses for selected packages
-+.TP
-+\fBdownload <\fIpackage\fP>\fR
-+Download \fIpackage\fP to current directory
-+.TP
-+\fBcompare-version <\fIversion1\fP> <\fIoperator\fP> <\fIversion2\fP>\fR
-+compare versions using following operators :
-+.TS
-+tab(@);
-+c l. 
-+<<@less than
-+<@less than or equal to
-+<=@less than or equal to
-+ =@equal to
-+>=@greater than or equal to
-+>@greater than or equal to
-+>>@greater than
-+.TE
-+.TP
-+\fBprint-architecture\fR
-+List installable package architectures
-+.TP
-+\fBwhatdepends [\fI\-A\fP] <\fIpackage(s)\fP|\fIregexp\fP>\fR
-+.TP
-+\fBwhatdependsrec [\fI\-A\fP] <\fIpackage(s)\fP|\fIregexp\fP>\fR
-+.TP
-+\fBwhatprovides [\fI\-A\fP] <\fIpackage(s)\fP|\fIregexp\fP>\fR
-+.TP
-+\fBwhatconflicts [\fI\-A\fP] <\fIpackage(s)\fP|\fIregexp\fP>\fR
-+.TP
-+\fBwhatreplaces [\fI\-A\fP] <\fIpackage(s)\fP|\fIregexp\fP>\fR
-+
-+.SS OPTIONS
-+.TP 
-+\fB\-A\fR
-+Query all packages not just those installed
-+.
-+.TP
-+\fB\-v <\fIlevel\fP>, --verbosity <\fIlevel\fP>\fR
-+Set verbosity level to \fIlevel\fP. Verbosity levels :
-+.TS
-+tab(@);
-+l l.
-+0@errors only
-+1@normal messages (default)
-+2@informative messages
-+3@debug
-+4@debug level 2
-+.TE
-+.
-+.TP
-+\fB\-f <\fIconf_file\fP>, \fB\--conf <\fIconf_file\fP>\fR
-+Use \fIconf_file\fP as the opkg configuration file
-+.TP
-+\fB\--cache <\fIdirectory\fP>\fR
-+Use a package cache
-+.TP
-+\fB\-d <\fIdest_name\fP>, \fB\--dest <\fIdest_name\fP>\fR
-+Use \fIdest_name\fP as the the root directory for
-+package installation, removal, upgrading. \fIdest_name\fP should be a 
-+defined dest name from the configuration file, (but can also be a
-+directory name in a pinch).
-+.TP 
-+\fB\-o <\fIdirectory\fP>, \fB\--offline-root <\fIdirectory\fP>\fR
-+Use \fIdirectory\fP as the root directory for offline installation of 
-+packages.
-+.SS FORCE OPTIONS
-+.TP 
-+\fB\--force-depends \fR
-+Install/remove despite failed dependencies
-+.TP 
-+\fB\--force-maintainer \fR
-+Overwrite preexisting config files
-+.TP 
-+\fB\--force-reinstall \fR
-+Reinstall package(s)
-+.TP 
-+\fB\--force-overwrite\fR
-+Overwrite files from other package(s)
-+.TP 
-+\fB\--force-downgrade\fR
-+Allow opkg-cl to downgrade packages
-+.TP 
-+\fB\--force-space \fR
-+Disable free space checks
-+.TP 
-+\fB\--noaction\fR
-+No action \- test only
-+.TP 
-+\fB\--download-only\fR
-+No action \- download only
-+.TP 
-+\fB\--nodeps\fR
-+Do not follow dependencies
-+.TP 
-+\fB\--force-removal-of-dependent-packages\fR
-+Remove package and all dependencies
-+.TP 
-+\fB\--autoremove\fR
-+Remove packages that were installed automatically to satisfy dependencies
-+.TP 
-+\fB\-t <\fIdirectory\fP>, \--tmp-dir <\fIdirectory\fP>\fR
-+Specify \fIdirectory\fP as temporary directory
-+.
-+.SH "REPORTING BUGS"
-+Report bugs to http://code.google.com/p/opkg/issues/list
-+.
-+.P
-+Copyright \(co Opkg development team.
-+.P
-+Copyright \(co Ipkg development team.
-+.
-diff --git a/man/opkg-key.1 b/man/opkg-key.1
-new file mode 100644
-index 0000000..ca61fcc
---- /dev/null
-+++ b/man/opkg-key.1
-@@ -0,0 +1,37 @@
-+.TH "opkg" 1 "August 2010" "opkg 0.1.8" "User Commands"
-+.SH NAME
-+opkg-key \- utility to manage opkg's list of trusted keys
-+
-+.
-+.SH SYNOPSIS
-+.B \fBopkg-key\fP [\fIOPTIONS...\fP] \fIsub-command\fP [\fIARGUMENTS...\fP]
-+.
-+.SH DESCRIPTION
-+\fBopkg-key\fP is a utility to manage opkg's list of trusted keys. Opkg
-+is a lightweight package management system based on Ipkg.
-+.
-+.SH SUB-COMMANDS
-+.TP
-+\fBadd <\fIfile\fP>\fR
-+add the key contained in \fIfile\fP ('\-' for stdin)
-+.TP
-+\fBdel <\fIkeyid\fP>\fR
-+remove the key \fIkeyid\fP
-+.TP
-+\fBlist\fR
-+list trusted keys
-+.
-+.SH OPTIONS
-+.TP
-+\fB\-o <\fIroot\fP>\fR
-+use \fIroot\fP as the offline root directory
-+.
-+.SH "REPORTING BUGS"
-+Report bugs to http://code.google.com/p/opkg/issues/list
-+.
-+.SH COPYRIGHT
-+.P
-+Copyright \(co Opkg development team.
-+.P
-+Copyright \(co Ipkg development team.
-+.
-diff --git a/man/opkg-key.1.in b/man/opkg-key.1.in
-new file mode 100644
-index 0000000..f1aa221
---- /dev/null
-+++ b/man/opkg-key.1.in
-@@ -0,0 +1,37 @@
-+.TH "@PACKAGE_NAME@" 1 "@CLEAN_DATE@" "@PACKAGE_STRING@" "User Commands"
-+.SH NAME
-+opkg-key \- utility to manage opkg's list of trusted keys
-+
-+.
-+.SH SYNOPSIS
-+.B \fBopkg-key\fP [\fIOPTIONS...\fP] \fIsub-command\fP [\fIARGUMENTS...\fP]
-+.
-+.SH DESCRIPTION
-+\fBopkg-key\fP is a utility to manage opkg's list of trusted keys. Opkg
-+is a lightweight package management system based on Ipkg.
-+.
-+.SH SUB-COMMANDS
-+.TP
-+\fBadd <\fIfile\fP>\fR
-+add the key contained in \fIfile\fP ('\-' for stdin)
-+.TP
-+\fBdel <\fIkeyid\fP>\fR
-+remove the key \fIkeyid\fP
-+.TP
-+\fBlist\fR
-+list trusted keys
-+.
-+.SH OPTIONS
-+.TP
-+\fB\-o <\fIroot\fP>\fR
-+use \fIroot\fP as the offline root directory
-+.
-+.SH "REPORTING BUGS"
-+Report bugs to http://code.google.com/p/opkg/issues/list
-+.
-+.SH COPYRIGHT
-+.P
-+Copyright \(co Opkg development team.
-+.P
-+Copyright \(co Ipkg development team.
-+.
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0548-Forgot-these-two-files-in-the-last-commit.-Oops.patch b/patches/opkg-0.1.8/0548-Forgot-these-two-files-in-the-last-commit.-Oops.patch
deleted file mode 100644
index 59c4d0d..0000000
--- a/patches/opkg-0.1.8/0548-Forgot-these-two-files-in-the-last-commit.-Oops.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 9f30e19b2dcab0be5c84ea7fe34d6d466c6c1675 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 10 Aug 2010 05:38:37 +0000
-Subject: [PATCH] Forgot these two files in the last commit. Oops.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@548 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- Makefile.am  |    2 +-
- configure.ac |    6 +++++-
- 2 files changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/Makefile.am b/Makefile.am
-index 7e3d0ef..26f2d99 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -1,6 +1,6 @@
- ACLOCAL_AMFLAGS = -I shave
- 
--SUBDIRS = libbb libopkg src tests utils
-+SUBDIRS = libbb libopkg src tests utils man
- 
- 
- HOST_CPU=@host_cpu@
-diff --git a/configure.ac b/configure.ac
-index f386b52..907911b 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -270,11 +270,12 @@ Use --disable-gpg if you want OpenSSL smime signatures])
- 	fi
- fi
- 
--
-+CLEAN_DATE=`date +"%B %Y" | tr -d '\n'`
- 
- AC_SUBST(opkglibdir)
- AC_SUBST(opkgetcdir)
- AC_SUBST(opkglockfile)
-+AC_SUBST([CLEAN_DATE])
- 
- # Setup output beautifier.
- SHAVE_INIT([shave], [enable])
-@@ -290,4 +291,7 @@ AC_OUTPUT(
-     libopkg.pc
-     shave/shave
-     shave/shave-libtool
-+    man/Makefile
-+    man/opkg-cl.1
-+    man/opkg-key.1
-     )
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0549-And-remove-the-autogenerated-files.patch b/patches/opkg-0.1.8/0549-And-remove-the-autogenerated-files.patch
deleted file mode 100644
index cc3eaae..0000000
--- a/patches/opkg-0.1.8/0549-And-remove-the-autogenerated-files.patch
+++ /dev/null
@@ -1,241 +0,0 @@
-From 8c100d3105425ddd7d660d662ebc9dfa40f7b26d Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 10 Aug 2010 05:39:44 +0000
-Subject: [PATCH] And remove the autogenerated files...
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@549 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- man/opkg-cl.1  |  176 --------------------------------------------------------
- man/opkg-key.1 |   37 ------------
- 2 files changed, 0 insertions(+), 213 deletions(-)
- delete mode 100644 man/opkg-cl.1
- delete mode 100644 man/opkg-key.1
-
-diff --git a/man/opkg-cl.1 b/man/opkg-cl.1
-deleted file mode 100644
-index 439caf7..0000000
---- a/man/opkg-cl.1
-+++ /dev/null
-@@ -1,176 +0,0 @@
--.TH "opkg" 1 "August 2010" "opkg 0.1.8" "User Commands"
--.SH NAME
--opkg-cl \- command line utility to install, upgrade and uninstall opkg
--software packages
--.
--.SH SYNOPSIS
--.B \fBopkg-cl\fP [\fIOPTIONS...\fP] \fIsub-command\fP [\fIARGUMENTS...\fP]
--.
--.SH DESCRIPTION
--\fBopkg-cl\fP is a simple utility to install, upgrade and uninstall opkg
--software packages. Opkg is a lightweight package management system based 
--on Ipkg.
--.
--.SH "OPTIONS AND COMMANDS"
--.SS SUB-COMMANDS : PACKAGE MANIPULATION
--.TP
--\fBupdate\fR
--Update list of available packages
--.TP
--\fBupgrade\fR
--Upgrade installed packages
--.TP
--\fBinstall <\fIpackage(s)\fP>\fR
--Install \fIpackage(s)\fP
--.TP
--\fBconfigure <\fIpackage(s)\fP>\fR
--Configure unpacked \fIpackage(s)\fP
--.TP
--\fBremove <\fIpackages\fP|\fIregexp\fP>\fR
--Remove \fIpackage(s)\fP. \fIregexp\fP could be something like 'pkgname*' '*file*' or similar
--.TP
--\fBflag <\fIflag\fP> <\fIpackages\fP>\fR
--Flag \fIpackage(s)\fP. Available flags (one per invocation):
--.TS
--tab(@);
--l. 
--hold
--noprune
--user
--ok
--installed
--unpacked
--.TE
--.SS INFORMATIONAL SUB-COMMANDS
--.TP
--\fBlist\fR
--List available packages
--.TP
--\fBlist-installed\fR
--List installed packages
--.TP
--\fBlist-upgradable\fR
--List installed and upgradable packages
--.TP
--\fBfiles <\fIpackage\fP>\fR
--List files belonging to \fIpackage\fP
--.TP
--\fBsearch <\fIfile\fP|\fIregexp\fP>\fR
--List package providing \fIfile\fP
--.TP
--\fBinfo [\fIpackage\fP|\fIregexp\fP]\fR
--Display all info for selected packages
--.TP
--\fBstatus [\fIpackage\fP|\fIregexp\fP]\fR
--Display all statuses for selected packages
--.TP
--\fBdownload <\fIpackage\fP>\fR
--Download \fIpackage\fP to current directory
--.TP
--\fBcompare-version <\fIversion1\fP> <\fIoperator\fP> <\fIversion2\fP>\fR
--compare versions using following operators :
--.TS
--tab(@);
--c l. 
--<<@less than
--<@less than or equal to
--<=@less than or equal to
-- =@equal to
-->=@greater than or equal to
-->@greater than or equal to
-->>@greater than
--.TE
--.TP
--\fBprint-architecture\fR
--List installable package architectures
--.TP
--\fBwhatdepends [\fI\-A\fP] <\fIpackage(s)\fP|\fIregexp\fP>\fR
--.TP
--\fBwhatdependsrec [\fI\-A\fP] <\fIpackage(s)\fP|\fIregexp\fP>\fR
--.TP
--\fBwhatprovides [\fI\-A\fP] <\fIpackage(s)\fP|\fIregexp\fP>\fR
--.TP
--\fBwhatconflicts [\fI\-A\fP] <\fIpackage(s)\fP|\fIregexp\fP>\fR
--.TP
--\fBwhatreplaces [\fI\-A\fP] <\fIpackage(s)\fP|\fIregexp\fP>\fR
--
--.SS OPTIONS
--.TP 
--\fB\-A\fR
--Query all packages not just those installed
--.
--.TP
--\fB\-v <\fIlevel\fP>, --verbosity <\fIlevel\fP>\fR
--Set verbosity level to \fIlevel\fP. Verbosity levels :
--.TS
--tab(@);
--l l.
--0@errors only
--1@normal messages (default)
--2@informative messages
--3@debug
--4@debug level 2
--.TE
--.
--.TP
--\fB\-f <\fIconf_file\fP>, \fB\--conf <\fIconf_file\fP>\fR
--Use \fIconf_file\fP as the opkg configuration file
--.TP
--\fB\--cache <\fIdirectory\fP>\fR
--Use a package cache
--.TP
--\fB\-d <\fIdest_name\fP>, \fB\--dest <\fIdest_name\fP>\fR
--Use \fIdest_name\fP as the the root directory for
--package installation, removal, upgrading. \fIdest_name\fP should be a 
--defined dest name from the configuration file, (but can also be a
--directory name in a pinch).
--.TP 
--\fB\-o <\fIdirectory\fP>, \fB\--offline-root <\fIdirectory\fP>\fR
--Use \fIdirectory\fP as the root directory for offline installation of 
--packages.
--.SS FORCE OPTIONS
--.TP 
--\fB\--force-depends \fR
--Install/remove despite failed dependencies
--.TP 
--\fB\--force-maintainer \fR
--Overwrite preexisting config files
--.TP 
--\fB\--force-reinstall \fR
--Reinstall package(s)
--.TP 
--\fB\--force-overwrite\fR
--Overwrite files from other package(s)
--.TP 
--\fB\--force-downgrade\fR
--Allow opkg-cl to downgrade packages
--.TP 
--\fB\--force-space \fR
--Disable free space checks
--.TP 
--\fB\--noaction\fR
--No action \- test only
--.TP 
--\fB\--download-only\fR
--No action \- download only
--.TP 
--\fB\--nodeps\fR
--Do not follow dependencies
--.TP 
--\fB\--force-removal-of-dependent-packages\fR
--Remove package and all dependencies
--.TP 
--\fB\--autoremove\fR
--Remove packages that were installed automatically to satisfy dependencies
--.TP 
--\fB\-t <\fIdirectory\fP>, \--tmp-dir <\fIdirectory\fP>\fR
--Specify \fIdirectory\fP as temporary directory
--.
--.SH "REPORTING BUGS"
--Report bugs to http://code.google.com/p/opkg/issues/list
--.
--.P
--Copyright \(co Opkg development team.
--.P
--Copyright \(co Ipkg development team.
--.
-diff --git a/man/opkg-key.1 b/man/opkg-key.1
-deleted file mode 100644
-index ca61fcc..0000000
---- a/man/opkg-key.1
-+++ /dev/null
-@@ -1,37 +0,0 @@
--.TH "opkg" 1 "August 2010" "opkg 0.1.8" "User Commands"
--.SH NAME
--opkg-key \- utility to manage opkg's list of trusted keys
--
--.
--.SH SYNOPSIS
--.B \fBopkg-key\fP [\fIOPTIONS...\fP] \fIsub-command\fP [\fIARGUMENTS...\fP]
--.
--.SH DESCRIPTION
--\fBopkg-key\fP is a utility to manage opkg's list of trusted keys. Opkg
--is a lightweight package management system based on Ipkg.
--.
--.SH SUB-COMMANDS
--.TP
--\fBadd <\fIfile\fP>\fR
--add the key contained in \fIfile\fP ('\-' for stdin)
--.TP
--\fBdel <\fIkeyid\fP>\fR
--remove the key \fIkeyid\fP
--.TP
--\fBlist\fR
--list trusted keys
--.
--.SH OPTIONS
--.TP
--\fB\-o <\fIroot\fP>\fR
--use \fIroot\fP as the offline root directory
--.
--.SH "REPORTING BUGS"
--Report bugs to http://code.google.com/p/opkg/issues/list
--.
--.SH COPYRIGHT
--.P
--Copyright \(co Opkg development team.
--.P
--Copyright \(co Ipkg development team.
--.
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0550-Fix-segfault-using-the-verbosity-option.patch b/patches/opkg-0.1.8/0550-Fix-segfault-using-the-verbosity-option.patch
deleted file mode 100644
index a6284d3..0000000
--- a/patches/opkg-0.1.8/0550-Fix-segfault-using-the-verbosity-option.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From d8b2e77ac150010224cfefdd8668223203473dab Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 12 Aug 2010 00:37:47 +0000
-Subject: [PATCH] Fix segfault using the --verbosity option.
-
-Patch from David Bachelart via Issue #57.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@550 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- src/opkg-cl.c |   10 ++++++----
- 1 files changed, 6 insertions(+), 4 deletions(-)
-
-diff --git a/src/opkg-cl.c b/src/opkg-cl.c
-index ae63012..a09275f 100644
---- a/src/opkg-cl.c
-+++ b/src/opkg-cl.c
-@@ -95,7 +95,7 @@ args_parse(int argc, char *argv[])
- 	int parse_err = 0;
- 
- 	while (1) {
--		c = getopt_long_only(argc, argv, "Ad:f:no:p:t:vV:",
-+		c = getopt_long_only(argc, argv, "Ad:f:no:p:t:vV::",
- 				long_options, &option_index);
- 		if (c == -1)
- 			break;
-@@ -120,7 +120,9 @@ args_parse(int argc, char *argv[])
- 			printf("opkg version %s\n", VERSION);
- 			exit(0);
- 		case 'V':
--			conf->verbosity = atoi(optarg);
-+			conf->verbosity = INFO;
-+			if (optarg != NULL)
-+				conf->verbosity = atoi(optarg);
- 			break;
- 		case ARGS_OPT_AUTOREMOVE:
- 			conf->autoremove = 1;
-@@ -214,8 +216,8 @@ usage()
- 
- 	printf("\nOptions:\n");
- 	printf("\t-A			Query all packages not just those installed\n"); 
--	printf("\t-V <level>		Set verbosity level to <level>.\n");
--	printf("\t--verbosity <level>	Verbosity levels:\n");
-+	printf("\t-V[<level>]		Set verbosity level to <level>.\n");
-+	printf("\t--verbosity[=<level>]	Verbosity levels:\n");
- 	printf("\t				0 errors only\n");
- 	printf("\t				1 normal messages (default)\n");
- 	printf("\t				2 informative messages\n");
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0551-Remove-outdated-comment-regarding-an-old-bug.patch b/patches/opkg-0.1.8/0551-Remove-outdated-comment-regarding-an-old-bug.patch
deleted file mode 100644
index 37e7f10..0000000
--- a/patches/opkg-0.1.8/0551-Remove-outdated-comment-regarding-an-old-bug.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From 0eb2cb22be9a69e9562fea935617864cc0e5f217 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Wed, 18 Aug 2010 02:27:08 +0000
-Subject: [PATCH] Remove outdated comment regarding an old bug.
-
-I managed to track down the "bug 1277" this comment referred to.
-http://web.archive.org/web/20050503234854/http://handhelds.org/~bugzilla/show_bug.cgi?id=1277
-
-This referred to the status file containing incorrect information after a
-failed upgrade.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@551 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_install.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
-index 49e14fc..2693274 100644
---- a/libopkg/opkg_install.c
-+++ b/libopkg/opkg_install.c
-@@ -1172,7 +1172,7 @@ opkg_install_by_name(const char *pkg_name)
- 	       return 0;
- 	  } else if (cmp < 0) {
- 	       new->dest = old->dest;
--	       old->state_want = SW_DEINSTALL;    /* Here probably the problem for bug 1277 */
-+	       old->state_want = SW_DEINSTALL;
- 	  }
- 	  free(old_version);
- 	  free(new_version);
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0552-Remove-trailing-whitespace.-Sorry-if-this-breaks-you.patch b/patches/opkg-0.1.8/0552-Remove-trailing-whitespace.-Sorry-if-this-breaks-you.patch
deleted file mode 100644
index 5f0f8b9..0000000
--- a/patches/opkg-0.1.8/0552-Remove-trailing-whitespace.-Sorry-if-this-breaks-you.patch
+++ /dev/null
@@ -1,2392 +0,0 @@
-From 0a4946b3e913a2affe5fd342aa88e2533d06356e Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Wed, 18 Aug 2010 03:39:02 +0000
-Subject: [PATCH] Remove trailing whitespace. Sorry if this breaks your patches.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@552 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libbb/gz_open.c               |    4 +-
- libbb/last_char_is.c          |    2 +-
- libbb/make_directory.c        |    2 +-
- libbb/parse_mode.c            |    2 +-
- libbb/safe_strncpy.c          |    6 +-
- libbb/unarchive.c             |   52 +++++++++++++-------------
- libbb/unzip.c                 |   12 +++---
- libbb/xfuncs.c                |    2 +-
- libbb/xreadlink.c             |    8 ++--
- libopkg/active_list.c         |   14 +++---
- libopkg/active_list.h         |    2 +-
- libopkg/file_util.c           |    8 ++--
- libopkg/hash_table.c          |   14 +++---
- libopkg/hash_table.h          |    6 +-
- libopkg/list.h                |    2 +-
- libopkg/nv_pair_list.c        |    2 +-
- libopkg/nv_pair_list.h        |    2 +-
- libopkg/opkg.c                |    4 +-
- libopkg/opkg_cmd.c            |   78 +++++++++++++++++++-------------------
- libopkg/opkg_conf.c           |   18 ++++----
- libopkg/opkg_download.c       |   14 +++---
- libopkg/opkg_download.h       |    2 +-
- libopkg/opkg_install.c        |   84 ++++++++++++++++++++--------------------
- libopkg/opkg_remove.c         |   24 ++++++------
- libopkg/opkg_upgrade.c        |    6 +-
- libopkg/opkg_utils.c          |   12 +++---
- libopkg/opkg_utils.h          |    2 +-
- libopkg/pkg.c                 |   24 ++++++------
- libopkg/pkg.h                 |    4 +-
- libopkg/pkg_depends.c         |   82 ++++++++++++++++++++--------------------
- libopkg/pkg_depends.h         |    4 +-
- libopkg/pkg_hash.c            |   28 +++++++-------
- libopkg/pkg_hash.h            |    4 +-
- libopkg/pkg_parse.c           |    6 +-
- libopkg/pkg_parse.h           |    2 +-
- libopkg/pkg_src.h             |    2 +-
- libopkg/pkg_vec.c             |   10 ++--
- libopkg/pkg_vec.h             |    2 +-
- libopkg/sprintf_alloc.c       |    6 +-
- libopkg/str_list.c            |    4 +-
- libopkg/void_list.c           |    2 +-
- libopkg/xregex.c              |    2 +-
- libopkg/xsystem.h             |    2 +-
- src/opkg-cl.c                 |   10 ++--
- tests/libopkg_test.c          |    4 +-
- tests/opkg_active_list_test.c |    6 +-
- tests/opkg_extract_test.c     |   10 ++--
- tests/opkg_hash_test.c        |    4 +-
- 48 files changed, 301 insertions(+), 301 deletions(-)
-
-diff --git a/libbb/gz_open.c b/libbb/gz_open.c
-index 40f741f..3997e72 100644
---- a/libbb/gz_open.c
-+++ b/libbb/gz_open.c
-@@ -39,7 +39,7 @@ gz_open(FILE *compressed_file, int *pid)
- 		return(NULL);
- 	}
- 
--    /* If we don't flush, we end up with two copies of anything pending, 
-+    /* If we don't flush, we end up with two copies of anything pending,
-        one from the parent, one from the child */
-     fflush(stdout);
-     fflush(stderr);
-@@ -71,7 +71,7 @@ gz_close(int gunzip_pid)
- 		perror_msg("waitpid");
- 		return -1;
- 	}
--	
-+
- 	if (WIFSIGNALED(status)) {
- 		error_msg("Unzip process killed by signal %d.\n",
- 			WTERMSIG(status));
-diff --git a/libbb/last_char_is.c b/libbb/last_char_is.c
-index 4e2ee92..26c2423 100644
---- a/libbb/last_char_is.c
-+++ b/libbb/last_char_is.c
-@@ -32,7 +32,7 @@ char * last_char_is(const char *s, int c)
- 	if (!s)
- 	    return NULL;
- 	sret  = (char *)s+strlen(s)-1;
--	if (sret>=s && *sret == c) { 
-+	if (sret>=s && *sret == c) {
- 		return sret;
- 	} else {
- 		return NULL;
-diff --git a/libbb/make_directory.c b/libbb/make_directory.c
-index cff2e51..86ab554 100644
---- a/libbb/make_directory.c
-+++ b/libbb/make_directory.c
-@@ -61,7 +61,7 @@ int make_directory (const char *path, long mode, int flags)
- 			   memory of the path argument and may return
- 			   a pointer to static memory, which can then
- 			   be modified by consequtive calls to dirname */
--			
-+
- 			pathcopy = xstrdup (path);
- 			parent = dirname (pathcopy);
- 			parentcopy = xstrdup (parent);
-diff --git a/libbb/parse_mode.c b/libbb/parse_mode.c
-index ba34ea9..02668c7 100644
---- a/libbb/parse_mode.c
-+++ b/libbb/parse_mode.c
-@@ -31,7 +31,7 @@
-  * correct mode described by the string. */
- extern int parse_mode(const char *s, mode_t * theMode)
- {
--	static const mode_t group_set[] = { 
-+	static const mode_t group_set[] = {
- 		S_ISUID | S_IRWXU,		/* u */
- 		S_ISGID | S_IRWXG,		/* g */
- 		S_IRWXO,				/* o */
-diff --git a/libbb/safe_strncpy.c b/libbb/safe_strncpy.c
-index 0c5cf12..eb2dbab 100644
---- a/libbb/safe_strncpy.c
-+++ b/libbb/safe_strncpy.c
-@@ -24,11 +24,11 @@
- 
- 
- 
--/* Like strncpy but make sure the resulting string is always 0 terminated. */  
-+/* Like strncpy but make sure the resulting string is always 0 terminated. */
- extern char * safe_strncpy(char *dst, const char *src, size_t size)
--{   
-+{
- 	dst[size-1] = '\0';
--	return strncpy(dst, src, size-1);   
-+	return strncpy(dst, src, size-1);
- }
- 
- 
-diff --git a/libbb/unarchive.c b/libbb/unarchive.c
-index b063c63..0e820c8 100644
---- a/libbb/unarchive.c
-+++ b/libbb/unarchive.c
-@@ -1,7 +1,7 @@
- /*
-  *  Copyright (C) 2000 by Glenn McGrath
-  *  Copyright (C) 2001 by Laurence Anderson
-- *	
-+ *
-  *  Based on previous work by busybox developers and others.
-  *
-  *  This program is free software; you can redistribute it and/or modify
-@@ -47,8 +47,8 @@ seek_by_read(FILE* fd, size_t len)
-         char buf[SEEK_BUF];
- 
-         while (len) {
--                cc = fread(buf, sizeof(buf[0]), 
--                                len > SEEK_BUF ? SEEK_BUF : len, 
-+                cc = fread(buf, sizeof(buf[0]),
-+                                len > SEEK_BUF ? SEEK_BUF : len,
-                                 fd);
- 
-                 total += cc;
-@@ -74,17 +74,17 @@ seek_sub_file(FILE *fd, const int count)
- }
- 
- 
--/* Extract the data postioned at src_stream to either filesystem, stdout or 
-- * buffer depending on the value of 'function' which is defined in libbb.h 
-+/* Extract the data postioned at src_stream to either filesystem, stdout or
-+ * buffer depending on the value of 'function' which is defined in libbb.h
-  *
-  * prefix doesnt have to be just a directory, it may prefix the filename as well.
-  *
-- * e.g. '/var/lib/dpkg/info/dpkg.' will extract all files to the base bath 
-- * '/var/lib/dpkg/info/' and all files/dirs created in that dir will have 
-+ * e.g. '/var/lib/dpkg/info/dpkg.' will extract all files to the base bath
-+ * '/var/lib/dpkg/info/' and all files/dirs created in that dir will have
-  * 'dpkg.' as their prefix
-  *
-  * For this reason if prefix does point to a dir then it must end with a
-- * trailing '/' or else the last dir will be assumed to be the file prefix 
-+ * trailing '/' or else the last dir will be assumed to be the file prefix
-  */
- static char *
- extract_archive(FILE *src_stream, FILE *out_stream,
-@@ -100,7 +100,7 @@ extract_archive(FILE *src_stream, FILE *out_stream,
- 
- 	*err = 0;
- 
--	/* prefix doesnt have to be a proper path it may prepend 
-+	/* prefix doesnt have to be a proper path it may prepend
- 	 * the filename as well */
- 	if (prefix != NULL) {
- 		/* strip leading '/' in filename to extract as prefix may not be dir */
-@@ -129,11 +129,11 @@ extract_archive(FILE *src_stream, FILE *out_stream,
- 
- 	if (function & extract_to_stream) {
- 		if (S_ISREG(file_entry->mode)) {
--			*err = copy_file_chunk(src_stream, out_stream, file_entry->size);			
-+			*err = copy_file_chunk(src_stream, out_stream, file_entry->size);
- 			archive_offset += file_entry->size;
- 		}
- 	}
--	else if (function & extract_one_to_buffer) { 
-+	else if (function & extract_one_to_buffer) {
- 		if (S_ISREG(file_entry->mode)) {
- 			buffer = (char *) xmalloc(file_entry->size + 1);
- 			fread(buffer, 1, file_entry->size, src_stream);
-@@ -189,7 +189,7 @@ extract_archive(FILE *src_stream, FILE *out_stream,
- 						goto cleanup;
- 					}
- 					archive_offset += file_entry->size;
--					*err = copy_file_chunk(src_stream, dst_stream, file_entry->size);			
-+					*err = copy_file_chunk(src_stream, dst_stream, file_entry->size);
- 					fclose(dst_stream);
- 				}
- 				break;
-@@ -230,7 +230,7 @@ extract_archive(FILE *src_stream, FILE *out_stream,
- 
- 		}
- 
--		/* Changing a symlink's properties normally changes the properties of the 
-+		/* Changing a symlink's properties normally changes the properties of the
- 		 * file pointed to, so dont try and change the date or mode, lchown does
- 		 * does the right thing, but isnt available in older versions of libc */
- 		if (S_ISLNK(file_entry->mode)) {
-@@ -247,7 +247,7 @@ extract_archive(FILE *src_stream, FILE *out_stream,
- 			chmod(full_name, file_entry->mode);
- 		}
- 	} else {
--		/* If we arent extracting data we have to skip it, 
-+		/* If we arent extracting data we have to skip it,
- 		 * if data size is 0 then then just do it anyway
- 		 * (saves testing for it) */
- 		seek_sub_file(src_stream, file_entry->size);
-@@ -256,7 +256,7 @@ extract_archive(FILE *src_stream, FILE *out_stream,
- 	/* extract_list and extract_verbose_list can be used in conjunction
- 	 * with one of the above four extraction functions, so do this seperately */
- 	if (function & extract_verbose_list) {
--		fprintf(out_stream, "%s %d/%d %8d %s ", mode_string(file_entry->mode), 
-+		fprintf(out_stream, "%s %d/%d %8d %s ", mode_string(file_entry->mode),
- 			file_entry->uid, file_entry->gid,
- 			(int) file_entry->size, time_string(file_entry->mtime));
- 	}
-@@ -373,7 +373,7 @@ get_header_ar(FILE *src_stream)
- 		/* raw_header[60] wont be '\n' as it should, but it doesnt matter */
- 		memmove(ar.raw, &ar.raw[1], 59);
- 	}
--		
-+
- 	typed = (file_header_t *) xcalloc(1, sizeof(file_header_t));
- 
- 	typed->size = (size_t) atoi(ar.formated.size);
-@@ -409,7 +409,7 @@ get_header_ar(FILE *src_stream)
- 	}
- 	typed->name[strcspn(typed->name, " /")]='\0';
- 
--	/* convert the rest of the now valid char header to its typed struct */	
-+	/* convert the rest of the now valid char header to its typed struct */
- 	parse_mode(ar.formated.mode, &typed->mode);
- 	typed->mtime = atoi(ar.formated.date);
- 	typed->uid = atoi(ar.formated.uid);
-@@ -555,7 +555,7 @@ get_header_tar(FILE *tar_stream)
- # ifdef CONFIG_FEATURE_TAR_OLDGNU_COMPATABILITY
- 		if (last_char_is(tar_entry->name, '/')) {
- 			tar_entry->mode |= S_IFDIR;
--		} else 
-+		} else
- # endif
- 			tar_entry->mode |= S_IFREG;
- 		break;
-@@ -623,7 +623,7 @@ free_header_tar(file_header_t *tar_entry)
- }
- 
- char *
--deb_extract(const char *package_filename, FILE *out_stream, 
-+deb_extract(const char *package_filename, FILE *out_stream,
- 	const int extract_function, const char *prefix,
- 	const char *filename, int *err)
- {
-@@ -642,11 +642,11 @@ deb_extract(const char *package_filename, FILE *out_stream,
- 		file_list[0] = filename;
- 		file_list[1] = NULL;
- 	}
--	
-+
- 	if (extract_function & extract_control_tar_gz) {
- 		ared_file = "control.tar.gz";
- 	}
--	else if (extract_function & extract_data_tar_gz) {		
-+	else if (extract_function & extract_data_tar_gz) {
- 		ared_file = "data.tar.gz";
- 	} else {
-                 opkg_msg(ERROR, "Internal error: extract_function=%x\n",
-@@ -719,7 +719,7 @@ deb_extract(const char *package_filename, FILE *out_stream,
- 			*err = -1;
- 			goto cleanup;
- 		}
--		
-+
- 		/* walk through outer tar file to find ared_file */
- 		while ((tar_header = get_header_tar(unzipped_opkg_stream)) != NULL) {
-                         int name_offset = 0;
-@@ -736,12 +736,12 @@ deb_extract(const char *package_filename, FILE *out_stream,
- 				}
- 				archive_offset = 0;
- 
--				output_buffer = unarchive(uncompressed_stream, 
--							  out_stream, 
-+				output_buffer = unarchive(uncompressed_stream,
-+							  out_stream,
- 							  get_header_tar,
- 							  free_header_tar,
--							  extract_function, 
--							  prefix, 
-+							  extract_function,
-+							  prefix,
- 							  file_list,
- 							  err);
- 
-diff --git a/libbb/unzip.c b/libbb/unzip.c
-index e0a2388..472ffba 100644
---- a/libbb/unzip.c
-+++ b/libbb/unzip.c
-@@ -59,7 +59,7 @@ static unsigned long crc; /* shift register contents */
- 
- /*
-  * window size--must be a power of two, and
-- *  at least 32K for zip's deflate method 
-+ *  at least 32K for zip's deflate method
-  */
- static const int WSIZE = 0x8000;
- 
-@@ -93,7 +93,7 @@ static const unsigned short mask_bits[] = {
- /* ========================================================================
-  * Signal and error handler.
-  */
-- 
-+
- static void abort_gzip()
- {
- 	error_msg("gzip aborted\n");
-@@ -111,7 +111,7 @@ static void make_crc_table()
- 	static int p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
- 
- 	/* initial shift register value */
--	crc = 0xffffffffL;	
-+	crc = 0xffffffffL;
- 	crc_table = (unsigned long *) xmalloc(256 * sizeof(unsigned long));
- 
- 	/* Make exclusive-or pattern from polynomial (0xedb88320) */
-@@ -165,7 +165,7 @@ static void flush_window(void)
- /*
-  * Free the malloc'ed tables built by huft_build(), which makes a linked
-  * list of the tables it made, with the links in a dummy first entry of
-- * each table. 
-+ * each table.
-  * t: table to free
-  */
- static int huft_free(huft_t *t)
-@@ -196,7 +196,7 @@ static int huft_free(huft_t *t)
-  * t:	result: starting table
-  * m:	maximum lookup bits, returns actual
-  */
--static int huft_build(unsigned int *b, const unsigned int n, const unsigned int s, 
-+static int huft_build(unsigned int *b, const unsigned int n, const unsigned int s,
- 	const unsigned short *d, const unsigned short *e, huft_t **t, int *m)
- {
- 	unsigned a;		/* counter for codes of length k */
-@@ -605,7 +605,7 @@ static int inflate_block(int *e)
- 			bk = k_stored;
- 			return 0;
- 		}
--	case 1:	/* Inflate fixed 
-+	case 1:	/* Inflate fixed
- 			 * decompress an inflated type 1 (fixed Huffman codes) block.  We should
- 			 * either replace this with a custom decoder, or at least precompute the
- 			 * Huffman tables.
-diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c
-index 4374048..f577315 100644
---- a/libbb/xfuncs.c
-+++ b/libbb/xfuncs.c
-@@ -71,7 +71,7 @@ extern char * xstrndup (const char *s, int n) {
- 		error_msg_and_die("xstrndup bug");
- 
- 	t = xmalloc(++n);
--	
-+
- 	return safe_strncpy(t,s,n);
- }
- 
-diff --git a/libbb/xreadlink.c b/libbb/xreadlink.c
-index 5b0504c..7d77a3b 100644
---- a/libbb/xreadlink.c
-+++ b/libbb/xreadlink.c
-@@ -14,10 +14,10 @@
- #include "libbb.h"
- 
- extern char *xreadlink(const char *path)
--{                       
-+{
- 	static const int GROWBY = 80; /* how large we will grow strings by */
- 
--	char *buf = NULL;   
-+	char *buf = NULL;
- 	int bufsize = 0, readsize = 0;
- 
- 	do {
-@@ -27,11 +27,11 @@ extern char *xreadlink(const char *path)
- 		    perror_msg("%s", path);
- 		    return NULL;
- 		}
--	}           
-+	}
- 	while (bufsize < readsize + 1);
- 
- 	buf[readsize] = '\0';
- 
- 	return buf;
--}       
-+}
- 
-diff --git a/libopkg/active_list.c b/libopkg/active_list.c
-index ffc6db0..69ac1d1 100644
---- a/libopkg/active_list.c
-+++ b/libopkg/active_list.c
-@@ -2,7 +2,7 @@
- 
-    Tick Chen <tick@openmoko.com>
- 
--   Copyright (C) 2008 Openmoko Inc. 
-+   Copyright (C) 2008 Openmoko Inc.
- 
-    This program is free software; you can redistribute it and/or
-    modify it under the terms of the GNU General Public License as
-@@ -30,7 +30,7 @@ void active_list_init(struct active_list *ptr) {
- }
- 
- /**
-- */ 
-+ */
- struct active_list * active_list_next(struct active_list *head, struct active_list *ptr) {
-     struct active_list *next=NULL;
-     if ( !head ) {
-@@ -47,7 +47,7 @@ struct active_list * active_list_next(struct active_list *head, struct active_li
-         return ptr->depended;
-     }
-     while ( next->depend.next != &next->depend ) {
--        next = list_entry(next->depend.next, struct active_list, node); 
-+        next = list_entry(next->depend.next, struct active_list, node);
-     }
-     return next;
- }
-@@ -64,10 +64,10 @@ struct active_list * active_list_prev(struct active_list *head, struct active_li
-     if ( ptr->depend.prev != &ptr->depend ) {
-         prev = list_entry(ptr->depend.prev, struct active_list, node);
-         return prev;
--    } 
-+    }
-     if ( ptr->depended  && ptr->depended != head && &ptr->depended->depend == ptr->node.prev ) {
-         prev = list_entry(ptr->depended->node.prev, struct active_list, node);
--    } else 
-+    } else
-         prev = list_entry(ptr->node.prev, struct active_list, node);
-     if ( prev == head )
-         return NULL;
-@@ -131,8 +131,8 @@ void active_list_head_delete(struct active_list *head) {
- }
- 
- /*
-- *  Using insert sort. 
-- *  Note. the list should not be large, or it will be very inefficient. 
-+ *  Using insert sort.
-+ *  Note. the list should not be large, or it will be very inefficient.
-  *
-  */
- struct active_list * active_list_sort(struct active_list *head, int (*compare)(const void *, const void *)) {
-diff --git a/libopkg/active_list.h b/libopkg/active_list.h
-index c9d90c0..ecb79a6 100644
---- a/libopkg/active_list.h
-+++ b/libopkg/active_list.h
-@@ -2,7 +2,7 @@
- 
-    Tick Chen <tick@openmoko.com>
- 
--   Copyright (C) 2008 Openmoko Inc. 
-+   Copyright (C) 2008 Openmoko Inc.
- 
-    This program is free software; you can redistribute it and/or
-    modify it under the terms of the GNU General Public License as
-diff --git a/libopkg/file_util.c b/libopkg/file_util.c
-index 0a443ea..cf5f774 100644
---- a/libopkg/file_util.c
-+++ b/libopkg/file_util.c
-@@ -175,9 +175,9 @@ char *file_md5sum_alloc(const char *file_name)
- 	md5sum_hex[i*2] = bin2hex[md5sum_bin[i] >> 4];
- 	md5sum_hex[i*2+1] = bin2hex[md5sum_bin[i] & 0xf];
-     }
--    
-+
-     md5sum_hex[md5sum_hex_len] = '\0';
--    
-+
-     return md5sum_hex;
- }
- 
-@@ -222,9 +222,9 @@ char *file_sha256sum_alloc(const char *file_name)
- 	sha256sum_hex[i*2] = bin2hex[sha256sum_bin[i] >> 4];
- 	sha256sum_hex[i*2+1] = bin2hex[sha256sum_bin[i] & 0xf];
-     }
--    
-+
-     sha256sum_hex[sha256sum_hex_len] = '\0';
--    
-+
-     return sha256sum_hex;
- }
- 
-diff --git a/libopkg/hash_table.c b/libopkg/hash_table.c
-index f3705ea..37b53e9 100644
---- a/libopkg/hash_table.c
-+++ b/libopkg/hash_table.c
-@@ -1,7 +1,7 @@
- /* hash.c - hash tables for opkg
- 
-    Steven M. Ayer, Jamey Hicks
--   
-+
-    Copyright (C) 2002 Compaq Computer Corporation
- 
-    This program is free software; you can redistribute it and/or
-@@ -108,9 +108,9 @@ void *hash_table_get(hash_table_t *hash, const char *key)
- {
-   int ndx= hash_index(hash, key);
-   hash_entry_t *hash_entry = hash->entries + ndx;
--  while (hash_entry) 
-+  while (hash_entry)
-   {
--    if (hash_entry->key) 
-+    if (hash_entry->key)
-     {
-       if (strcmp(key, hash_entry->key) == 0) {
- 	 hash->n_hits++;
-@@ -134,7 +134,7 @@ int hash_table_insert(hash_table_t *hash, const char *key, void *value)
- 	       hash_entry->data = value;
- 	       return 0;
- 	  } else {
--	       /* 
-+	       /*
- 		* if this is a collision, we have to go to the end of the ll,
- 		* then add a new entry
- 		* before we can hook up the value
-@@ -170,9 +170,9 @@ int hash_table_remove(hash_table_t *hash, const char *key)
-     int ndx= hash_index(hash, key);
-     hash_entry_t *hash_entry = hash->entries + ndx;
-     hash_entry_t *next_entry=NULL, *last_entry=NULL;
--    while (hash_entry) 
-+    while (hash_entry)
-     {
--        if (hash_entry->key) 
-+        if (hash_entry->key)
-         {
-             if (strcmp(key, hash_entry->key) == 0) {
-                 free(hash_entry->key);
-@@ -198,7 +198,7 @@ int hash_table_remove(hash_table_t *hash, const char *key)
- }
- 
- void hash_table_foreach(hash_table_t *hash, void (*f)(const char *key, void *entry, void *data), void *data)
--{ 
-+{
-     int i;
-     if (!hash || !f)
- 	return;
-diff --git a/libopkg/hash_table.h b/libopkg/hash_table.h
-index 9fa926f..472b3e2 100644
---- a/libopkg/hash_table.h
-+++ b/libopkg/hash_table.h
-@@ -1,7 +1,7 @@
- /* hash.h - hash tables for opkg
- 
-    Steven M. Ayer, Jamey Hicks
--   
-+
-    Copyright (C) 2002 Compaq Computer Corporation
- 
-    This program is free software; you can redistribute it and/or
-@@ -28,8 +28,8 @@ struct hash_entry {
- };
- 
- struct hash_table {
--  const char *name; 
--  hash_entry_t * entries;  
-+  const char *name;
-+  hash_entry_t * entries;
-   unsigned int n_buckets;
-   unsigned int n_elements;
- 
-diff --git a/libopkg/list.h b/libopkg/list.h
-index 48e4dd5..c1325db 100644
---- a/libopkg/list.h
-+++ b/libopkg/list.h
-@@ -2,7 +2,7 @@
- 
-    Tick Chen <tick@openmoko.com>
- 
--   Copyright (C) 2008 Openmoko Inc. 
-+   Copyright (C) 2008 Openmoko Inc.
- 
-    This program is free software; you can redistribute it and/or
-    modify it under the terms of the GNU General Public License as
-diff --git a/libopkg/nv_pair_list.c b/libopkg/nv_pair_list.c
-index 8baebb1..333e721 100644
---- a/libopkg/nv_pair_list.c
-+++ b/libopkg/nv_pair_list.c
-@@ -74,7 +74,7 @@ char *nv_pair_list_find(nv_pair_list_t *list, char *name)
- 	  if (strcmp(nv_pair->name, name) == 0) {
- 	       return nv_pair->value;
- 	  }
--     }    
-+     }
-      return NULL;
- }
- 
-diff --git a/libopkg/nv_pair_list.h b/libopkg/nv_pair_list.h
-index e37f612..1223a1f 100644
---- a/libopkg/nv_pair_list.h
-+++ b/libopkg/nv_pair_list.h
-@@ -39,7 +39,7 @@ void nv_pair_list_push(nv_pair_list_t *list, nv_pair_t *data);
- nv_pair_list_elt_t *nv_pair_list_pop(nv_pair_list_t *list);
- char *nv_pair_list_find(nv_pair_list_t *list, char *name);
- 
--nv_pair_list_elt_t *nv_pair_list_first(nv_pair_list_t *list); 
-+nv_pair_list_elt_t *nv_pair_list_first(nv_pair_list_t *list);
- nv_pair_list_elt_t *nv_pair_list_prev(nv_pair_list_t *list, nv_pair_list_elt_t *node);
- nv_pair_list_elt_t *nv_pair_list_next(nv_pair_list_t *list, nv_pair_list_elt_t *node);
- nv_pair_list_elt_t *nv_pair_list_last(nv_pair_list_t *list);
-diff --git a/libopkg/opkg.c b/libopkg/opkg.c
-index be38d4f..87c3244 100644
---- a/libopkg/opkg.c
-+++ b/libopkg/opkg.c
-@@ -244,7 +244,7 @@ opkg_set_option(char *option, void *value)
- /**
-  * @brief libopkg API: Install package
-  * @param package_name The name of package in which is going to install
-- * @param progress_callback The callback function that report the status to caller. 
-+ * @param progress_callback The callback function that report the status to caller.
-  */
- int
- opkg_install_package(const char *package_name,
-@@ -822,7 +822,7 @@ opkg_find_package(const char *name, const char *ver, const char *arch,
- 
- /**
-  * @brief Check the accessibility of repositories.
-- * @return return how many repositories cannot access. 0 means all okay. 
-+ * @return return how many repositories cannot access. 0 means all okay.
-  */
- int
- opkg_repository_accessibility_check(void)
-diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
-index c5ba3f4..affa0f7 100644
---- a/libopkg/opkg_cmd.c
-+++ b/libopkg/opkg_cmd.c
-@@ -63,7 +63,7 @@ write_status_files_if_changed(void)
- 	  opkg_msg(INFO, "Writing status file.\n");
- 	  opkg_conf_write_status_files();
- 	  pkg_write_changed_filelists();
--     } else { 
-+     } else {
- 	  opkg_msg(DEBUG, "Nothing to be done.\n");
-      }
- }
-@@ -87,9 +87,9 @@ opkg_update_cmd(int argc, char **argv)
-      pkg_src_list_elt_t *iter;
-      pkg_src_t *src;
- 
-- 
-+
-     sprintf_alloc(&lists_dir, "%s", conf->restrict_to_default_dest ? conf->default_dest->lists_dir : conf->lists_dir);
-- 
-+
-     if (! file_is_dir(lists_dir)) {
- 	  if (file_exists(lists_dir)) {
- 	       opkg_msg(ERROR, "%s exists, but is not a directory.\n",
-@@ -101,8 +101,8 @@ opkg_update_cmd(int argc, char **argv)
- 	  if (err) {
- 	       free(lists_dir);
- 	       return -1;
--	  }	
--     } 
-+	  }
-+     }
- 
-      failures = 0;
- 
-@@ -119,7 +119,7 @@ opkg_update_cmd(int argc, char **argv)
- 	  src = (pkg_src_t *)iter->data;
- 
- 	  if (src->extra_data)	/* debian style? */
--	      sprintf_alloc(&url, "%s/%s/%s", src->value, src->extra_data, 
-+	      sprintf_alloc(&url, "%s/%s/%s", src->value, src->extra_data,
- 			    src->gzip ? "Packages.gz" : "Packages");
- 	  else
- 	      sprintf_alloc(&url, "%s/%s", src->value, src->gzip ? "Packages.gz" : "Packages");
-@@ -128,7 +128,7 @@ opkg_update_cmd(int argc, char **argv)
- 	  if (src->gzip) {
- 	      char *tmp_file_name;
- 	      FILE *in, *out;
--	      
-+
- 	      sprintf_alloc (&tmp_file_name, "%s/%s.gz", tmp, src->name);
- 	      err = opkg_download(url, tmp_file_name, NULL, NULL);
- 	      if (err == 0) {
-@@ -252,7 +252,7 @@ opkg_finalize_intercepts(opkg_intercept_t ctx)
- 
- 	    if (de->d_name[0] == '.')
- 		continue;
--	    
-+
- 	    sprintf_alloc (&path, "%s/%s", ctx->statedir, de->d_name);
- 	    if (access (path, X_OK) == 0) {
- 		const char *argv[] = {"sh", "-c", path, NULL};
-@@ -263,7 +263,7 @@ opkg_finalize_intercepts(opkg_intercept_t ctx)
-         closedir(dir);
-     } else
- 	opkg_perror(ERROR, "Failed to open dir %s", ctx->statedir);
--	
-+
-     rm_r(ctx->statedir);
-     free (ctx->statedir);
-     free (ctx);
-@@ -272,10 +272,10 @@ opkg_finalize_intercepts(opkg_intercept_t ctx)
- }
- 
- /* For package pkg do the following: If it is already visited, return. If not,
--   add it in visited list and recurse to its deps. Finally, add it to ordered 
-+   add it in visited list and recurse to its deps. Finally, add it to ordered
-    list.
-    pkg_vec all contains all available packages in repos.
--   pkg_vec visited contains packages already visited by this function, and is 
-+   pkg_vec visited contains packages already visited by this function, and is
-    used to end recursion and avoid an infinite loop on graph cycles.
-    pkg_vec ordered will finally contain the ordered set of packages.
- */
-@@ -293,21 +293,21 @@ opkg_recurse_pkgs_in_order(pkg_t *pkg, pkg_vec_t *all,
- 
-     /* If it's just an available package, that is, not installed and not even
-        unpacked, skip it */
--    /* XXX: This is probably an overkill, since a state_status != SS_UNPACKED 
--       would do here. However, if there is an intermediate node (pkg) that is 
--       configured and installed between two unpacked packages, the latter 
-+    /* XXX: This is probably an overkill, since a state_status != SS_UNPACKED
-+       would do here. However, if there is an intermediate node (pkg) that is
-+       configured and installed between two unpacked packages, the latter
-        won't be properly reordered, unless all installed/unpacked pkgs are
-        checked */
--    if (pkg->state_status == SS_NOT_INSTALLED) 
-+    if (pkg->state_status == SS_NOT_INSTALLED)
-         return 0;
- 
-     /* If the  package has already been visited (by this function), skip it */
--    for(j = 0; j < visited->len; j++) 
-+    for(j = 0; j < visited->len; j++)
-         if ( ! strcmp(visited->pkgs[j]->name, pkg->name)) {
-             opkg_msg(DEBUG, "pkg %s already visited, skipping.\n", pkg->name);
-             return 0;
-         }
--    
-+
-     pkg_vec_insert(visited, pkg);
- 
-     count = pkg->pre_depends_count + pkg->depends_count + \
-@@ -315,9 +315,9 @@ opkg_recurse_pkgs_in_order(pkg_t *pkg, pkg_vec_t *all,
- 
-     opkg_msg(DEBUG, "pkg %s.\n", pkg->name);
- 
--    /* Iterate over all the dependencies of pkg. For each one, find a package 
-+    /* Iterate over all the dependencies of pkg. For each one, find a package
-        that is either installed or unpacked and satisfies this dependency.
--       (there should only be one such package per dependency installed or 
-+       (there should only be one such package per dependency installed or
-        unpacked). Then recurse to the dependency package */
-     for (j=0; j < count ; j++) {
-         compound_depend = &pkg->depends[j];
-@@ -328,16 +328,16 @@ opkg_recurse_pkgs_in_order(pkg_t *pkg, pkg_vec_t *all,
-             l = 0;
-             if (dependents != NULL)
-                 while (l < abpkg->provided_by->len && dependents[l] != NULL) {
--                    opkg_msg(DEBUG, "Descending on pkg %s.\n", 
-+                    opkg_msg(DEBUG, "Descending on pkg %s.\n",
-                                  dependents [l]->name);
--    
-+
-                     /* find whether dependent l is installed or unpacked,
-                      * and then find which package in the list satisfies it */
-                     for(m = 0; m < all->len; m++) {
-                         dep = all->pkgs[m];
-                         if ( dep->state_status != SS_NOT_INSTALLED)
-                             if ( ! strcmp(dep->name, dependents[l]->name)) {
--                                opkg_recurse_pkgs_in_order(dep, all, 
-+                                opkg_recurse_pkgs_in_order(dep, all,
-                                                            visited, ordered);
-                                 /* Stop the outer loop */
-                                 l = abpkg->provided_by->len;
-@@ -350,7 +350,7 @@ opkg_recurse_pkgs_in_order(pkg_t *pkg, pkg_vec_t *all,
-         }
-     }
- 
--    /* When all recursions from this node down, are over, and all 
-+    /* When all recursions from this node down, are over, and all
-        dependencies have been added in proper order in the ordered array, add
-        also the package pkg to ordered array */
-     pkg_vec_insert(ordered, pkg);
-@@ -389,11 +389,11 @@ opkg_configure_packages(char *pkg_name)
- 	     err = -1;
- 	     goto error;
-      }
--    
-+
-      for(i = 0; i < ordered->len; i++) {
- 	  pkg = ordered->pkgs[i];
- 
--	  if (pkg_name && fnmatch(pkg_name, pkg->name, 0)) 
-+	  if (pkg_name && fnmatch(pkg_name, pkg->name, 0))
- 	       continue;
- 
- 	  if (pkg->state_status == SS_UNPACKED) {
-@@ -579,7 +579,7 @@ opkg_list_cmd(int argc, char **argv)
-      for (i=0; i < available->len; i++) {
- 	  pkg = available->pkgs[i];
- 	  /* if we have package name or pattern and pkg does not match, then skip it */
--	  if (pkg_name && fnmatch(pkg_name, pkg->name, 0)) 
-+	  if (pkg_name && fnmatch(pkg_name, pkg->name, 0))
- 	       continue;
-           print_pkg(pkg);
-      }
-@@ -606,7 +606,7 @@ opkg_list_installed_cmd(int argc, char **argv)
-      for (i=0; i < available->len; i++) {
- 	  pkg = available->pkgs[i];
- 	  /* if we have package name or pattern and pkg does not match, then skip it */
--	  if (pkg_name && fnmatch(pkg_name, pkg->name, 0)) 
-+	  if (pkg_name && fnmatch(pkg_name, pkg->name, 0))
- 	       continue;
-           print_pkg(pkg);
-      }
-@@ -738,7 +738,7 @@ opkg_remove_cmd(int argc, char **argv)
-             } else {
- 	         pkg_to_remove = pkg_hash_fetch_installed_by_name(pkg->name);
-             }
--        
-+
-             if (pkg_to_remove == NULL) {
- 	         opkg_msg(ERROR, "Package %s is not installed.\n", pkg->name);
- 	         continue;
-@@ -770,7 +770,7 @@ opkg_flag_cmd(int argc, char **argv)
-      int i;
-      pkg_t *pkg;
-      const char *flags = argv[0];
--    
-+
-      signal(SIGINT, sigint_handler);
- 
-      for (i=1; i < argc; i++) {
-@@ -790,7 +790,7 @@ opkg_flag_cmd(int argc, char **argv)
- 	      pkg->state_flag = pkg_state_flag_from_str(flags);
-           }
- 
--	  /* 
-+	  /*
- 	   * Useful if a package is installed in an offline_root, and
- 	   * should be configured by opkg-cl configure at a later date.
- 	   */
-@@ -931,7 +931,7 @@ opkg_what_depends_conflicts_cmd(enum depend_type what_field_type, int recursive,
- 	case RECOMMEND: rel_str = "recommends"; break;
- 	default: return -1;
- 	}
--     
-+
- 	available_pkgs = pkg_vec_alloc();
- 
- 	if (conf->query_all)
-@@ -987,14 +987,14 @@ opkg_what_depends_conflicts_cmd(enum depend_type what_field_type, int recursive,
- 								& SF_MARKED)
- 							!= SF_MARKED)
- 						continue;
--					
-+
- 					/* mark the depending package so we
- 					* won't visit it again */
- 					pkg->state_flag |= SF_MARKED;
- 					pkg_mark_provides(pkg);
- 					changed++;
- 
--					ver = pkg_version_str_alloc(pkg); 
-+					ver = pkg_version_str_alloc(pkg);
- 				        opkg_msg(NOTICE, "\t%s %s\t%s %s",
- 							pkg->name,
- 							ver,
-@@ -1061,7 +1061,7 @@ opkg_what_provides_replaces_cmd(enum what_field_type what_field_type, int argc,
- 	  pkg_vec_t *available_pkgs = pkg_vec_alloc();
- 	  const char *rel_str = (what_field_type == WHATPROVIDES ? "provides" : "replaces");
- 	  int i;
--     
-+
- 	  pkg_info_preinstall_check();
- 
- 	  if (conf->query_all)
-@@ -1079,8 +1079,8 @@ opkg_what_provides_replaces_cmd(enum what_field_type what_field_type, int argc,
- 		    int k;
- 		    int count = (what_field_type == WHATPROVIDES) ? pkg->provides_count : pkg->replaces_count;
- 		    for (k = 0; k < count; k++) {
--			 abstract_pkg_t *apkg = 
--			      ((what_field_type == WHATPROVIDES) 
-+			 abstract_pkg_t *apkg =
-+			      ((what_field_type == WHATPROVIDES)
- 			       ? pkg->provides[k]
- 			       : pkg->replaces[k]);
- 			 if (fnmatch(target, apkg->name, 0) == 0) {
-@@ -1124,7 +1124,7 @@ opkg_search_cmd(int argc, char **argv)
-      if (argc < 1) {
- 	  return -1;
-      }
-- 
-+
-      installed = pkg_vec_alloc();
-      pkg_hash_fetch_all_installed(installed);
-      pkg_vec_sort(installed, pkg_compare_names);
-@@ -1154,8 +1154,8 @@ opkg_compare_versions_cmd(int argc, char **argv)
-      if (argc == 3) {
- 	  /* this is a bit gross */
- 	  struct pkg p1, p2;
--	  parse_version(&p1, argv[0]); 
--	  parse_version(&p2, argv[2]); 
-+	  parse_version(&p1, argv[0]);
-+	  parse_version(&p2, argv[2]);
- 	  return pkg_version_satisfied(&p1, &p2, argv[1]);
-      } else {
- 	  opkg_msg(ERROR,
-diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
-index a145ae7..f1ef0d0 100644
---- a/libopkg/opkg_conf.c
-+++ b/libopkg/opkg_conf.c
-@@ -47,13 +47,13 @@ opkg_conf_t *conf = &_conf;
- opkg_option_t options[] = {
- 	  { "cache", OPKG_OPT_TYPE_STRING, &_conf.cache},
- 	  { "force_defaults", OPKG_OPT_TYPE_BOOL, &_conf.force_defaults },
--          { "force_maintainer", OPKG_OPT_TYPE_BOOL, &_conf.force_maintainer }, 
-+          { "force_maintainer", OPKG_OPT_TYPE_BOOL, &_conf.force_maintainer },
- 	  { "force_depends", OPKG_OPT_TYPE_BOOL, &_conf.force_depends },
- 	  { "force_overwrite", OPKG_OPT_TYPE_BOOL, &_conf.force_overwrite },
- 	  { "force_downgrade", OPKG_OPT_TYPE_BOOL, &_conf.force_downgrade },
- 	  { "force_reinstall", OPKG_OPT_TYPE_BOOL, &_conf.force_reinstall },
- 	  { "force_space", OPKG_OPT_TYPE_BOOL, &_conf.force_space },
--          { "check_signature", OPKG_OPT_TYPE_BOOL, &_conf.check_signature }, 
-+          { "check_signature", OPKG_OPT_TYPE_BOOL, &_conf.check_signature },
- 	  { "ftp_proxy", OPKG_OPT_TYPE_STRING, &_conf.ftp_proxy },
- 	  { "http_proxy", OPKG_OPT_TYPE_STRING, &_conf.http_proxy },
- 	  { "no_proxy", OPKG_OPT_TYPE_STRING, &_conf.no_proxy },
-@@ -72,7 +72,7 @@ opkg_option_t options[] = {
- 	  { "signature_ca_path", OPKG_OPT_TYPE_STRING, &_conf.signature_ca_path },
- #endif
- #if defined(HAVE_PATHFINDER)
--          { "check_x509_path", OPKG_OPT_TYPE_BOOL, &_conf.check_x509_path }, 
-+          { "check_x509_path", OPKG_OPT_TYPE_BOOL, &_conf.check_x509_path },
- #endif
- #if defined(HAVE_SSLCURL) && defined(HAVE_CURL)
-           { "ssl_engine", OPKG_OPT_TYPE_STRING, &_conf.ssl_engine },
-@@ -156,7 +156,7 @@ opkg_conf_set_option(const char *name, const char *value)
- 			 opkg_msg(ERROR, "Option %s needs an argument\n",
- 				name);
- 			 return -1;
--		    }		    
-+		    }
- 	       case OPKG_OPT_TYPE_STRING:
- 		    if (value) {
- 			    if (*(char **)options[i].value) {
-@@ -176,7 +176,7 @@ opkg_conf_set_option(const char *name, const char *value)
- 	  }
- 	  i++;
-      }
--    
-+
-      opkg_msg(ERROR, "Unrecognized option: %s=%s\n", name, value);
-      return -1;
- }
-@@ -202,7 +202,7 @@ opkg_conf_parse_file(const char *filename,
- 
-      opkg_msg(INFO, "Loading conf file %s.\n", filename);
- 
--     err = xregcomp(&comment_re, 
-+     err = xregcomp(&comment_re,
- 		    "^[[:space:]]*(#.*|[[:space:]]*)$",
- 		    REG_EXTENDED);
-      if (err)
-@@ -460,11 +460,11 @@ opkg_conf_init(void)
- 	free(etc_opkg_conf_pattern);
- 
- 	for (i = 0; i < globbuf.gl_pathc; i++) {
--		if (globbuf.gl_pathv[i]) 
-+		if (globbuf.gl_pathv[i])
- 			if (conf->conf_file &&
- 					!strcmp(conf->conf_file, globbuf.gl_pathv[i]))
- 				continue;
--		if ( opkg_conf_parse_file(globbuf.gl_pathv[i], 
-+		if ( opkg_conf_parse_file(globbuf.gl_pathv[i],
- 			&conf->pkg_src_list, &tmp_dest_nv_pair_list)<0) {
- 			globfree(&globbuf);
- 			goto err1;
-@@ -617,7 +617,7 @@ opkg_conf_deinit(void)
- 		}
- 	}
- 
--	if (conf->verbosity >= DEBUG) { 
-+	if (conf->verbosity >= DEBUG) {
- 		hash_print_stats(&conf->pkg_hash);
- 		hash_print_stats(&conf->file_hash);
- 		hash_print_stats(&conf->obs_file_hash);
-diff --git a/libopkg/opkg_download.c b/libopkg/opkg_download.c
-index c852d86..4969dd7 100644
---- a/libopkg/opkg_download.c
-+++ b/libopkg/opkg_download.c
-@@ -90,7 +90,7 @@ opkg_download(const char *src, const char *dest_file_name,
-     char *tmp_file_location;
- 
-     opkg_msg(NOTICE,"Downloading %s.\n", src);
--	
-+
-     if (str_starts_with(src, "file:")) {
- 	const char *file_src = src + 5;
- 	opkg_msg(INFO, "Copying %s to %s...", file_src, dest_file_name);
-@@ -269,7 +269,7 @@ opkg_download_pkg(pkg_t *pkg, const char *dir)
- }
- 
- /*
-- * Downloads file from url, installs in package database, return package name. 
-+ * Downloads file from url, installs in package database, return package name.
-  */
- int
- opkg_prepare_url_for_install(const char *url, char **namep)
-@@ -317,7 +317,7 @@ opkg_prepare_url_for_install(const char *url, char **namep)
-      pkg->dest = conf->default_dest;
-      pkg->state_want = SW_INSTALL;
-      pkg->state_flag |= SF_PREFER;
--     hash_insert_pkg(pkg, 1);  
-+     hash_insert_pkg(pkg, 1);
- 
-      if (namep) {
- 	  *namep = pkg->name;
-@@ -338,14 +338,14 @@ opkg_verify_file (char *text_file, char *sig_file)
-     gpgme_verify_result_t result;
-     gpgme_signature_t s;
-     char *trusted_path = NULL;
--    
-+
-     err = gpgme_new (&ctx);
- 
-     if (err)
- 	return -1;
- 
-     sprintf_alloc(&trusted_path, "%s/%s", conf->offline_root, "/etc/opkg/trusted.gpg");
--    err = gpgme_data_new_from_file (&key, trusted_path, 1); 
-+    err = gpgme_data_new_from_file (&key, trusted_path, 1);
-     free (trusted_path);
-     if (err)
-     {
-@@ -359,14 +359,14 @@ opkg_verify_file (char *text_file, char *sig_file)
-     }
-     gpgme_data_release (key);
- 
--    err = gpgme_data_new_from_file (&sig, sig_file, 1); 
-+    err = gpgme_data_new_from_file (&sig, sig_file, 1);
-     if (err)
-     {
- 	gpgme_release (ctx);
- 	return -1;
-     }
- 
--    err = gpgme_data_new_from_file (&text, text_file, 1); 
-+    err = gpgme_data_new_from_file (&text, text_file, 1);
-     if (err)
-     {
-         gpgme_data_release (sig);
-diff --git a/libopkg/opkg_download.h b/libopkg/opkg_download.h
-index 0058287..3e1c760 100644
---- a/libopkg/opkg_download.h
-+++ b/libopkg/opkg_download.h
-@@ -28,7 +28,7 @@ typedef int (*curl_progress_func)(void *data, double t, double d, double ultotal
- int opkg_download(const char *src, const char *dest_file_name, curl_progress_func cb, void *data);
- int opkg_download_pkg(pkg_t *pkg, const char *dir);
- /*
-- * Downloads file from url, installs in package database, return package name. 
-+ * Downloads file from url, installs in package database, return package name.
-  */
- int opkg_prepare_url_for_install(const char *url, char **namep);
- 
-diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
-index 2693274..eaa1edc 100644
---- a/libopkg/opkg_install.c
-+++ b/libopkg/opkg_install.c
-@@ -50,7 +50,7 @@ satisfy_dependencies_for(pkg_t *pkg)
-      char **tmp, **unresolved = NULL;
-      int ndepends;
- 
--     ndepends = pkg_hash_fetch_unsatisfied_dependencies(pkg, depends, 
-+     ndepends = pkg_hash_fetch_unsatisfied_dependencies(pkg, depends,
- 							&unresolved);
- 
-      if (unresolved) {
-@@ -151,8 +151,8 @@ update_file_ownership(pkg_t *new_pkg, pkg_t *old_pkg)
-      if (new_list == NULL)
- 	     return -1;
- 
--     for (iter = str_list_first(new_list), niter = str_list_next(new_list, iter); 
--             iter; 
-+     for (iter = str_list_first(new_list), niter = str_list_next(new_list, iter);
-+             iter;
-              iter = niter, niter = str_list_next(new_list, niter)) {
- 	  char *new_file = (char *)iter->data;
- 	  pkg_t *owner = file_hash_get_file_owner(new_file);
-@@ -172,8 +172,8 @@ update_file_ownership(pkg_t *new_pkg, pkg_t *old_pkg)
- 		  return -1;
- 	  }
- 
--	  for (iter = str_list_first(old_list), niter = str_list_next(old_list, iter); 
--                  iter; 
-+	  for (iter = str_list_first(old_list), niter = str_list_next(old_list, iter);
-+                  iter;
-                   iter = niter, niter = str_list_next(old_list, niter)) {
- 	       char *old_file = (char *)iter->data;
- 	       pkg_t *owner = file_hash_get_file_owner(old_file);
-@@ -250,7 +250,7 @@ unpack_pkg_control_files(pkg_t *pkg)
- 	  free(conffiles_file_name);
- 	  return 0;
-      }
--    
-+
-      conffiles_file = fopen(conffiles_file_name, "r");
-      if (conffiles_file == NULL) {
- 	  opkg_perror(ERROR, "Failed to open %s", conffiles_file_name);
-@@ -298,7 +298,7 @@ unpack_pkg_control_files(pkg_t *pkg)
-  * which are no longer a dependency in the new (upgraded) pkg.
-  */
- static int
--pkg_remove_orphan_dependent(pkg_t *pkg, pkg_t *old_pkg) 
-+pkg_remove_orphan_dependent(pkg_t *pkg, pkg_t *old_pkg)
- {
- 	int i, j, k, l, found,r, err = 0;
- 	int n_deps;
-@@ -368,7 +368,7 @@ pkg_remove_orphan_dependent(pkg_t *pkg, pkg_t *old_pkg)
- 				r = opkg_remove_pkg(p, 0);
- 				if (!err)
- 					err = r;
--			} else 
-+			} else
- 				opkg_msg(INFO, "%s was autoinstalled and is "
- 						"still required by %d "
- 						"installed packages.\n",
-@@ -441,7 +441,7 @@ pkg_remove_installed_replacees_unwind(pkg_vec_t *replacees)
- /* compares versions of pkg and old_pkg, returns 0 if OK to proceed with installation of pkg, 1 otherwise */
- static int
- opkg_install_check_downgrade(pkg_t *pkg, pkg_t *old_pkg, int message)
--{	  
-+{
-      if (old_pkg) {
-           char message_out[15];
- 	  char *old_version = pkg_version_str_alloc(old_pkg);
-@@ -450,12 +450,12 @@ opkg_install_check_downgrade(pkg_t *pkg, pkg_t *old_pkg, int message)
- 	  int rc = 0;
- 
-           memset(message_out,'\x0',15);
--          strncpy (message_out,"Upgrading ",strlen("Upgrading ")); 
-+          strncpy (message_out,"Upgrading ",strlen("Upgrading "));
-           if ( (conf->force_downgrade==1) && (cmp > 0) ){     /* We've been asked to allow downgrade  and version is precedent */
--             cmp = -1 ;                                       /* then we force opkg to downgrade */ 
-+             cmp = -1 ;                                       /* then we force opkg to downgrade */
-              strncpy (message_out,"Downgrading ",strlen("Downgrading "));         /* We need to use a value < 0 because in the 0 case we are asking to */
-                                                               /* reinstall, and some check could fail asking the "force-reinstall" option */
--          } 
-+          }
- 
- 	  if (cmp > 0) {
-               if(!conf->download_only)
-@@ -474,14 +474,14 @@ opkg_install_check_downgrade(pkg_t *pkg, pkg_t *old_pkg, int message)
-                    opkg_msg(NOTICE, "%s (%s) already install on %s.\n",
- 			pkg->name, new_version, old_pkg->dest->name);
- 	       rc = 1;
--	  } 
-+	  }
- 	  free(old_version);
- 	  free(new_version);
- 	  return rc;
-      } else {
-           char message_out[15] ;
-           memset(message_out,'\x0',15);
--          if ( message ) 
-+          if ( message )
-                strncpy( message_out,"Upgrading ",strlen("Upgrading ") );
-           else
-                strncpy( message_out,"Installing ",strlen("Installing ") );
-@@ -501,7 +501,7 @@ prerm_upgrade_old_pkg(pkg_t *pkg, pkg_t *old_pkg)
- {
-      /* DPKG_INCOMPATIBILITY:
- 	dpkg does some things here that we don't do yet. Do we care?
--	
-+
- 	1. If a version of the package is already installed, call
- 	   old-prerm upgrade new-version
- 	2. If the script runs but exits with a non-zero exit status
-@@ -615,7 +615,7 @@ backup_make_backup(const char *file_name)
- {
-      int err;
-      char *backup;
--    
-+
-      backup = backup_filename_alloc(file_name);
-      err = file_copy(file_name, backup);
-      if (err) {
-@@ -668,7 +668,7 @@ backup_modified_conffiles(pkg_t *pkg, pkg_t *old_pkg)
-      if (old_pkg) {
- 	  for (iter = nv_pair_list_first(&old_pkg->conffiles); iter; iter = nv_pair_list_next(&old_pkg->conffiles, iter)) {
- 	       char *cf_name;
--	       
-+
- 	       cf = iter->data;
- 	       cf_name = root_filename_alloc(cf->name);
- 
-@@ -734,7 +734,7 @@ check_data_file_clashes(pkg_t *pkg, pkg_t *old_pkg)
- 	can unwind if necessary).  To avoid complexity and redundant
- 	storage, opkg doesn't do any installation until later, (at the
- 	point at which dpkg removes the backups.
--	
-+
- 	But, we do have to check for data file clashes, since after
- 	installing a package with a file clash, removing either of the
- 	packages involved in the clash has the potential to break the
-@@ -749,8 +749,8 @@ check_data_file_clashes(pkg_t *pkg, pkg_t *old_pkg)
-      if (files_list == NULL)
- 	     return -1;
- 
--     for (iter = str_list_first(files_list), niter = str_list_next(files_list, iter); 
--             iter; 
-+     for (iter = str_list_first(files_list), niter = str_list_next(files_list, iter);
-+             iter;
-              iter = niter, niter = str_list_next(files_list, iter)) {
- 	  filename = (char *) iter->data;
- 	  if (file_exists(filename) && (! file_is_dir(filename))) {
-@@ -761,7 +761,7 @@ check_data_file_clashes(pkg_t *pkg, pkg_t *old_pkg)
- 		    continue;
- 	       }
- 
--	       /* Pre-existing files are OK if force-overwrite was asserted. */ 
-+	       /* Pre-existing files are OK if force-overwrite was asserted. */
- 	       if (conf->force_overwrite) {
- 		    /* but we need to change who owns this file */
- 		    file_hash_set_file_owner(filename, pkg);
-@@ -844,8 +844,8 @@ check_data_file_clashes_change(pkg_t *pkg, pkg_t *old_pkg)
-      if (files_list == NULL)
- 	     return -1;
- 
--     for (iter = str_list_first(files_list), niter = str_list_next(files_list, iter); 
--             iter; 
-+     for (iter = str_list_first(files_list), niter = str_list_next(files_list, iter);
-+             iter;
-              iter = niter, niter = str_list_next(files_list, niter)) {
- 	  char *filename = (char *) iter->data;
-           if (root_filename) {
-@@ -868,7 +868,7 @@ check_data_file_clashes_change(pkg_t *pkg, pkg_t *old_pkg)
- 	       /* Pre-existing files are OK if owned by a package replaced by new pkg. */
- 	       if (owner) {
- 		    if (pkg_replaces(pkg, owner)) {
--/* It's now time to change the owner of that file. 
-+/* It's now time to change the owner of that file.
-    It has been "replaced" from the new "Replaces", then I need to inform lists file about that.  */
- 			 opkg_msg(INFO, "Replacing pre-existing file %s "
- 					 "owned by package %s\n",
-@@ -962,7 +962,7 @@ remove_obsolesced_files(pkg_t *pkg, pkg_t *old_pkg)
- 	       /* in case obsolete file no longer belongs to old_pkg */
- 	       continue;
- 	  }
-- 
-+
- 	  /* old file is obsolete */
- 	  opkg_msg(NOTICE, "Removing obsolete file %s.\n", old);
- 	  if (!conf->noaction) {
-@@ -1000,7 +1000,7 @@ remove_disappeared(pkg_t *pkg)
-      /* DPKG_INCOMPATIBILITY:
- 	This is a fairly sophisticated dpkg operation. Shall we
- 	skip it? */
--     
-+
-      /* Any packages all of whose files have been overwritten during the
- 	installation, and which aren't required for dependencies, are
- 	considered to have been removed. For each such package
-@@ -1024,7 +1024,7 @@ install_data_files(pkg_t *pkg)
- 	than dpkg. Rather than removing backups at this point, we
- 	actually do the data file installation now. See comments in
- 	check_data_file_clashes() for more details. */
--    
-+
-      opkg_msg(INFO, "Extracting data files to %s.\n", pkg->dest->root_dir);
-      err = pkg_extract_data_files_to_dir(pkg, pkg->dest->root_dir);
-      if (err) {
-@@ -1037,7 +1037,7 @@ install_data_files(pkg_t *pkg)
-       * 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)
-@@ -1127,7 +1127,7 @@ opkg_install_by_name(const char *pkg_name)
-      if (old)
-         opkg_msg(DEBUG2, "Old versions from pkg_hash_fetch %s.\n",
- 			old->version);
--    
-+
-      new = pkg_hash_fetch_best_installation_candidate_by_name(pkg_name);
-      if (new == NULL) {
- 	opkg_msg(NOTICE, "Unknown package '%s'.\n", pkg_name);
-@@ -1135,7 +1135,7 @@ opkg_install_by_name(const char *pkg_name)
-      }
- 
-      opkg_msg(DEBUG2, "Versions from pkg_hash_fetch:");
--     if ( old ) 
-+     if ( old )
-         opkg_message(DEBUG2, " old %s ", old->version);
-      opkg_message(DEBUG2, " new %s\n", new->version);
- 
-@@ -1147,10 +1147,10 @@ opkg_install_by_name(const char *pkg_name)
- 	  cmp = pkg_compare_versions(old, new);
-           if ( (conf->force_downgrade==1) && (cmp > 0) ){     /* We've been asked to allow downgrade  and version is precedent */
- 	     opkg_msg(DEBUG, "Forcing downgrade\n");
--             cmp = -1 ;                                       /* then we force opkg to downgrade */ 
-+             cmp = -1 ;                                       /* then we force opkg to downgrade */
-                                                               /* We need to use a value < 0 because in the 0 case we are asking to */
-                                                               /* reinstall, and some check could fail asking the "force-reinstall" option */
--          } 
-+          }
- 	  opkg_msg(DEBUG, "Comparing visible versions of pkg %s:"
- 		       "\n\t%s is installed "
- 		       "\n\t%s is available "
-@@ -1183,7 +1183,7 @@ opkg_install_by_name(const char *pkg_name)
- }
- 
- /**
-- *  @brief Really install a pkg_t 
-+ *  @brief Really install a pkg_t
-  */
- int
- opkg_install_pkg(pkg_t *pkg, int from_upgrade)
-@@ -1200,7 +1200,7 @@ opkg_install_pkg(pkg_t *pkg, int from_upgrade)
- #endif
-      sigset_t newset, oldset;
- 
--     if ( from_upgrade ) 
-+     if ( from_upgrade )
-         message = 1;            /* Coming from an upgrade, and should change the output message */
- 
-      opkg_msg(DEBUG2, "Calling pkg_arch_supported.\n");
-@@ -1215,7 +1215,7 @@ opkg_install_pkg(pkg_t *pkg, int from_upgrade)
- 	  if (err)
- 		  return -1;
- 
--	  opkg_msg(NOTICE, "Package %s is already installed on %s.\n", 
-+	  opkg_msg(NOTICE, "Package %s is already installed on %s.\n",
- 		       pkg->name, pkg->dest->name);
- 	  return 0;
-      }
-@@ -1231,21 +1231,21 @@ opkg_install_pkg(pkg_t *pkg, int from_upgrade)
- 	     return -1;
- 
-      pkg->state_want = SW_INSTALL;
--     if (old_pkg){                          
-+     if (old_pkg){
-          old_pkg->state_want = SW_DEINSTALL; /* needed for check_data_file_clashes of dependencies */
-      }
- 
-      err = check_conflicts_for(pkg);
-      if (err)
- 	     return -1;
--    
-+
-      /* this setup is to remove the upgrade scenario in the end when
- 	installing pkg A, A deps B & B deps on A. So both B and A are
- 	installed. Then A's installation is started resulting in an
--	uncecessary upgrade */ 
-+	uncecessary upgrade */
-      if (pkg->state_status == SS_INSTALLED)
- 	     return 0;
--    
-+
-      err = verify_pkg_installable(pkg);
-      if (err)
- 	     return -1;
-@@ -1383,7 +1383,7 @@ opkg_install_pkg(pkg_t *pkg, int from_upgrade)
-                pkg_remove_orphan_dependent(pkg, old_pkg);
- 
- 	  /* XXX: BUG: we really should treat replacement more like an upgrade
--	   *      Instead, we're going to remove the replacees 
-+	   *      Instead, we're going to remove the replacees
- 	   */
- 	  err = pkg_remove_installed_replacees(replacees);
- 	  if (err)
-@@ -1434,7 +1434,7 @@ opkg_install_pkg(pkg_t *pkg, int from_upgrade)
- 		    }
- 	       }
- 
--               /* removing files from old package, to avoid ghost files */ 
-+               /* removing files from old package, to avoid ghost files */
-                remove_data_files_and_list(old_pkg);
-                remove_maintainer_scripts(old_pkg);
- 	  }
-@@ -1488,7 +1488,7 @@ opkg_install_pkg(pkg_t *pkg, int from_upgrade)
- 	  sigprocmask(SIG_UNBLOCK, &newset, &oldset);
-           pkg_vec_free (replacees);
- 	  return 0;
--     
-+
- 
-      UNWIND_POSTRM_UPGRADE_OLD_PKG:
- 	  postrm_upgrade_old_pkg_unwind(pkg, old_pkg);
-diff --git a/libopkg/opkg_remove.c b/libopkg/opkg_remove.c
-index 792ab37..0e967a3 100644
---- a/libopkg/opkg_remove.c
-+++ b/libopkg/opkg_remove.c
-@@ -93,7 +93,7 @@ opkg_remove_dependent_pkgs(pkg_t *pkg, abstract_pkg_t **dependents)
- 		pkg->name);
- 	return 0;
-     }
--    
-+
-     if (dependents == NULL)
- 	    return 0;
- 
-@@ -109,10 +109,10 @@ opkg_remove_dependent_pkgs(pkg_t *pkg, abstract_pkg_t **dependents)
- 
-     while (dependents [i] != NULL) {
-         abstract_pkg_t *dep_ab_pkg = dependents[i];
--	
-+
- 	if (dep_ab_pkg->dependencies_checked == 2){
- 	    i++;
--	    continue;	
-+	    continue;
-         }
-         if (dep_ab_pkg->state_status == SS_INSTALLED) {
-             for (a = 0; a < dep_ab_pkg->pkgs->len; a++) {
-@@ -125,15 +125,15 @@ opkg_remove_dependent_pkgs(pkg_t *pkg, abstract_pkg_t **dependents)
-         }
- 	i++;
- 	/* 1 - to keep track of visited ab_pkgs when checking for possiblility of a broken removal of pkgs.
--	 * 2 - to keep track of pkgs whose deps have been checked alrdy  - Karthik */	
-+	 * 2 - to keep track of pkgs whose deps have been checked alrdy  - Karthik */
-     }
--    
-+
-     if (count == 1) {
--        pkg_vec_free(dependent_pkgs);  
-+        pkg_vec_free(dependent_pkgs);
- 	return 0;
-     }
--    
--    
-+
-+
-     int err=0;
-     for (i = 0; i < dependent_pkgs->len; i++) {
-         err = opkg_remove_pkg(dependent_pkgs->pkgs[i],0);
-@@ -254,13 +254,13 @@ opkg_remove_pkg(pkg_t *pkg, int from_upgrade)
-      if (!conf->force_depends
- 	 && !(pkg->state_flag & SF_REPLACE)) {
- 	  abstract_pkg_t **dependents;
--	  int has_installed_dependents = 
-+	  int has_installed_dependents =
- 	       pkg_has_installed_dependents(pkg, &dependents);
- 
- 	  if (has_installed_dependents) {
- 	       /*
- 		* if this package is depended upon by others, then either we should
--		* not remove it or we should remove it and all of its dependents 
-+		* not remove it or we should remove it and all of its dependents
- 		*/
- 
- 	       if (!conf->force_removal_of_dependent_packages) {
-@@ -303,7 +303,7 @@ opkg_remove_pkg(pkg_t *pkg, int from_upgrade)
-      remove_maintainer_scripts(pkg);
-      pkg->state_status = SS_NOT_INSTALLED;
- 
--     if (parent_pkg) 
-+     if (parent_pkg)
- 	  parent_pkg->state_status = SS_NOT_INSTALLED;
- 
-      /* remove autoinstalled packages that are orphaned by the removal of this one */
-@@ -376,7 +376,7 @@ remove_data_files_and_list(pkg_t *pkg)
- 	       removed_a_dir = 0;
- 	       for (iter = str_list_first(&installed_dirs); iter; iter = str_list_next(&installed_dirs, iter)) {
- 		    file_name = (char *)iter->data;
--	    
-+
- 		    if (rmdir(file_name) == 0) {
- 			 opkg_msg(INFO, "Deleting %s.\n", file_name);
- 			 removed_a_dir = 1;
-diff --git a/libopkg/opkg_upgrade.c b/libopkg/opkg_upgrade.c
-index d58a12b..10b8217 100644
---- a/libopkg/opkg_upgrade.c
-+++ b/libopkg/opkg_upgrade.c
-@@ -44,10 +44,10 @@ opkg_upgrade_pkg(pkg_t *old)
-           free(old_version);
-           return 0;
-      }
--          
-+
-      old_version = pkg_version_str_alloc(old);
-      new_version = pkg_version_str_alloc(new);
--               
-+
-      cmp = pkg_compare_versions(old, new);
-      opkg_msg(DEBUG, "Comparing visible versions of pkg %s:"
-                   "\n\t%s is installed "
-@@ -122,7 +122,7 @@ prepare_upgrade_list(void)
-         cmp = pkg_compare_versions(old, new);
- 
-         if ( cmp < 0 ) {
--           node = active_list_move_node(all, head, &old->list); 
-+           node = active_list_move_node(all, head, &old->list);
-         }
-     }
-     active_list_head_delete(all);
-diff --git a/libopkg/opkg_utils.c b/libopkg/opkg_utils.c
-index 5ab5227..ebe4fa8 100644
---- a/libopkg/opkg_utils.c
-+++ b/libopkg/opkg_utils.c
-@@ -1,7 +1,7 @@
- /* opkg_utils.c - the opkg package management system
- 
-    Steven M. Ayer
--   
-+
-    Copyright (C) 2002 Compaq Computer Corporation
- 
-    This program is free software; you can redistribute it and/or
-@@ -30,9 +30,9 @@ get_available_kbytes(char * filesystem)
-         return 0;
-     }
- 
--    // Actually ((sfs.f_bavail * sfs.f_frsize) / 1024) 
--    // and here we try to avoid overflow. 
--    if (f.f_frsize >= 1024) 
-+    // Actually ((sfs.f_bavail * sfs.f_frsize) / 1024)
-+    // and here we try to avoid overflow.
-+    if (f.f_frsize >= 1024)
-         return (f.f_bavail * (f.f_frsize / 1024));
-     else if (f.f_frsize > 0)
-         return f.f_bavail / (1024 / f.f_frsize);
-@@ -47,8 +47,8 @@ char *trim_xstrdup(const char *src)
- {
-      const char *end;
- 
--     /* remove it from the front */    
--     while(src && 
-+     /* remove it from the front */
-+     while(src &&
- 	   isspace(*src) &&
- 	   *src)
- 	  src++;
-diff --git a/libopkg/opkg_utils.h b/libopkg/opkg_utils.h
-index ecdd3f5..092d158 100644
---- a/libopkg/opkg_utils.h
-+++ b/libopkg/opkg_utils.h
-@@ -1,7 +1,7 @@
- /* opkg_utils.h - the opkg package management system
- 
-    Steven M. Ayer
--   
-+
-    Copyright (C) 2002 Compaq Computer Corporation
- 
-    This program is free software; you can redistribute it and/or
-diff --git a/libopkg/pkg.c b/libopkg/pkg.c
-index 9b3c6df..38816d4 100644
---- a/libopkg/pkg.c
-+++ b/libopkg/pkg.c
-@@ -95,7 +95,7 @@ pkg_init(pkg_t *pkg)
-      pkg->recommends_str = NULL;
-      pkg->suggests_count = 0;
-      pkg->recommends_count = 0;
--     
-+
-      active_list_init(&pkg->list);
- 
-      pkg->conflicts = NULL;
-@@ -103,7 +103,7 @@ pkg_init(pkg_t *pkg)
- 
-      pkg->replaces = NULL;
-      pkg->replaces_count = 0;
--    
-+
-      pkg->pre_depends_count = 0;
-      pkg->pre_depends_str = NULL;
-      pkg->provides_count = 0;
-@@ -188,7 +188,7 @@ pkg_deinit(pkg_t *pkg)
- 	if (pkg->description)
- 		free(pkg->description);
- 	pkg->description = NULL;
--	
-+
- 	pkg->state_want = SW_UNKNOWN;
- 	pkg->state_flag = SF_OK;
- 	pkg->state_status = SS_NOT_INSTALLED;
-@@ -221,11 +221,11 @@ pkg_deinit(pkg_t *pkg)
- 
- 	pkg->pre_depends_count = 0;
- 	pkg->provides_count = 0;
--	
-+
- 	if (pkg->filename)
- 		free(pkg->filename);
- 	pkg->filename = NULL;
--	
-+
- 	if (pkg->local_filename)
- 		free(pkg->local_filename);
- 	pkg->local_filename = NULL;
-@@ -281,7 +281,7 @@ pkg_init_from_file(pkg_t *pkg, const char *filename)
- 	pkg->local_filename = xstrdup(filename);
- 
- 	tmp = xstrdup(filename);
--	sprintf_alloc(&control_path, "%s/%s.control.XXXXXX", 
-+	sprintf_alloc(&control_path, "%s/%s.control.XXXXXX",
-                         conf->tmp_dir,
-                         basename(tmp));
- 	free(tmp);
-@@ -641,8 +641,8 @@ pkg_formatted_field(FILE *fp, pkg_t *pkg, const char *field)
-                fprintf(fp, "Conffiles:\n");
- 	       for (iter = nv_pair_list_first(&pkg->conffiles); iter; iter = nv_pair_list_next(&pkg->conffiles, iter)) {
- 		    if (((conffile_t *)iter->data)->name && ((conffile_t *)iter->data)->value) {
--                         fprintf(fp, " %s %s\n", 
--                                 ((conffile_t *)iter->data)->name, 
-+                         fprintf(fp, " %s %s\n",
-+                                 ((conffile_t *)iter->data)->name,
-                                  ((conffile_t *)iter->data)->value);
- 		    }
- 	       }
-@@ -1004,7 +1004,7 @@ pkg_name_version_and_architecture_compare(const void *p1, const void *p2)
- 	       a->name, b->name);
-        return 0;
-      }
--       
-+
-      namecmp = strcmp(a->name, b->name);
-      if (namecmp)
- 	  return namecmp;
-@@ -1147,7 +1147,7 @@ pkg_get_installed_files(pkg_t *pkg)
- 
-      while (1) {
- 	  char *file_name;
--	
-+
- 	  line = file_read_line_alloc(list_file);
- 	  if (line == NULL) {
- 	       break;
-@@ -1345,8 +1345,8 @@ pkg_info_preinstall_check(void)
- 			       "files for pkg %s.\n", pkg->name);
- 	       break;
- 	  }
--	  for (iter = str_list_first(installed_files), niter = str_list_next(installed_files, iter); 
--                  iter; 
-+	  for (iter = str_list_first(installed_files), niter = str_list_next(installed_files, iter);
-+                  iter;
-                   iter = niter, niter = str_list_next(installed_files, iter)) {
- 	       char *installed_file = (char *) iter->data;
- 	       file_hash_set_file_owner(installed_file, pkg);
-diff --git a/libopkg/pkg.h b/libopkg/pkg.h
-index 1b65feb..775b656 100644
---- a/libopkg/pkg.h
-+++ b/libopkg/pkg.h
-@@ -145,7 +145,7 @@ struct pkg
-      char **conflicts_str;
-      compound_depend_t * conflicts;
-      unsigned int conflicts_count;
--	
-+
-      char **replaces_str;
-      unsigned int replaces_count;
-      abstract_pkg_t ** replaces;
-@@ -191,7 +191,7 @@ void pkg_deinit(pkg_t *pkg);
- int pkg_init_from_file(pkg_t *pkg, const char *filename);
- abstract_pkg_t *abstract_pkg_new(void);
- 
--/* 
-+/*
-  * merges fields from newpkg into oldpkg.
-  * Forcibly sets oldpkg state_status, state_want and state_flags
-  */
-diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c
-index ee5e9b6..56f3bd7 100644
---- a/libopkg/pkg_depends.c
-+++ b/libopkg/pkg_depends.c
-@@ -1,7 +1,7 @@
- /* pkg_depends.c - the opkg package management system
- 
-    Steven M. Ayer
--   
-+
-    Copyright (C) 2002 Compaq Computer Corporation
- 
-    This program is free software; you can redistribute it and/or
-@@ -50,7 +50,7 @@ static int pkg_constraint_satisfied(pkg_t *pkg, void *cdata)
- 	  return 0;
- }
- 
--/* returns ndependencies or negative error value */ 
-+/* returns ndependencies or negative error value */
- int
- pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t *unsatisfied,
- 		char *** unresolved)
-@@ -61,8 +61,8 @@ pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t *unsatisfied,
-      char ** the_lost;
-      abstract_pkg_t * ab_pkg;
- 
--     /* 
--      * this is a setup to check for redundant/cyclic dependency checks, 
-+     /*
-+      * this is a setup to check for redundant/cyclic dependency checks,
-       * which are marked at the abstract_pkg level
-       */
-      if (!(ab_pkg = pkg->parent)) {
-@@ -73,7 +73,7 @@ pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t *unsatisfied,
-      if (ab_pkg->dependencies_checked) {    /* avoid duplicate or cyclic checks */
- 	  *unresolved = NULL;
- 	  return 0;
--     } else { 
-+     } else {
- 	  ab_pkg->dependencies_checked = 1;  /* mark it for subsequent visits */
-      }
-      /**/
-@@ -85,7 +85,7 @@ pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t *unsatisfied,
-      }
- 
-      the_lost = NULL;
--	
-+
-      /* foreach dependency */
-      for (i = 0; i < count; i++) {
- 	  compound_depend_t * compound_depend = &pkg->depends[i];
-@@ -100,7 +100,7 @@ pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t *unsatisfied,
- 		    abstract_pkg_t *abpkg = possible_satisfiers[j]->pkg;
- 		    abstract_pkg_vec_t *ab_provider_vec = abpkg->provided_by;
- 		    int nposs = ab_provider_vec->len;
--		    abstract_pkg_t **ab_providers = ab_provider_vec->pkgs; 
-+		    abstract_pkg_t **ab_providers = ab_provider_vec->pkgs;
- 		    int l;
- 		    for (l = 0; l < nposs; l++) {
- 			 pkg_vec_t *test_vec = ab_providers[l]->pkgs;
-@@ -108,7 +108,7 @@ pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t *unsatisfied,
- 			 if (!test_vec){   /* no pkg_vec hooked up to the abstract_pkg!  (need another feed?) */
- 			      continue;
- 			 }
--	      
-+
- 			 /* cruise this possiblity's pkg_vec looking for an installed version */
- 			 for (k = 0; k < test_vec->len; k++) {
- 			      pkg_t *pkg_scout = test_vec->pkgs[k];
-@@ -167,9 +167,9 @@ pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t *unsatisfied,
- 	       /* foreach provided_by, which includes the abstract_pkg itself */
- 	       depend_t *dependence_to_satisfy = possible_satisfiers[j];
- 	       abstract_pkg_t *satisfying_apkg = possible_satisfiers[j]->pkg;
--	       pkg_t *satisfying_pkg = 
--		    pkg_hash_fetch_best_installation_candidate(satisfying_apkg, 
--							       pkg_installed_and_constraint_satisfied, 
-+	       pkg_t *satisfying_pkg =
-+		    pkg_hash_fetch_best_installation_candidate(satisfying_apkg,
-+							       pkg_installed_and_constraint_satisfied,
- 							       dependence_to_satisfy, 1);
-                /* Being that I can't test constraing in pkg_hash, I will test it here */
- 	       if (satisfying_pkg != NULL) {
-@@ -191,9 +191,9 @@ pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t *unsatisfied,
- 		    /* foreach provided_by, which includes the abstract_pkg itself */
- 		    depend_t *dependence_to_satisfy = possible_satisfiers[j];
- 		    abstract_pkg_t *satisfying_apkg = possible_satisfiers[j]->pkg;
--		    pkg_t *satisfying_pkg = 
--			 pkg_hash_fetch_best_installation_candidate(satisfying_apkg, 
--								    pkg_constraint_satisfied, 
-+		    pkg_t *satisfying_pkg =
-+			 pkg_hash_fetch_best_installation_candidate(satisfying_apkg,
-+								    pkg_constraint_satisfied,
- 								    dependence_to_satisfy, 1);
-                     /* Being that I can't test constraing in pkg_hash, I will test it here too */
- 	            if (satisfying_pkg != NULL) {
-@@ -239,7 +239,7 @@ pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t *unsatisfied,
- 				pkg->name, satisfier_entry_pkg->name);
- 		    } else {
- 			 char ** newstuff = NULL;
--			 
-+
- 			 if (satisfier_entry_pkg != pkg &&
- 			     !is_pkg_in_pkg_vec(unsatisfied, satisfier_entry_pkg)) {
- 			      pkg_vec_insert(unsatisfied, satisfier_entry_pkg);
-@@ -259,10 +259,10 @@ pkg_hash_fetch_unsatisfied_dependencies(pkg_t * pkg, pkg_vec_t *unsatisfied,
-      return unsatisfied->len;
- }
- 
--/*checking for conflicts !in replaces 
--  If a packages conflicts with another but is also replacing it, I should not consider it a 
--  really conflicts 
--  returns 0 if conflicts <> replaces or 1 if conflicts == replaces 
-+/*checking for conflicts !in replaces
-+  If a packages conflicts with another but is also replacing it, I should not consider it a
-+  really conflicts
-+  returns 0 if conflicts <> replaces or 1 if conflicts == replaces
- */
- static int
- is_pkg_a_replaces(pkg_t *pkg_scout,pkg_t *pkg)
-@@ -297,11 +297,11 @@ pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg)
-     int i, j, k;
-     int count;
-     abstract_pkg_t * ab_pkg;
--    pkg_t **pkg_scouts; 
--    pkg_t *pkg_scout; 
-+    pkg_t **pkg_scouts;
-+    pkg_t *pkg_scout;
- 
--    /* 
--     * this is a setup to check for redundant/cyclic dependency checks, 
-+    /*
-+     * this is a setup to check for redundant/cyclic dependency checks,
-      * which are marked at the abstract_pkg level
-      */
-     if(!(ab_pkg = pkg->parent)){
-@@ -340,7 +340,7 @@ pkg_vec_t * pkg_hash_fetch_conflicts(pkg_t * pkg)
-                     pkg_scout = pkg_scouts[k];
-                     if (!pkg_scout) {
-                         opkg_msg(ERROR,  "Internal error: pkg_scout=NULL\n");
--                        continue; 
-+                        continue;
-                     }
- 		    if ((pkg_scout->state_status == SS_INSTALLED || pkg_scout->state_want == SW_INSTALL) &&
- 		       version_constraints_satisfied(possible_satisfier, pkg_scout) && !is_pkg_a_replaces(pkg_scout,pkg)){
-@@ -377,21 +377,21 @@ int version_constraints_satisfied(depend_t * depends, pkg_t * pkg)
-     free (temp->version);
-     free(temp);
- 
--    if((depends->constraint == EARLIER) && 
-+    if((depends->constraint == EARLIER) &&
-        (comparison < 0))
- 	return 1;
--    else if((depends->constraint == LATER) && 
-+    else if((depends->constraint == LATER) &&
- 	    (comparison > 0))
- 	return 1;
-     else if(comparison == 0)
- 	return 1;
--    else if((depends->constraint == LATER_EQUAL) && 
-+    else if((depends->constraint == LATER_EQUAL) &&
- 	    (comparison >= 0))
- 	return 1;
--    else if((depends->constraint == EARLIER_EQUAL) && 
-+    else if((depends->constraint == EARLIER_EQUAL) &&
- 	    (comparison <= 0))
- 	return 1;
--    
-+
-     return 0;
- }
- 
-@@ -402,7 +402,7 @@ int pkg_dependence_satisfiable(depend_t *depend)
-      int n_providers = provider_apkgs->len;
-      abstract_pkg_t **apkgs = provider_apkgs->pkgs;
-      pkg_vec_t *pkg_vec;
--     int n_pkgs ; 
-+     int n_pkgs ;
-      int i;
-      int j;
- 
-@@ -556,9 +556,9 @@ static char ** merge_unresolved(char ** oldstuff, char ** newstuff)
-     return result;
- }
- 
--/* 
-+/*
-  * a kinda kludgy way to back out depends str from two different arrays (reg'l'r 'n pre)
-- * this is null terminated, no count is carried around 
-+ * this is null terminated, no count is carried around
-  */
- char ** add_unresolved_dep(pkg_t * pkg, char ** the_lost, int ref_ndx)
- {
-@@ -572,7 +572,7 @@ char ** add_unresolved_dep(pkg_t * pkg, char ** the_lost, int ref_ndx)
-     resized = xrealloc(the_lost, sizeof(char *) * (count + 1));
-     resized[count - 1] = pkg_depend_str(pkg, ref_ndx);
-     resized[count] = NULL;
--    
-+
-     return resized;
- }
- 
-@@ -798,7 +798,7 @@ void buildDependedUponBy(pkg_t * pkg, abstract_pkg_t * ab_pkg)
- 	       }
- 	       *temp = ab_pkg;
- 
--	       ab_depend->depended_upon_by = xrealloc(ab_depend->depended_upon_by, 
-+	       ab_depend->depended_upon_by = xrealloc(ab_depend->depended_upon_by,
- 									(othercount + 1) * sizeof(abstract_pkg_t *));
- 	       /* the array may have moved */
- 	       temp = ab_depend->depended_upon_by + othercount;
-@@ -810,15 +810,15 @@ void buildDependedUponBy(pkg_t * pkg, abstract_pkg_t * ab_pkg)
- 
- static depend_t * depend_init(void)
- {
--    depend_t * d = xcalloc(1, sizeof(depend_t));    
-+    depend_t * d = xcalloc(1, sizeof(depend_t));
-     d->constraint = NONE;
-     d->version = NULL;
-     d->pkg = NULL;
--    
-+
-     return d;
- }
- 
--static int parseDepends(compound_depend_t *compound_depend, 
-+static int parseDepends(compound_depend_t *compound_depend,
- 			char * depend_str)
- {
-      char * pkg_name, buffer[2048];
-@@ -852,9 +852,9 @@ static int parseDepends(compound_depend_t *compound_depend,
- 	       *dest++ = *src++;
- 	  *dest = '\0';
- 	  pkg_name = trim_xstrdup(buffer);
--	
-+
- 	  /* now look at possible version info */
--	
-+
- 	  /* skip to next chars */
- 	  if(isspace(*src))
- 	       while(*src && isspace(*src)) src++;
-@@ -889,7 +889,7 @@ static int parseDepends(compound_depend_t *compound_depend,
- 	       }
- 	       else if(!strncmp(src, ">", 1)){
- 		    possibilities[i]->constraint = LATER_EQUAL;
--		    src++; 
-+		    src++;
- 	       }
- 
- 	       /* now we have any constraint, pass space to version string */
-@@ -907,7 +907,7 @@ static int parseDepends(compound_depend_t *compound_depend,
- 	  possibilities[i]->pkg = ensure_abstract_pkg_by_name(pkg_name);
- 
- 	  free(pkg_name);
--	
-+
- 	  /* now get past the ) and any possible | chars */
- 	  while(*src &&
- 		(isspace(*src) ||
-diff --git a/libopkg/pkg_depends.h b/libopkg/pkg_depends.h
-index 9c5da27..5d1f074 100644
---- a/libopkg/pkg_depends.h
-+++ b/libopkg/pkg_depends.h
-@@ -1,7 +1,7 @@
- /* pkg_depends.h - the opkg package management system
- 
-    Steven M. Ayer
--   
-+
-    Copyright (C) 2002 Compaq Computer Corporation
- 
-    This program is free software; you can redistribute it and/or
-@@ -47,7 +47,7 @@ struct depend{
-     abstract_pkg_t * pkg;
- };
- typedef struct depend depend_t;
--    
-+
- struct compound_depend{
-     depend_type_t type;
-     int possibility_count;
-diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c
-index 67c1781..59b285d 100644
---- a/libopkg/pkg_hash.c
-+++ b/libopkg/pkg_hash.c
-@@ -1,7 +1,7 @@
- /* opkg_hash.c - the opkg package management system
- 
-    Steven M. Ayer
--   
-+
-    Copyright (C) 2002 Compaq Computer Corporation
- 
-    This program is free software; you can redistribute it and/or
-@@ -44,7 +44,7 @@ free_pkgs(const char *key, void *entry, void *data)
- 	/* Each entry in the hash table is an abstract package, which contains
- 	 * a list of packages that provide the abstract package.
- 	 */
--  
-+
- 	ab_pkg = (abstract_pkg_t*) entry;
- 
- 	if (ab_pkg->pkgs) {
-@@ -171,7 +171,7 @@ pkg_hash_load_status_files(void)
- 
- 	for (iter = void_list_first(&conf->pkg_dest_list); iter;
- 			iter = void_list_next(&conf->pkg_dest_list, iter)) {
--	
-+
- 		dest = (pkg_dest_t *)iter->data;
- 
- 		if (file_exists(dest->status_file_name)) {
-@@ -247,7 +247,7 @@ pkg_hash_fetch_best_installation_candidate(abstract_pkg_t *apkg,
- 	  }
- 
- 	  if (replacement_apkg)
--	       opkg_msg(DEBUG, "replacement_apkg=%s for provider_apkg=%s.\n", 
-+	       opkg_msg(DEBUG, "replacement_apkg=%s for provider_apkg=%s.\n",
- 			    replacement_apkg->name, provider_apkg->name);
- 
- 	  if (replacement_apkg && (replacement_apkg != provider_apkg)) {
-@@ -262,7 +262,7 @@ pkg_hash_fetch_best_installation_candidate(abstract_pkg_t *apkg,
- 			       provider_apkg->name);
- 	       continue;
- 	  }
--    
-+
- 
- 	  /* now check for supported architecture */
- 	  {
-@@ -274,7 +274,7 @@ pkg_hash_fetch_best_installation_candidate(abstract_pkg_t *apkg,
- 		    opkg_msg(DEBUG, "%s arch=%s arch_priority=%d version=%s.\n",
- 				 maybe->name, maybe->architecture,
- 				 maybe->arch_priority, maybe->version);
--                    /* We make sure not to add the same package twice. Need to search for the reason why 
-+                    /* We make sure not to add the same package twice. Need to search for the reason why
-                        they show up twice sometimes. */
- 		    if ((maybe->arch_priority > 0) && (! pkg_vec_contains(matching_pkgs, maybe))) {
- 			 max_count++;
-@@ -313,7 +313,7 @@ pkg_hash_fetch_best_installation_candidate(abstract_pkg_t *apkg,
-              good_pkg_by_name = matching;
- 	     /* It has been provided by hand, so it is what user want */
-              if (matching->provided_by_hand == 1)
--                break;                                 
-+                break;
-           }
-      }
- 
-@@ -344,7 +344,7 @@ pkg_hash_fetch_best_installation_candidate(abstract_pkg_t *apkg,
- 				matching->name, prio);
-                   }
-               }
--          
-+
-           }
- 
-      if (conf->verbosity >= INFO && matching_apkgs->len > 1) {
-@@ -364,7 +364,7 @@ pkg_hash_fetch_best_installation_candidate(abstract_pkg_t *apkg,
-      abstract_pkg_vec_free(matching_apkgs);
-      abstract_pkg_vec_free(providers);
- 
--     if (good_pkg_by_name) {   /* We found a good candidate, we will install it */ 
-+     if (good_pkg_by_name) {   /* We found a good candidate, we will install it */
- 	  return good_pkg_by_name;
-      }
-      if (held_pkg) {
-@@ -404,7 +404,7 @@ pkg_name_constraint_fcn(pkg_t *pkg, void *cdata)
- 	if (strcmp(pkg->name, name) == 0)
- 		return 1;
- 	else
--		return 0;   
-+		return 0;
- }
- 
- static pkg_vec_t *
-@@ -449,10 +449,10 @@ pkg_hash_fetch_by_name_version(const char *pkg_name, const char * version)
- 	pkg_vec_t * vec;
- 	int i;
- 	char *version_str = NULL;
--    
-+
- 	if(!(vec = pkg_vec_fetch_by_name(pkg_name)))
- 		return NULL;
--    
-+
- 	for(i = 0; i < vec->len; i++) {
- 		version_str = pkg_version_str_alloc(vec->pkgs[i]);
- 		if(!strcmp(version_str, version)) {
-@@ -464,7 +464,7 @@ pkg_hash_fetch_by_name_version(const char *pkg_name, const char * version)
- 
- 	if(i == vec->len)
- 		return NULL;
--    
-+
- 	return vec->pkgs[i];
- }
- 
-@@ -658,7 +658,7 @@ file_hash_set_file_owner(const char *file_name, pkg_t *owning_pkg)
- 
- 	file_name = strip_offline_root(file_name);
- 
--	hash_table_insert(&conf->file_hash, file_name, owning_pkg); 
-+	hash_table_insert(&conf->file_hash, file_name, owning_pkg);
- 
- 	if (old_owning_pkg) {
- 		pkg_get_installed_files(old_owning_pkg);
-diff --git a/libopkg/pkg_hash.h b/libopkg/pkg_hash.h
-index 0ae01e7..1165d83 100644
---- a/libopkg/pkg_hash.h
-+++ b/libopkg/pkg_hash.h
-@@ -1,7 +1,7 @@
- /* pkg_hash.h - the opkg package management system
- 
-    Steven M. Ayer
--   
-+
-    Copyright (C) 2002 Compaq Computer Corporation
- 
-    This program is free software; you can redistribute it and/or
-@@ -40,7 +40,7 @@ abstract_pkg_t * ensure_abstract_pkg_by_name(const char * pkg_name);
- void pkg_hash_fetch_all_installed(pkg_vec_t *installed);
- pkg_t * pkg_hash_fetch_by_name_version(const char *pkg_name,
- 				       const char * version);
--pkg_t *pkg_hash_fetch_best_installation_candidate(abstract_pkg_t *apkg, 
-+pkg_t *pkg_hash_fetch_best_installation_candidate(abstract_pkg_t *apkg,
- 						  int (*constraint_fcn)(pkg_t *pkg, void *data), void *cdata, int quiet);
- pkg_t *pkg_hash_fetch_best_installation_candidate_by_name(const char *name);
- pkg_t *pkg_hash_fetch_installed_by_name(const char *pkg_name);
-diff --git a/libopkg/pkg_parse.c b/libopkg/pkg_parse.c
-index f1725de..0149860 100644
---- a/libopkg/pkg_parse.c
-+++ b/libopkg/pkg_parse.c
-@@ -62,7 +62,7 @@ parse_comma_separated(const char *raw, unsigned int *count)
- 
- 	while (*raw) {
- 		depends = xrealloc(depends, sizeof(char *) * (line_count + 1));
--	
-+
- 		while (isspace(*raw))
- 			raw++;
- 
-@@ -230,7 +230,7 @@ pkg_parse_line(pkg_t *pkg, const char *line, uint mask)
- 			char *tmp = parse_simple("Installed-Time", line);
- 			pkg->installed_time = strtoul(tmp, NULL, 0);
- 			free (tmp);
--		}	    
-+		}
- 		break;
- 
- 	case 'M':
-@@ -246,7 +246,7 @@ pkg_parse_line(pkg_t *pkg, const char *line, uint mask)
- 		break;
- 
- 	case 'P':
--		if ((mask & PFM_PACKAGE) && is_field("Package", line)) 
-+		if ((mask & PFM_PACKAGE) && is_field("Package", line))
- 			pkg->name = parse_simple("Package", line);
- 		else if ((mask & PFM_PRIORITY) && is_field("Priority", line))
- 			pkg->priority = parse_simple("Priority", line);
-diff --git a/libopkg/pkg_parse.h b/libopkg/pkg_parse.h
-index 24f0238..7020a90 100644
---- a/libopkg/pkg_parse.h
-+++ b/libopkg/pkg_parse.h
-@@ -1,7 +1,7 @@
- /* pkg_parse.h - the opkg package management system
- 
-    Steven M. Ayer
--   
-+
-    Copyright (C) 2002 Compaq Computer Corporation
- 
-    This program is free software; you can redistribute it and/or
-diff --git a/libopkg/pkg_src.h b/libopkg/pkg_src.h
-index 9cedc2c..b1a95a5 100644
---- a/libopkg/pkg_src.h
-+++ b/libopkg/pkg_src.h
-@@ -20,7 +20,7 @@
- 
- #include "nv_pair.h"
- 
--typedef struct 
-+typedef struct
- {
-   char *name;
-   char *value;
-diff --git a/libopkg/pkg_vec.c b/libopkg/pkg_vec.c
-index 4f66c02..3cdc7fc 100644
---- a/libopkg/pkg_vec.c
-+++ b/libopkg/pkg_vec.c
-@@ -1,7 +1,7 @@
- /* pkg_vec.c - the opkg package management system
- 
-    Steven M. Ayer
--   
-+
-    Copyright (C) 2002 Compaq Computer Corporation
- 
-    This program is free software; you can redistribute it and/or
-@@ -56,7 +56,7 @@ void pkg_vec_insert_merge(pkg_vec_t *vec, pkg_t *pkg, int set_status)
-      /* look for a duplicate pkg by name, version, and architecture */
-      for (i = 0; i < vec->len; i++){
-          opkg_msg(DEBUG2, "%s %s arch=%s vs. %s %s arch=%s.\n",
--			pkg->name, pkg->version, pkg->architecture, 
-+			pkg->name, pkg->version, pkg->architecture,
- 			vec->pkgs[i]->name, vec->pkgs[i]->version,
- 			vec->pkgs[i]->architecture);
- 	  if ((strcmp(pkg->name, vec->pkgs[i]->name) == 0)
-@@ -70,7 +70,7 @@ void pkg_vec_insert_merge(pkg_vec_t *vec, pkg_t *pkg, int set_status)
-      }
- 
-      /* we didn't find one, add it */
--     if (!found){   
-+     if (!found){
-           opkg_msg(DEBUG2, "Adding new pkg=%s version=%s arch=%s.\n",
- 			pkg->name, pkg->version, pkg->architecture);
-           pkg_vec_insert(vec, pkg);
-@@ -143,7 +143,7 @@ int pkg_vec_mark_if_matches(pkg_vec_t *vec, const char *pattern)
- 
- abstract_pkg_vec_t * abstract_pkg_vec_alloc(void)
- {
--    abstract_pkg_vec_t * vec ; 
-+    abstract_pkg_vec_t * vec ;
-     vec = xcalloc(1, sizeof(abstract_pkg_vec_t));
-     vec->pkgs = NULL;
-     vec->len = 0;
-@@ -171,7 +171,7 @@ void abstract_pkg_vec_insert(abstract_pkg_vec_t *vec, abstract_pkg_t *pkg)
- 
- abstract_pkg_t * abstract_pkg_vec_get(abstract_pkg_vec_t *vec, int i)
- {
--    if (vec->len > i) 
-+    if (vec->len > i)
- 	return vec->pkgs[i];
-     else
- 	return NULL;
-diff --git a/libopkg/pkg_vec.h b/libopkg/pkg_vec.h
-index 0b5d82b..8ee1673 100644
---- a/libopkg/pkg_vec.h
-+++ b/libopkg/pkg_vec.h
-@@ -1,7 +1,7 @@
- /* pkg_vec.h - the opkg package management system
- 
-    Steven M. Ayer
--   
-+
-    Copyright (C) 2002 Compaq Computer Corporation
- 
-    This program is free software; you can redistribute it and/or
-diff --git a/libopkg/sprintf_alloc.c b/libopkg/sprintf_alloc.c
-index c55a016..03a5f27 100644
---- a/libopkg/sprintf_alloc.c
-+++ b/libopkg/sprintf_alloc.c
-@@ -35,12 +35,12 @@ int sprintf_alloc(char **str, const char *fmt, ...)
-       return -1;
-     }
- 
--    /* On x86_64 systems, any strings over 100 were segfaulting.  
-+    /* On x86_64 systems, any strings over 100 were segfaulting.
-        It seems that the ap needs to be reinitalized before every
-        use of the v*printf() functions. I pulled the functionality out
--       of vsprintf_alloc and combined it all here instead. 
-+       of vsprintf_alloc and combined it all here instead.
-     */
--    
-+
- 
-     /* ripped more or less straight out of PRINTF(3) */
- 
-diff --git a/libopkg/str_list.c b/libopkg/str_list.c
-index e99ef37..d3a0179 100644
---- a/libopkg/str_list.c
-+++ b/libopkg/str_list.c
-@@ -76,7 +76,7 @@ void str_list_remove(str_list_t *list, str_list_elt_t **iter)
-     char *str = void_list_remove((void_list_t *) list,
- 					       (void_list_elt_t **) iter);
- 
--    if (str) 
-+    if (str)
- 	free(str);
- }
- 
-@@ -85,7 +85,7 @@ void str_list_remove_elt(str_list_t *list, const char *target_str)
-      char *str = void_list_remove_elt((void_list_t *) list,
- 					 (void *)target_str,
- 					 (void_list_cmp_t)strcmp);
--     if (str) 
-+     if (str)
-          free(str);
- }
- 
-diff --git a/libopkg/void_list.c b/libopkg/void_list.c
-index 8248dc1..4c9d897 100644
---- a/libopkg/void_list.c
-+++ b/libopkg/void_list.c
-@@ -71,7 +71,7 @@ void_list_elt_t *void_list_pop(void_list_t *list)
- {
-     struct list_head *node;
- 
--    if (void_list_empty(list)) 
-+    if (void_list_empty(list))
-         return NULL;
-     node = list->head.next;
-     list_del_init(node);
-diff --git a/libopkg/xregex.c b/libopkg/xregex.c
-index 2808dc6..f682d4c 100644
---- a/libopkg/xregex.c
-+++ b/libopkg/xregex.c
-@@ -35,7 +35,7 @@ static void print_regcomp_err(const regex_t *preg, int err)
- {
-     unsigned int size;
-     char *error;
--    
-+
-     size = regerror(err, preg, 0, 0);
-     error = xcalloc(1, size);
-     regerror(err, preg, error, size);
-diff --git a/libopkg/xsystem.h b/libopkg/xsystem.h
-index 9bb082d..042efad 100644
---- a/libopkg/xsystem.h
-+++ b/libopkg/xsystem.h
-@@ -29,4 +29,4 @@
- int xsystem(const char *argv[]);
- 
- #endif
--	 
-+
-diff --git a/src/opkg-cl.c b/src/opkg-cl.c
-index a09275f..a5fc697 100644
---- a/src/opkg-cl.c
-+++ b/src/opkg-cl.c
-@@ -31,7 +31,7 @@
- #include "../libbb/libbb.h"
- 
- enum {
--	ARGS_OPT_FORCE_MAINTAINER = 129, 
-+	ARGS_OPT_FORCE_MAINTAINER = 129,
- 	ARGS_OPT_FORCE_DEPENDS,
- 	ARGS_OPT_FORCE_OVERWRITE,
- 	ARGS_OPT_FORCE_DOWNGRADE,
-@@ -174,7 +174,7 @@ args_parse(int argc, char *argv[])
- 			printf("Confusion: getopt_long returned %d\n", c);
- 		}
- 	}
--    
-+
- 	if (parse_err)
- 		return parse_err;
- 	else
-@@ -215,7 +215,7 @@ usage()
- 	printf("\twhatreplaces [-A] [pkgname|pat]+\n");
- 
- 	printf("\nOptions:\n");
--	printf("\t-A			Query all packages not just those installed\n"); 
-+	printf("\t-A			Query all packages not just those installed\n");
- 	printf("\t-V[<level>]		Set verbosity level to <level>.\n");
- 	printf("\t--verbosity[=<level>]	Verbosity levels:\n");
- 	printf("\t				0 errors only\n");
-@@ -256,7 +256,7 @@ usage()
- 	printf(" regexp could be something like 'pkgname*' '*file*' or similar\n");
- 	printf(" e.g. opkg info 'libstd*' or opkg search '*libop*' or opkg remove 'libncur*'\n");
- 
--	/* --force-removal-of-essential-packages	Let opkg remove essential packages. 
-+	/* --force-removal-of-essential-packages	Let opkg remove essential packages.
- 		Using this option is almost guaranteed to break your system, hence this option
- 		is not even advertised in the usage statement. */
- 
-@@ -317,7 +317,7 @@ main(int argc, char *argv[])
- 			if (pkg_hash_load_feeds())
- 				goto err1;
- 		}
--   
-+
- 		if (pkg_hash_load_status_files())
- 			goto err1;
- 	}
-diff --git a/tests/libopkg_test.c b/tests/libopkg_test.c
-index 4d82a67..dbe1e7e 100644
---- a/tests/libopkg_test.c
-+++ b/tests/libopkg_test.c
-@@ -151,7 +151,7 @@ main (int argc, char **argv)
-   }
- 
-   setenv("OFFLINE_ROOT", "/tmp", 0);
-- 
-+
-   if (opkg_new ()) {
- 	  printf("opkg_new() failed. This sucks.\n");
- 	  print_error_list();
-@@ -223,7 +223,7 @@ main (int argc, char **argv)
-         }
-       }
-       break;
--          
-+
-     case 'r':
-       if (argv[1][1] == 'e')
-       {
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0553-Allow-blacklisting-a-package-in-the-status-file.patch b/patches/opkg-0.1.8/0553-Allow-blacklisting-a-package-in-the-status-file.patch
deleted file mode 100644
index bf09079..0000000
--- a/patches/opkg-0.1.8/0553-Allow-blacklisting-a-package-in-the-status-file.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 239861f73d8f69744b8ea0eb3373ef0f4453971b Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Wed, 18 Aug 2010 05:40:17 +0000
-Subject: [PATCH] Allow blacklisting a package in the status file.
-
-To blacklist a particular package, add the following status entry for the
-package to be blacklisted:
-Status: deinstall hold not-installed
-
-Should fix the opkg end of Issue #46. OpenEmbedded will need to correctly
-prime the status file.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@553 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_conf.c |    3 ++-
- libopkg/pkg_vec.c   |   10 +++++++---
- 2 files changed, 9 insertions(+), 4 deletions(-)
-
-diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
-index f1ef0d0..bffeb84 100644
---- a/libopkg/opkg_conf.c
-+++ b/libopkg/opkg_conf.c
-@@ -359,7 +359,8 @@ opkg_conf_write_status_files(void)
- 	  /* We don't need most uninstalled packages in the status file */
- 	  if (pkg->state_status == SS_NOT_INSTALLED
- 	      && (pkg->state_want == SW_UNKNOWN
--		  || pkg->state_want == SW_DEINSTALL
-+		  || (pkg->state_want == SW_DEINSTALL
-+			  && pkg->state_flag != SF_HOLD)
- 		  || pkg->state_want == SW_PURGE)) {
- 	       continue;
- 	  }
-diff --git a/libopkg/pkg_vec.c b/libopkg/pkg_vec.c
-index 3cdc7fc..472962c 100644
---- a/libopkg/pkg_vec.c
-+++ b/libopkg/pkg_vec.c
-@@ -59,9 +59,13 @@ void pkg_vec_insert_merge(pkg_vec_t *vec, pkg_t *pkg, int set_status)
- 			pkg->name, pkg->version, pkg->architecture,
- 			vec->pkgs[i]->name, vec->pkgs[i]->version,
- 			vec->pkgs[i]->architecture);
--	  if ((strcmp(pkg->name, vec->pkgs[i]->name) == 0)
--	      && (pkg_compare_versions(pkg, vec->pkgs[i]) == 0)
--	      && (strcmp(pkg->architecture, vec->pkgs[i]->architecture) == 0)) {
-+	 /* if the name,ver,arch matches, or the name matches and the
-+	  * package is marked deinstall/hold  */
-+	  if ((!strcmp(pkg->name, vec->pkgs[i]->name))
-+	      && ((pkg->state_want == SW_DEINSTALL
-+		  && (pkg->state_flag & SF_HOLD))
-+	      || ((pkg_compare_versions(pkg, vec->pkgs[i]) == 0)
-+	      && (!strcmp(pkg->architecture, vec->pkgs[i]->architecture))))) {
- 	       found  = 1;
-                opkg_msg(DEBUG2, "Duplicate for pkg=%s version=%s arch=%s.\n",
- 			pkg->name, pkg->version, pkg->architecture);
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0554-Add-generated-man-pages-to-.gitignore.patch b/patches/opkg-0.1.8/0554-Add-generated-man-pages-to-.gitignore.patch
deleted file mode 100644
index 87b2d78..0000000
--- a/patches/opkg-0.1.8/0554-Add-generated-man-pages-to-.gitignore.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 47ba6f710905a4921f61d69b5c3e3ab22b72ad27 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Wed, 18 Aug 2010 05:40:28 +0000
-Subject: [PATCH] Add generated man pages to .gitignore.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@554 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- .gitignore |    3 +++
- 1 files changed, 3 insertions(+), 0 deletions(-)
-
-diff --git a/.gitignore b/.gitignore
-index eae52a8..f3a60ef 100644
---- a/.gitignore
-+++ b/.gitignore
-@@ -60,3 +60,6 @@ autom4te.cache/
- .deps/
- src/opkg-cl
- tests/libopkg_test
-+
-+# Man pages
-+man/*.1
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0555-Ensure-Pre-Depended-and-Recommended-packages-can-be-.patch b/patches/opkg-0.1.8/0555-Ensure-Pre-Depended-and-Recommended-packages-can-be-.patch
deleted file mode 100644
index 776b151..0000000
--- a/patches/opkg-0.1.8/0555-Ensure-Pre-Depended-and-Recommended-packages-can-be-.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 72d53fc301af46caffe7752e020dfe853c3f35a5 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 19 Aug 2010 01:53:52 +0000
-Subject: [PATCH] Ensure Pre-Depended and Recommended packages can be autoremoved.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@555 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_remove.c |    4 +++-
- 1 files changed, 3 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/opkg_remove.c b/libopkg/opkg_remove.c
-index 0e967a3..1ed2dab 100644
---- a/libopkg/opkg_remove.c
-+++ b/libopkg/opkg_remove.c
-@@ -182,7 +182,9 @@ remove_autoinstalled(pkg_t *pkg)
- 
- 	for (i=0; i<count; i++) {
- 		cdep = &pkg->depends[i];
--		if (cdep->type != DEPEND)
-+		if (cdep->type != PREDEPEND
-+		    && cdep->type != DEPEND
-+		    && cdep->type != RECOMMEND)
- 			continue;
- 		for (j=0; j<cdep->possibility_count; j++) {
- 			p = pkg_hash_fetch_installed_by_name(
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0556-Add-Recommended-packages-to-the-depended_upon_by-fie.patch b/patches/opkg-0.1.8/0556-Add-Recommended-packages-to-the-depended_upon_by-fie.patch
deleted file mode 100644
index af2569d..0000000
--- a/patches/opkg-0.1.8/0556-Add-Recommended-packages-to-the-depended_upon_by-fie.patch
+++ /dev/null
@@ -1,102 +0,0 @@
-From ac2222f7d6514fb403ce0848f6812a22a48f75c7 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 19 Aug 2010 01:54:04 +0000
-Subject: [PATCH] Add Recommended packages to the depended_upon_by field.
-
-This ensures recommended packages are not orphaned prematurely. Minor code
-clean up while here.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@556 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/pkg_depends.c |   70 ++++++++++++++++++++++++++----------------------
- 1 files changed, 38 insertions(+), 32 deletions(-)
-
-diff --git a/libopkg/pkg_depends.c b/libopkg/pkg_depends.c
-index 56f3bd7..1e14d1f 100644
---- a/libopkg/pkg_depends.c
-+++ b/libopkg/pkg_depends.c
-@@ -769,43 +769,49 @@ pkg_depend_str(pkg_t *pkg, int idx)
- 	return str;
- }
- 
--/*
-- * WARNING: This function assumes pre_depends and depends are at the
-- * start of the pkg->depends array.
-- */
- void buildDependedUponBy(pkg_t * pkg, abstract_pkg_t * ab_pkg)
- {
--     compound_depend_t * depends;
--     int count, othercount;
--     int i, j;
--     abstract_pkg_t * ab_depend;
--     abstract_pkg_t ** temp;
-+	compound_depend_t * depends;
-+	int count, othercount;
-+	int i, j;
-+	abstract_pkg_t * ab_depend;
-+	abstract_pkg_t ** temp;
-+
-+	count = pkg->pre_depends_count +
-+			pkg->depends_count +
-+			pkg->recommends_count +
-+			pkg->suggests_count;
-+
-+	for (i = 0; i < count; i++) {
-+		depends = &pkg->depends[i];
-+		if (depends->type != PREDEPEND
-+		    && depends->type != DEPEND
-+		    && depends->type != RECOMMEND)
-+			continue;
-+		for (j = 0; j < depends->possibility_count; j++) {
-+			ab_depend = depends->possibilities[j]->pkg;
-+			if (!ab_depend->depended_upon_by) {
-+				ab_depend->depended_upon_by =
-+					xcalloc(1, sizeof(abstract_pkg_t *));
-+			}
- 
--     count = pkg->pre_depends_count + pkg->depends_count;
--     depends = pkg->depends;
-+			temp = ab_depend->depended_upon_by;
-+			othercount = 1;
-+			while (*temp) {
-+			    temp++;
-+			    othercount++;
-+			}
-+			*temp = ab_pkg;
- 
--     for (i = 0; i < count; i++) {
--	  for (j = 0; j < depends->possibility_count; j++){
--	       ab_depend = depends->possibilities[j]->pkg;
--	       if(!ab_depend->depended_upon_by)
--		    ab_depend->depended_upon_by = xcalloc(1, sizeof(abstract_pkg_t *));
--
--	       temp = ab_depend->depended_upon_by;
--	       othercount = 1;
--	       while(*temp){
--		    temp++;
--		    othercount++;
--	       }
--	       *temp = ab_pkg;
-+			ab_depend->depended_upon_by =
-+				xrealloc(ab_depend->depended_upon_by,
-+				(othercount + 1) * sizeof(abstract_pkg_t *));
- 
--	       ab_depend->depended_upon_by = xrealloc(ab_depend->depended_upon_by,
--									(othercount + 1) * sizeof(abstract_pkg_t *));
--	       /* the array may have moved */
--	       temp = ab_depend->depended_upon_by + othercount;
--	       *temp = NULL;
--	  }
--	  depends++;
--     }
-+			/* the array may have been moved by realloc */
-+			temp = ab_depend->depended_upon_by + othercount;
-+			*temp = NULL;
-+		}
-+	}
- }
- 
- static depend_t * depend_init(void)
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0557-Remove-stray-semicolon.patch b/patches/opkg-0.1.8/0557-Remove-stray-semicolon.patch
deleted file mode 100644
index 4de2adc..0000000
--- a/patches/opkg-0.1.8/0557-Remove-stray-semicolon.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 0066c1ac6151d99b95453eeab3307e99f5884a45 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 24 Aug 2010 04:09:21 +0000
-Subject: [PATCH] Remove stray semicolon.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@557 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/pkg_parse.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/pkg_parse.c b/libopkg/pkg_parse.c
-index 0149860..2ce696f 100644
---- a/libopkg/pkg_parse.c
-+++ b/libopkg/pkg_parse.c
-@@ -398,7 +398,7 @@ pkg_parse_from_stream_nomalloc(pkg_t *pkg, FILE *fp, uint mask,
- 		buf = *buf0;
- 		buflen = buf0len;
- 		buf[0] = '\0';
--	};
-+	}
- 
- 	if (pkg->name == NULL) {
- 		/* probably just a blank line */
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0558-Accept-a-leading-.-for-the-control-file-name-but-don.patch b/patches/opkg-0.1.8/0558-Accept-a-leading-.-for-the-control-file-name-but-don.patch
deleted file mode 100644
index a90d9ae..0000000
--- a/patches/opkg-0.1.8/0558-Accept-a-leading-.-for-the-control-file-name-but-don.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-From f637389e79f9fb04b73d4fe254fea63e9b077a94 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 24 Aug 2010 04:09:34 +0000
-Subject: [PATCH] Accept a leading "./" for the control file name, but don't mandate it.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@558 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libbb/unarchive.c     |    7 ++++++-
- libopkg/pkg_extract.c |    3 +--
- 2 files changed, 7 insertions(+), 3 deletions(-)
-
-diff --git a/libbb/unarchive.c b/libbb/unarchive.c
-index 0e820c8..44f8715 100644
---- a/libbb/unarchive.c
-+++ b/libbb/unarchive.c
-@@ -295,8 +295,13 @@ unarchive(FILE *src_stream, FILE *out_stream,
- 
- 		if (extract_names != NULL) {
- 			int found_flag = FALSE;
-+			char *p = file_entry->name;
-+
-+			if (p[0] == '.' && p[1] == '/')
-+				p += 2;
-+
- 			for(i = 0; extract_names[i] != 0; i++) {
--				if (strcmp(extract_names[i], file_entry->name) == 0) {
-+				if (strcmp(extract_names[i], p) == 0) {
- 					found_flag = TRUE;
- 					break;
- 				}
-diff --git a/libopkg/pkg_extract.c b/libopkg/pkg_extract.c
-index b7d924c..0f21e40 100644
---- a/libopkg/pkg_extract.c
-+++ b/libopkg/pkg_extract.c
-@@ -29,8 +29,7 @@ pkg_extract_control_file_to_stream(pkg_t *pkg, FILE *stream)
- 	deb_extract(pkg->local_filename, stream,
- 			extract_control_tar_gz
- 			| extract_to_stream,
--			NULL, "./control", &err);
--
-+			NULL, "control", &err);
- 	return err;
- }
- 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0559-implement-force-postinstall-option-this-allows-forci.patch b/patches/opkg-0.1.8/0559-implement-force-postinstall-option-this-allows-forci.patch
deleted file mode 100644
index 4b5edb4..0000000
--- a/patches/opkg-0.1.8/0559-implement-force-postinstall-option-this-allows-forci.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From 6dc8a5d00f1f5244d7c3732dbc21b3763e9066b6 Mon Sep 17 00:00:00 2001
-From: google@wwsnet.net <google@wwsnet.net@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 13 Sep 2010 00:42:01 +0000
-Subject: [PATCH] implement --force-postinstall option, this allows forcing the execution of postinstall scripts in offline root mode
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@559 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_conf.c |    1 +
- libopkg/opkg_conf.h |    1 +
- libopkg/pkg.c       |    2 +-
- src/opkg-cl.c       |    7 +++++++
- 4 files changed, 10 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
-index bffeb84..6dee5ac 100644
---- a/libopkg/opkg_conf.c
-+++ b/libopkg/opkg_conf.c
-@@ -53,6 +53,7 @@ opkg_option_t options[] = {
- 	  { "force_downgrade", OPKG_OPT_TYPE_BOOL, &_conf.force_downgrade },
- 	  { "force_reinstall", OPKG_OPT_TYPE_BOOL, &_conf.force_reinstall },
- 	  { "force_space", OPKG_OPT_TYPE_BOOL, &_conf.force_space },
-+	  { "force_postinstall", OPKG_OPT_TYPE_BOOL, &_conf.force_postinstall },
-           { "check_signature", OPKG_OPT_TYPE_BOOL, &_conf.check_signature },
- 	  { "ftp_proxy", OPKG_OPT_TYPE_STRING, &_conf.ftp_proxy },
- 	  { "http_proxy", OPKG_OPT_TYPE_STRING, &_conf.http_proxy },
-diff --git a/libopkg/opkg_conf.h b/libopkg/opkg_conf.h
-index 6e7aa7d..7496ff4 100644
---- a/libopkg/opkg_conf.h
-+++ b/libopkg/opkg_conf.h
-@@ -73,6 +73,7 @@ struct opkg_conf
-      int force_space;
-      int force_removal_of_dependent_packages;
-      int force_removal_of_essential_packages;
-+     int force_postinstall;
-      int check_signature;
-      int nodeps; /* do not follow dependencies */
-      char *offline_root;
-diff --git a/libopkg/pkg.c b/libopkg/pkg.c
-index 38816d4..5b1321e 100644
---- a/libopkg/pkg.c
-+++ b/libopkg/pkg.c
-@@ -1255,7 +1255,7 @@ pkg_run_script(pkg_t *pkg, const char *script, const char *args)
- 
-      /* XXX: FEATURE: When conf->offline_root is set, we should run the
- 	maintainer script within a chroot environment. */
--     if (conf->offline_root) {
-+     if (conf->offline_root && !conf->force_postinstall) {
-           opkg_msg(INFO, "Offline root mode: not running %s.%s.\n",
- 			  pkg->name, script);
- 	  return 0;
-diff --git a/src/opkg-cl.c b/src/opkg-cl.c
-index a5fc697..3716b5c 100644
---- a/src/opkg-cl.c
-+++ b/src/opkg-cl.c
-@@ -39,6 +39,7 @@ enum {
- 	ARGS_OPT_FORCE_REMOVAL_OF_DEPENDENT_PACKAGES,
- 	ARGS_OPT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES,
- 	ARGS_OPT_FORCE_SPACE,
-+	ARGS_OPT_FORCE_POSTINSTALL,
- 	ARGS_OPT_NOACTION,
- 	ARGS_OPT_DOWNLOAD_ONLY,
- 	ARGS_OPT_NODEPS,
-@@ -74,6 +75,8 @@ static struct option long_options[] = {
- 		ARGS_OPT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES},
- 	{"force_removal_of_essential_packages", 0, 0,
- 		ARGS_OPT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES},
-+	{"force-postinstall", 0, 0, ARGS_OPT_FORCE_POSTINSTALL},
-+	{"force_postinstall", 0, 0, ARGS_OPT_FORCE_POSTINSTALL},
- 	{"noaction", 0, 0, ARGS_OPT_NOACTION},
- 	{"download-only", 0, 0, ARGS_OPT_DOWNLOAD_ONLY},
- 	{"nodeps", 0, 0, ARGS_OPT_NODEPS},
-@@ -155,6 +158,9 @@ args_parse(int argc, char *argv[])
- 		case ARGS_OPT_FORCE_SPACE:
- 			conf->force_space = 1;
- 			break;
-+		case ARGS_OPT_FORCE_POSTINSTALL:
-+			conf->force_postinstall = 1;
-+			break;
- 		case ARGS_OPT_NODEPS:
- 			conf->nodeps = 1;
- 			break;
-@@ -241,6 +247,7 @@ usage()
- 	printf("\t--force-overwrite	Overwrite files from other package(s)\n");
- 	printf("\t--force-downgrade	Allow opkg to downgrade packages\n");
- 	printf("\t--force-space		Disable free space checks\n");
-+	printf("\t--force-postinstall	Run postinstall scripts even in offline mode\n");
- 	printf("\t--noaction		No action -- test only\n");
- 	printf("\t--download-only	No action -- download only\n");
- 	printf("\t--nodeps		Do not follow dependencies\n");
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0560-fix-compile-issues-on-OS-X-and-FreeBSD.patch b/patches/opkg-0.1.8/0560-fix-compile-issues-on-OS-X-and-FreeBSD.patch
deleted file mode 100644
index 8b50c3d..0000000
--- a/patches/opkg-0.1.8/0560-fix-compile-issues-on-OS-X-and-FreeBSD.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From d6ea4230ca70c3c7875a61e1c7c1dedb6d1b6fc5 Mon Sep 17 00:00:00 2001
-From: google@wwsnet.net <google@wwsnet.net@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 13 Sep 2010 00:47:26 +0000
-Subject: [PATCH] fix compile issues on OS X and FreeBSD
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@560 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_download.c |    1 +
- libopkg/pkg.c           |    1 +
- tests/libopkg_test.c    |    1 +
- 3 files changed, 3 insertions(+), 0 deletions(-)
-
-diff --git a/libopkg/opkg_download.c b/libopkg/opkg_download.c
-index 4969dd7..e84340a 100644
---- a/libopkg/opkg_download.c
-+++ b/libopkg/opkg_download.c
-@@ -21,6 +21,7 @@
- 
- #include <stdio.h>
- #include <unistd.h>
-+#include <libgen.h>
- 
- #include "opkg_download.h"
- #include "opkg_message.h"
-diff --git a/libopkg/pkg.c b/libopkg/pkg.c
-index 5b1321e..2e854a9 100644
---- a/libopkg/pkg.c
-+++ b/libopkg/pkg.c
-@@ -21,6 +21,7 @@
- #include <string.h>
- #include <ctype.h>
- #include <unistd.h>
-+#include <libgen.h>
- 
- #include "pkg.h"
- 
-diff --git a/tests/libopkg_test.c b/tests/libopkg_test.c
-index dbe1e7e..31a22b0 100644
---- a/tests/libopkg_test.c
-+++ b/tests/libopkg_test.c
-@@ -5,6 +5,7 @@
- 
- #include <opkg.h>
- 
-+int opkg_state_changed;
- pkg_t *find_pkg = NULL;
- 
- 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0561-split-the-loading-part-of-opkg_conf_init-out-into-op.patch b/patches/opkg-0.1.8/0561-split-the-loading-part-of-opkg_conf_init-out-into-op.patch
deleted file mode 100644
index ebd0f12..0000000
--- a/patches/opkg-0.1.8/0561-split-the-loading-part-of-opkg_conf_init-out-into-op.patch
+++ /dev/null
@@ -1,182 +0,0 @@
-From b32c53e7d2fcc106c13ebfca4870af44423bf7c6 Mon Sep 17 00:00:00 2001
-From: google@wwsnet.net <google@wwsnet.net@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 13 Sep 2010 00:59:11 +0000
-Subject: [PATCH] - split the loading part of opkg_conf_init() out into opkg_conf_load()
- - move the temporary destination list into the global config struct
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@561 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg.c      |    3 +++
- libopkg/opkg_conf.c |   44 ++++++++++++++++++++++++--------------------
- libopkg/opkg_conf.h |    2 ++
- 3 files changed, 29 insertions(+), 20 deletions(-)
-
-diff --git a/libopkg/opkg.c b/libopkg/opkg.c
-index 87c3244..b36dc1b 100644
---- a/libopkg/opkg.c
-+++ b/libopkg/opkg.c
-@@ -120,6 +120,9 @@ opkg_new()
- 	if (opkg_conf_init())
- 		goto err0;
- 
-+	if (opkg_conf_load())
-+		goto err0;
-+
- 	if (pkg_hash_load_feeds())
- 		goto err1;
- 
-diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
-index 6dee5ac..22c99eb 100644
---- a/libopkg/opkg_conf.c
-+++ b/libopkg/opkg_conf.c
-@@ -90,15 +90,15 @@ opkg_option_t options[] = {
- };
- 
- static int
--resolve_pkg_dest_list(nv_pair_list_t *nv_pair_list)
-+resolve_pkg_dest_list(void)
- {
-      nv_pair_list_elt_t *iter;
-      nv_pair_t *nv_pair;
-      pkg_dest_t *dest;
-      char *root_dir;
- 
--     for (iter = nv_pair_list_first(nv_pair_list); iter;
--		     iter = nv_pair_list_next(nv_pair_list, iter)) {
-+     for (iter = nv_pair_list_first(&conf->tmp_dest_list); iter;
-+		     iter = nv_pair_list_next(&conf->tmp_dest_list, iter)) {
- 	  nv_pair = (nv_pair_t *)iter->data;
- 
- 	  if (conf->offline_root) {
-@@ -184,8 +184,7 @@ opkg_conf_set_option(const char *name, const char *value)
- 
- static int
- opkg_conf_parse_file(const char *filename,
--				pkg_src_list_t *pkg_src_list,
--				nv_pair_list_t *tmp_dest_nv_pair_list)
-+				pkg_src_list_t *pkg_src_list)
- {
-      int line_num = 0;
-      int err = 0;
-@@ -268,7 +267,7 @@ opkg_conf_parse_file(const char *filename,
- 				regmatch[11].rm_eo - regmatch[11].rm_so);
- 	  }
- 
--	  /* We use the tmp_dest_nv_pair_list below instead of
-+	  /* We use the conf->tmp_dest_list below instead of
- 	     conf->pkg_dest_list because we might encounter an
- 	     offline_root option later and that would invalidate the
- 	     directories we would have computed in
-@@ -291,7 +290,7 @@ opkg_conf_parse_file(const char *filename,
- 				   "Skipping.\n", name, value);
- 	       }
- 	  } else if (strcmp(type, "dest") == 0) {
--	       nv_pair_list_append(tmp_dest_nv_pair_list, name, value);
-+	       nv_pair_list_append(&conf->tmp_dest_list, name, value);
- 	  } else if (strcmp(type, "lists_dir") == 0) {
- 	       conf->lists_dir = xstrdup(value);
- 	  } else if (strcmp(type, "arch") == 0) {
-@@ -411,9 +410,19 @@ glob_errfunc(const char *epath, int eerrno)
- int
- opkg_conf_init(void)
- {
-+	pkg_src_list_init(&conf->pkg_src_list);
-+	pkg_dest_list_init(&conf->pkg_dest_list);
-+	pkg_dest_list_init(&conf->tmp_dest_list);
-+	nv_pair_list_init(&conf->arch_list);
-+
-+	return 0;
-+}
-+
-+int
-+opkg_conf_load(void)
-+{
- 	int i, glob_ret;
- 	char *tmp, *tmp_dir_base, **tmp_val;
--	nv_pair_list_t tmp_dest_nv_pair_list;
- 	glob_t globbuf;
- 	char *etc_opkg_conf_pattern;
- 
-@@ -423,11 +432,6 @@ opkg_conf_init(void)
- 	conf->check_x509_path = 1;
- #endif
- 
--	pkg_src_list_init(&conf->pkg_src_list);
--	pkg_dest_list_init(&conf->pkg_dest_list);
--	nv_pair_list_init(&conf->arch_list);
--	nv_pair_list_init(&tmp_dest_nv_pair_list);
--
- 	if (!conf->offline_root)
- 		conf->offline_root = xstrdup(getenv("OFFLINE_ROOT"));
- 
-@@ -438,7 +442,7 @@ opkg_conf_init(void)
- 			goto err0;
- 		}
- 		if (opkg_conf_parse_file(conf->conf_file,
--				&conf->pkg_src_list, &tmp_dest_nv_pair_list))
-+				&conf->pkg_src_list))
- 			goto err1;
- 	}
- 
-@@ -467,7 +471,7 @@ opkg_conf_init(void)
- 					!strcmp(conf->conf_file, globbuf.gl_pathv[i]))
- 				continue;
- 		if ( opkg_conf_parse_file(globbuf.gl_pathv[i],
--			&conf->pkg_src_list, &tmp_dest_nv_pair_list)<0) {
-+			&conf->pkg_src_list)<0) {
- 			globfree(&globbuf);
- 			goto err1;
- 		}
-@@ -531,16 +535,16 @@ opkg_conf_init(void)
- 	}
- 
- 	/* Even if there is no conf file, we'll need at least one dest. */
--	if (nv_pair_list_empty(&tmp_dest_nv_pair_list)) {
--	nv_pair_list_append(&tmp_dest_nv_pair_list,
-+	if (nv_pair_list_empty(&conf->tmp_dest_list)) {
-+		nv_pair_list_append(&conf->tmp_dest_list,
- 			OPKG_CONF_DEFAULT_DEST_NAME,
- 			OPKG_CONF_DEFAULT_DEST_ROOT_DIR);
- 	}
- 
--	if (resolve_pkg_dest_list(&tmp_dest_nv_pair_list))
-+	if (resolve_pkg_dest_list())
- 		goto err4;
- 
--	nv_pair_list_deinit(&tmp_dest_nv_pair_list);
-+	nv_pair_list_deinit(&conf->tmp_dest_list);
- 
- 	return 0;
- 
-@@ -580,7 +584,7 @@ err1:
- 		}
- 	}
- err0:
--	nv_pair_list_deinit(&tmp_dest_nv_pair_list);
-+	nv_pair_list_deinit(&conf->tmp_dest_list);
- 	if (conf->dest_str)
- 		free(conf->dest_str);
- 	if (conf->conf_file)
-diff --git a/libopkg/opkg_conf.h b/libopkg/opkg_conf.h
-index 7496ff4..0b163b0 100644
---- a/libopkg/opkg_conf.h
-+++ b/libopkg/opkg_conf.h
-@@ -46,6 +46,7 @@ struct opkg_conf
- {
-      pkg_src_list_t pkg_src_list;
-      pkg_dest_list_t pkg_dest_list;
-+     pkg_dest_list_t tmp_dest_list;
-      nv_pair_list_t arch_list;
- 
-      int restrict_to_default_dest;
-@@ -132,6 +133,7 @@ struct opkg_option {
- };
- 
- int opkg_conf_init(void);
-+int opkg_conf_load(void);
- void opkg_conf_deinit(void);
- 
- int opkg_conf_write_status_files(void);
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0562-utilize-opkg_conf_init-to-initialize-the-pair-lists-.patch b/patches/opkg-0.1.8/0562-utilize-opkg_conf_init-to-initialize-the-pair-lists-.patch
deleted file mode 100644
index 19f9378..0000000
--- a/patches/opkg-0.1.8/0562-utilize-opkg_conf_init-to-initialize-the-pair-lists-.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-From 6efa2657bf14266c58ae8c0c16d8584dac6ed600 Mon Sep 17 00:00:00 2001
-From: google@wwsnet.net <google@wwsnet.net@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 13 Sep 2010 01:01:58 +0000
-Subject: [PATCH] - utilize opkg_conf_init() to initialize the pair lists before parsing the arguments
- - implement --add-dest and --add-arch options to pass destinations and valid architectures via the commandline
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@562 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- src/opkg-cl.c |   26 +++++++++++++++++++++++++-
- 1 files changed, 25 insertions(+), 1 deletions(-)
-
-diff --git a/src/opkg-cl.c b/src/opkg-cl.c
-index 3716b5c..ebaa3d0 100644
---- a/src/opkg-cl.c
-+++ b/src/opkg-cl.c
-@@ -40,6 +40,8 @@ enum {
- 	ARGS_OPT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES,
- 	ARGS_OPT_FORCE_SPACE,
- 	ARGS_OPT_FORCE_POSTINSTALL,
-+	ARGS_OPT_ADD_ARCH,
-+	ARGS_OPT_ADD_DEST,
- 	ARGS_OPT_NOACTION,
- 	ARGS_OPT_DOWNLOAD_ONLY,
- 	ARGS_OPT_NODEPS,
-@@ -82,6 +84,8 @@ static struct option long_options[] = {
- 	{"nodeps", 0, 0, ARGS_OPT_NODEPS},
- 	{"offline", 1, 0, 'o'},
- 	{"offline-root", 1, 0, 'o'},
-+	{"add-arch", 1, 0, ARGS_OPT_ADD_ARCH},
-+	{"add-dest", 1, 0, ARGS_OPT_ADD_DEST},
- 	{"test", 0, 0, ARGS_OPT_NOACTION},
- 	{"tmp-dir", 1, 0, 't'},
- 	{"tmp_dir", 1, 0, 't'},
-@@ -96,6 +100,7 @@ args_parse(int argc, char *argv[])
- 	int c;
- 	int option_index = 0;
- 	int parse_err = 0;
-+	char *tuple, *targ;
- 
- 	while (1) {
- 		c = getopt_long_only(argc, argv, "Ad:f:no:p:t:vV::",
-@@ -164,6 +169,20 @@ args_parse(int argc, char *argv[])
- 		case ARGS_OPT_NODEPS:
- 			conf->nodeps = 1;
- 			break;
-+		case ARGS_OPT_ADD_ARCH:
-+		case ARGS_OPT_ADD_DEST:
-+			tuple = xstrdup(optarg);
-+			if ((targ = strchr(tuple, ':')) != NULL) {
-+				*targ++ = 0;
-+				if ((strlen(tuple) > 0) && (strlen(targ) > 0)) {
-+					nv_pair_list_append(
-+						(c == ARGS_OPT_ADD_ARCH)
-+							? &conf->arch_list : &conf->tmp_dest_list,
-+						tuple, targ);
-+				}
-+			}
-+			free(tuple);
-+			break;
- 		case ARGS_OPT_NOACTION:
- 			conf->noaction = 1;
- 			break;
-@@ -239,6 +258,8 @@ usage()
- 	printf("				directory name in a pinch).\n");
- 	printf("\t-o <dir>		Use <dir> as the root directory for\n");
- 	printf("\t--offline-root <dir>	offline installation of packages.\n");
-+	printf("\t--add-arch <arch>:<prio>	Register architecture with given priority\n");
-+	printf("\t--add-dest <name>:<path>	Register destination with given path\n");
- 
- 	printf("\nForce Options:\n");
- 	printf("\t--force-depends		Install/remove despite failed dependencies\n");
-@@ -279,6 +300,9 @@ main(int argc, char *argv[])
- 	int nocheckfordirorfile = 0;
-         int noreadfeedsfile = 0;
- 
-+	if (opkg_conf_init())
-+		goto err0;
-+
- 	conf->verbosity = NOTICE;
- 
- 	opts = args_parse(argc, argv);
-@@ -316,7 +340,7 @@ main(int argc, char *argv[])
- 
- 	conf->pfm = cmd->pfm;
- 
--	if (opkg_conf_init())
-+	if (opkg_conf_load())
- 		goto err0;
- 
- 	if (!nocheckfordirorfile) {
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0563-update-manpages-to-reflect-r559-and-r562.patch b/patches/opkg-0.1.8/0563-update-manpages-to-reflect-r559-and-r562.patch
deleted file mode 100644
index 31abc04..0000000
--- a/patches/opkg-0.1.8/0563-update-manpages-to-reflect-r559-and-r562.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 94b8e3537df5c6eb8b6f17e2f1c3820f2492ff45 Mon Sep 17 00:00:00 2001
-From: google@wwsnet.net <google@wwsnet.net@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 13 Sep 2010 01:14:38 +0000
-Subject: [PATCH] update manpages to reflect r559 and r562
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@563 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- man/opkg-cl.1.in |   11 +++++++++++
- 1 files changed, 11 insertions(+), 0 deletions(-)
-
-diff --git a/man/opkg-cl.1.in b/man/opkg-cl.1.in
-index 9c617f0..d15e985 100644
---- a/man/opkg-cl.1.in
-+++ b/man/opkg-cl.1.in
-@@ -128,6 +128,14 @@ directory name in a pinch).
- \fB\-o <\fIdirectory\fP>, \fB\--offline-root <\fIdirectory\fP>\fR
- Use \fIdirectory\fP as the root directory for offline installation of 
- packages.
-+.TP 
-+\fB\--add-dest <\fIname\fP>:<\fIpath\fP>\fR
-+Register \fIpath\fP as installation target \fIname\fP for use in
-+conjunction with \fB\--dest\fP
-+.TP 
-+\fB\--add-arch <\fIarch\fP>:<\fIprio\fP>\fR
-+Register the package architecture \fIarch\fP with the numeric
-+priority \fIprio\fP. Lower priorities take precedence.
- .SS FORCE OPTIONS
- .TP 
- \fB\--force-depends \fR
-@@ -148,6 +156,9 @@ Allow opkg-cl to downgrade packages
- \fB\--force-space \fR
- Disable free space checks
- .TP 
-+\fB\--force-postinstall \fR
-+Execute package postinstall scripts in offline installation mode
-+.TP 
- \fB\--noaction\fR
- No action \- test only
- .TP 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0564-mask-PFM_FOO-should-instead-be-mask-PFM_FOO.patch b/patches/opkg-0.1.8/0564-mask-PFM_FOO-should-instead-be-mask-PFM_FOO.patch
deleted file mode 100644
index a9d342b..0000000
--- a/patches/opkg-0.1.8/0564-mask-PFM_FOO-should-instead-be-mask-PFM_FOO.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From e85956a6700f6b6d66394a70d6c442e947b6a517 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Wed, 15 Sep 2010 00:05:24 +0000
-Subject: [PATCH] mask && PFM_FOO should instead be mask & PFM_FOO.
-
-From Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@564 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/pkg_parse.c |   17 ++++++++---------
- 1 files changed, 8 insertions(+), 9 deletions(-)
-
-diff --git a/libopkg/pkg_parse.c b/libopkg/pkg_parse.c
-index 2ce696f..5d08177 100644
---- a/libopkg/pkg_parse.c
-+++ b/libopkg/pkg_parse.c
-@@ -222,11 +222,11 @@ pkg_parse_line(pkg_t *pkg, const char *line, uint mask)
- 		break;
- 
- 	case 'I':
--		if ((mask && PFM_INSTALLED_SIZE) && is_field("Installed-Size", line)) {
-+		if ((mask & PFM_INSTALLED_SIZE) && is_field("Installed-Size", line)) {
- 			char *tmp = parse_simple("Installed-Size", line);
- 			pkg->installed_size = strtoul(tmp, NULL, 0);
- 			free (tmp);
--		} else if ((mask && PFM_INSTALLED_TIME) && is_field("Installed-Time", line)) {
-+		} else if ((mask & PFM_INSTALLED_TIME) && is_field("Installed-Time", line)) {
- 			char *tmp = parse_simple("Installed-Time", line);
- 			pkg->installed_time = strtoul(tmp, NULL, 0);
- 			free (tmp);
-@@ -234,14 +234,13 @@ pkg_parse_line(pkg_t *pkg, const char *line, uint mask)
- 		break;
- 
- 	case 'M':
--		if (mask && PFM_MD5SUM) {
--			if (is_field("MD5sum:", line))
--				pkg->md5sum = parse_simple("MD5sum", line);
-+		if ((mask & PFM_MD5SUM) && is_field("MD5sum:", line))
-+			pkg->md5sum = parse_simple("MD5sum", line);
- 			/* The old opkg wrote out status files with the wrong
- 			* case for MD5sum, let's parse it either way */
--			else if (is_field("MD5Sum:", line))
--				pkg->md5sum = parse_simple("MD5Sum", line);
--		} else if((mask & PFM_MAINTAINER) && is_field("Maintainer", line))
-+		else if ((mask & PFM_MD5SUM) && is_field("MD5Sum:", line)) 
-+			pkg->md5sum = parse_simple("MD5Sum", line);
-+		else if((mask & PFM_MAINTAINER) && is_field("Maintainer", line))
- 			pkg->maintainer = parse_simple("Maintainer", line);
- 		break;
- 
-@@ -301,7 +300,7 @@ pkg_parse_line(pkg_t *pkg, const char *line, uint mask)
- 			strcat(pkg->description, "\n");
- 			strcat(pkg->description, (line));
- 			goto dont_reset_flags;
--		} else if ((mask && PFM_CONFFILES) && reading_conffiles) {
-+		} else if ((mask & PFM_CONFFILES) && reading_conffiles) {
- 			parse_conffiles(pkg, line);
- 			goto dont_reset_flags;
- 		}
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0565-Use-uppercase-M-for-printing-maintainer-field-to-be-.patch b/patches/opkg-0.1.8/0565-Use-uppercase-M-for-printing-maintainer-field-to-be-.patch
deleted file mode 100644
index f78bd5a..0000000
--- a/patches/opkg-0.1.8/0565-Use-uppercase-M-for-printing-maintainer-field-to-be-.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 442cfaa9075c7cdc8839eee9efd6b0e1a662e982 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Wed, 15 Sep 2010 00:05:37 +0000
-Subject: [PATCH] Use uppercase M for printing maintainer field, to be consistent.
-
-From Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@565 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/pkg.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/pkg.c b/libopkg/pkg.c
-index 2e854a9..1606eaa 100644
---- a/libopkg/pkg.c
-+++ b/libopkg/pkg.c
-@@ -714,7 +714,7 @@ pkg_formatted_field(FILE *fp, pkg_t *pkg, const char *field)
-      case 'M':
- 	  if (strcasecmp(field, "Maintainer") == 0) {
- 	       if (pkg->maintainer) {
--                   fprintf(fp, "maintainer: %s\n", pkg->maintainer);
-+                   fprintf(fp, "Maintainer: %s\n", pkg->maintainer);
- 	       }
- 	  } else if (strcasecmp(field, "MD5sum") == 0) {
- 	       if (pkg->md5sum) {
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0566-Add-simple-regression-testing-code-and-tests-for-som.patch b/patches/opkg-0.1.8/0566-Add-simple-regression-testing-code-and-tests-for-som.patch
deleted file mode 100644
index 3d7a4d0..0000000
--- a/patches/opkg-0.1.8/0566-Add-simple-regression-testing-code-and-tests-for-som.patch
+++ /dev/null
@@ -1,547 +0,0 @@
-From 2ea9af9a660ccf765ab4cd3ef84affa7d77527d0 Mon Sep 17 00:00:00 2001
-From: graham.gower <graham.gower@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Wed, 15 Sep 2010 00:39:22 +0000
-Subject: [PATCH] Add simple regression testing code and tests for some issues.
-
-Written with python3 only because I was reading a tutorial and wanted
-to do something useful with it.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@566 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- tests/regress/cfg.py     |    3 +
- tests/regress/issue26.py |   35 +++++++++++++++++
- tests/regress/issue31.py |   25 ++++++++++++
- tests/regress/issue45.py |   33 ++++++++++++++++
- tests/regress/issue46.py |   39 +++++++++++++++++++
- tests/regress/issue50.py |   44 +++++++++++++++++++++
- tests/regress/issue51.py |   70 ++++++++++++++++++++++++++++++++++
- tests/regress/issue55.py |   25 ++++++++++++
- tests/regress/issue58.py |   31 +++++++++++++++
- tests/regress/opk.py     |   95 ++++++++++++++++++++++++++++++++++++++++++++++
- tests/regress/opkgcl.py  |   44 +++++++++++++++++++++
- 11 files changed, 444 insertions(+), 0 deletions(-)
- create mode 100644 tests/regress/cfg.py
- create mode 100755 tests/regress/issue26.py
- create mode 100755 tests/regress/issue31.py
- create mode 100755 tests/regress/issue45.py
- create mode 100755 tests/regress/issue46.py
- create mode 100755 tests/regress/issue50.py
- create mode 100755 tests/regress/issue51.py
- create mode 100755 tests/regress/issue55.py
- create mode 100755 tests/regress/issue58.py
- create mode 100644 tests/regress/opk.py
- create mode 100755 tests/regress/opkgcl.py
-
-diff --git a/tests/regress/cfg.py b/tests/regress/cfg.py
-new file mode 100644
-index 0000000..4304378
---- /dev/null
-+++ b/tests/regress/cfg.py
-@@ -0,0 +1,3 @@
-+opkdir = "/tmp/opk"
-+offline_root = "/tmp/opkg"
-+opkgcl = "/home/grg/opkg/code/svn/src/opkg-cl"
-diff --git a/tests/regress/issue26.py b/tests/regress/issue26.py
-new file mode 100755
-index 0000000..d7f2174
---- /dev/null
-+++ b/tests/regress/issue26.py
-@@ -0,0 +1,35 @@
-+#!/usr/bin/python3
-+
-+import os
-+import opk, cfg, opkgcl
-+
-+opk.regress_init()
-+
-+o = opk.OpkGroup()
-+o.add(Package="a", Version="2.0", Architecture="all")
-+o.write_opk()
-+o.write_list()
-+
-+# older version, not in Packages list
-+a1 = opk.Opk(Package="a", Version="1.0", Architecture="all")
-+a1.write()
-+
-+opkgcl.update()
-+
-+# install v2 from repository
-+opkgcl.install("a")
-+if not opkgcl.is_installed("a", "2.0"):
-+	print(__file__, ": Package 'a_2.0' not installed.")
-+	exit(False)
-+
-+opkgcl.install("a_1.0_all.opk", "--force-downgrade")
-+if not opkgcl.is_installed("a", "1.0"):
-+	print(__file__, ": Package 'a_1.0' not installed (1).")
-+	exit(False)
-+
-+opkgcl.install("a_1.0_all.opk", "--force-downgrade")
-+if not opkgcl.is_installed("a", "1.0"):
-+	print(__file__, ": Package 'a_1.0' not installed (2).")
-+	exit(False)
-+
-+opkgcl.remove("a")
-diff --git a/tests/regress/issue31.py b/tests/regress/issue31.py
-new file mode 100755
-index 0000000..ca00f67
---- /dev/null
-+++ b/tests/regress/issue31.py
-@@ -0,0 +1,25 @@
-+#!/usr/bin/python3
-+
-+import os
-+import opk, cfg, opkgcl
-+
-+opk.regress_init()
-+
-+o = opk.OpkGroup()
-+o.add(Package="a", Version="1.0", Architecture="all", Depends="b")
-+o.add(Package="b", Version="1.0", Architecture="all", Depends="c")
-+o.write_opk()
-+o.write_list()
-+
-+opkgcl.update()
-+
-+opkgcl.install("a")
-+if opkgcl.is_installed("a"):
-+	print(__file__, ": Package 'a' installed, despite dependency "
-+			"upon a package with an unresolved dependency.")
-+	exit(False)
-+
-+if opkgcl.is_installed("b"):
-+	print(__file__, ": Package 'b' installed, "
-+			"despite unresolved dependency.")
-+	exit(False)
-diff --git a/tests/regress/issue45.py b/tests/regress/issue45.py
-new file mode 100755
-index 0000000..3e4e147
---- /dev/null
-+++ b/tests/regress/issue45.py
-@@ -0,0 +1,33 @@
-+#!/usr/bin/python3
-+
-+import os
-+import opk, cfg, opkgcl
-+
-+opk.regress_init()
-+
-+o = opk.OpkGroup()
-+o.add(Package="a", Version="1.0", Architecture="all", Depends="b")
-+o.add(Package="b", Version="1.0", Architecture="all")
-+o.write_opk()
-+o.write_list()
-+
-+opkgcl.update()
-+
-+(status, output) = opkgcl.opkgcl("install a")
-+ln_a = output.find("Configuring a")
-+ln_b = output.find("Configuring b")
-+
-+if ln_a == -1:
-+	print(__file__, ": Didn't see package 'a' get configured.")
-+	exit(False)
-+
-+if ln_b == -1:
-+	print(__file__, ": Didn't see package 'b' get configured.")
-+	exit(False)
-+
-+if ln_a < ln_b:
-+	print(__file__, ": Packages 'a' and 'b' configured in wrong order.")
-+	exit(False)
-+
-+opkgcl.remove("a")
-+opkgcl.remove("b")
-diff --git a/tests/regress/issue46.py b/tests/regress/issue46.py
-new file mode 100755
-index 0000000..814b05d
---- /dev/null
-+++ b/tests/regress/issue46.py
-@@ -0,0 +1,39 @@
-+#!/usr/bin/python3
-+
-+import os
-+import opk, cfg, opkgcl
-+
-+opk.regress_init()
-+
-+o = opk.OpkGroup()
-+o.add(Package="a", Version="1.0", Architecture="all", Recommends="b")
-+o.add(Package="b", Version="2.0", Architecture="all")
-+o.write_opk()
-+o.write_list()
-+
-+# prime the status file so 'b' is not installed as a recommendation
-+status_filename = "{}/usr/lib/opkg/status".format(cfg.offline_root)
-+f = open(status_filename, "w")
-+f.write("Package: b\n")
-+f.write("Version: 1.0\n")
-+f.write("Architecture: all\n")
-+f.write("Status: deinstall hold not-installed\n")
-+f.close()
-+
-+opkgcl.update()
-+
-+opkgcl.install("a")
-+if opkgcl.is_installed("b"):
-+	print(__file__, ": Package 'b' installed despite "
-+					"deinstall/hold status.")
-+	exit(False)
-+
-+opkgcl.remove("a")
-+opkgcl.install("a")
-+if opkgcl.is_installed("b"):
-+	print(__file__, ": Package 'b' installed - deinstall/hold status "
-+					"not retained.")
-+	exit(False)
-+
-+opkgcl.remove("a")
-+open(status_filename, "w").close()
-diff --git a/tests/regress/issue50.py b/tests/regress/issue50.py
-new file mode 100755
-index 0000000..0ef4eae
---- /dev/null
-+++ b/tests/regress/issue50.py
-@@ -0,0 +1,44 @@
-+#!/usr/bin/python3
-+
-+import os
-+import opk, cfg, opkgcl
-+
-+opk.regress_init()
-+
-+open("foo", "w").close()
-+a1 = opk.Opk(Package="a", Version="1.0", Architecture="all")
-+a1.write(data_files=["foo"])
-+
-+exit()
-+opkgcl.install("a_1.0_all.opk")
-+
-+o = opk.OpkGroup()
-+a2 = opk.Opk(Package="a", Version="2.0", Architecture="all", Depends="b")
-+a2.write()
-+b1 = opk.Opk(Package="b", Version="1.0", Architecture="all")
-+b1.write(data_files=["foo"])
-+o.opk_list.append(a2)
-+o.opk_list.append(b1)
-+o.write_list()
-+
-+os.unlink("foo")
-+
-+opkgcl.update()
-+opkgcl.upgrade()
-+
-+if not opkgcl.is_installed("a", "2.0"):
-+	print(__file__, ": Package 'a_2.0' not installed.")
-+	exit(False)
-+
-+foo_fullpath = "{}/foo".format(cfg.offline_root)
-+
-+if not os.path.exists(foo_fullpath):
-+	print(__file__, ": File 'foo' incorrectly orphaned.")
-+	exit(False)
-+
-+if not foo_fullpath in opkgcl.files("b"):
-+	print(__file__, ": Package 'b' does not own file 'foo'.")
-+	exit(False)
-+
-+opkgcl.remove("a")
-+opkgcl.remove("b")
-diff --git a/tests/regress/issue51.py b/tests/regress/issue51.py
-new file mode 100755
-index 0000000..75803ed
---- /dev/null
-+++ b/tests/regress/issue51.py
-@@ -0,0 +1,70 @@
-+#!/usr/bin/python3
-+
-+import os
-+import opk, cfg, opkgcl
-+
-+opk.regress_init()
-+
-+open("foo", "w").close()
-+a1 = opk.Opk(Package="a", Version="1.0", Architecture="all")
-+a1.write(data_files=["foo"])
-+os.rename("a_1.0_all.opk", "a_with_foo.opk")
-+
-+opkgcl.install("a_with_foo.opk")
-+
-+# ----
-+opkgcl.install("a_with_foo.opk")
-+
-+open("bar", "w").close()
-+o = opk.OpkGroup()
-+a2 = opk.Opk(Package="a", Version="1.0", Architecture="all")
-+a2.write(data_files=["foo", "bar"])
-+o.opk_list.append(a2)
-+o.write_list()
-+
-+os.unlink("foo")
-+os.unlink("bar")
-+
-+opkgcl.update()
-+opkgcl.install("a", "--force-reinstall")
-+
-+foo_fullpath = "{}/foo".format(cfg.offline_root)
-+bar_fullpath = "{}/bar".format(cfg.offline_root)
-+
-+if not os.path.exists(foo_fullpath) or not os.path.exists(bar_fullpath):
-+	print(__file__, ": Files foo and/or bar are missing.")
-+	exit(False)
-+
-+a_files = opkgcl.files("a")
-+if not foo_fullpath in a_files or not bar_fullpath in a_files:
-+	print(__file__, ": Package 'a' does not own foo and/or bar.")
-+	exit(False)
-+
-+opkgcl.remove("a")
-+
-+if os.path.exists(foo_fullpath) or os.path.exists(bar_fullpath):
-+	print(__file__, ": Files foo and/or bar still exist "
-+				"after removal of package 'a'.")
-+	exit(False)
-+
-+# ----
-+o = opk.OpkGroup()
-+a2 = opk.Opk(Package="a", Version="1.0", Architecture="all")
-+a2.write()
-+o.opk_list.append(a2)
-+o.write_list()
-+
-+
-+opkgcl.update()
-+
-+opkgcl.install("a", "--force-reinstall")
-+
-+if os.path.exists(foo_fullpath):
-+	print(__file__, ": File 'foo' not orphaned as it should be.")
-+	exit(False)
-+
-+if foo_fullpath in opkgcl.files("a"):
-+	print(__file__, ": Package 'a' incorrectly owns file 'foo'.")
-+	exit(False)
-+
-+opkgcl.remove("a")
-diff --git a/tests/regress/issue55.py b/tests/regress/issue55.py
-new file mode 100755
-index 0000000..1a2763b
---- /dev/null
-+++ b/tests/regress/issue55.py
-@@ -0,0 +1,25 @@
-+#!/usr/bin/python3
-+
-+import os
-+import opk, cfg, opkgcl
-+
-+opk.regress_init()
-+
-+long_filename = 110*"a"
-+
-+os.symlink(long_filename, "linky")
-+a = opk.Opk(Package="a", Version="1.0", Architecture="all")
-+a.write(data_files=["linky"])
-+os.unlink("linky")
-+opkgcl.install("a_1.0_all.opk")
-+
-+if not opkgcl.is_installed("a"):
-+	print(__file__, ": Package 'a' not installed.")
-+	exit(False)
-+
-+if not os.path.lexists("{}/linky".format(cfg.offline_root)):
-+	print(__file__, ": symlink to file with a name longer than 100 "
-+					"characters not created.")
-+	exit(False)
-+
-+opkgcl.remove("a")
-diff --git a/tests/regress/issue58.py b/tests/regress/issue58.py
-new file mode 100755
-index 0000000..8635617
---- /dev/null
-+++ b/tests/regress/issue58.py
-@@ -0,0 +1,31 @@
-+#!/usr/bin/python3
-+
-+import os
-+import opk, cfg, opkgcl
-+
-+opk.regress_init()
-+
-+o = opk.OpkGroup()
-+o.add(Package="a", Version="1.0", Architecture="all", Recommends="b")
-+o.add(Package="b", Version="1.0", Architecture="all")
-+o.add(Package="c", Version="1.0", Architecture="all", Recommends="b")
-+o.write_opk()
-+o.write_list()
-+
-+opkgcl.update()
-+
-+opkgcl.install("a")
-+opkgcl.install("c")
-+
-+opkgcl.remove("a", "--autoremove")
-+if not opkgcl.is_installed("b"):
-+	print(__file__, ": Pacakge 'b' orphaned despite remaining "
-+			"recommending package 'c'.")
-+	exit(False)
-+
-+opkgcl.remove("c", "--autoremove")
-+if opkgcl.is_installed("b"):
-+	print(__file__, ": Recommended package 'b' not autoremoved.")
-+	exit(False)
-+
-+
-diff --git a/tests/regress/opk.py b/tests/regress/opk.py
-new file mode 100644
-index 0000000..616658a
---- /dev/null
-+++ b/tests/regress/opk.py
-@@ -0,0 +1,95 @@
-+import tarfile, os
-+import cfg
-+
-+class Opk:
-+	valid_control_fields = ["Package", "Version", "Depends", "Provides",\
-+			"Replaces", "Conflicts", "Suggests", "Recommends",\
-+			"Section", "Architecture", "Maintainer", "MD5Sum",\
-+			"Size", "InstalledSize", "Filename", "Source",\
-+			"Description", "OE", "Homepage", "Priority",\
-+			"Conffiles"]
-+
-+	def __init__(self, **control):
-+		for k in control.keys():
-+			if k not in self.valid_control_fields:
-+				raise Exception("Invalid control field: "
-+						"{}".format(k))
-+		self.control = control
-+
-+	def write(self, tar_not_ar=False, data_files=None):
-+		filename = "{Package}_{Version}_{Architecture}.opk"\
-+						.format(**self.control)
-+		if os.path.exists(filename):
-+			os.unlink(filename)
-+		if os.path.exists("control"):
-+			os.unlink("control")
-+		if os.path.exists("control.tar.gz"):
-+			os.unlink("control.tar.gz")
-+		if os.path.exists("data.tar.gz"):
-+			os.unlink("data.tar.gz")
-+
-+		f = open("control", "w")
-+		for k in self.control.keys():
-+			f.write("{}: {}\n".format(k, self.control[k]))
-+		f.close()
-+
-+		tar = tarfile.open("control.tar.gz", "w:gz")
-+		tar.add("control")
-+		tar.close()
-+
-+		tar = tarfile.open("data.tar.gz", "w:gz")
-+		if data_files:
-+			for df in data_files:
-+				tar.add(df)
-+		tar.close()
-+
-+
-+		if tar_not_ar:
-+			tar = tarfile.open(filename, "w:gz")
-+			tar.add("control.tar.gz")
-+			tar.add("data.tar.gz")
-+			tar.close()
-+		else:
-+			os.system("ar q {} control.tar.gz data.tar.gz \
-+					2>/dev/null".format(filename))
-+
-+		os.unlink("control")
-+		os.unlink("control.tar.gz")
-+		os.unlink("data.tar.gz")
-+
-+class OpkGroup:
-+	def __init__(self):
-+		self.opk_list = []
-+
-+	def add(self, **control):
-+		self.opk_list.append(Opk(**control))
-+	
-+	def write_opk(self, tar_not_ar=False):
-+		for o in self.opk_list:
-+			o.write(tar_not_ar)
-+
-+	def write_list(self, filename="Packages"):
-+		f = open(filename, "w")
-+		for opk in self.opk_list:
-+			for k in opk.control.keys():
-+				f.write("{}: {}\n".format(k, opk.control[k]))
-+			f.write("Filename: {Package}_{Version}_{Architecture}"
-+					".opk\n".format(**opk.control))
-+			f.write("\n")
-+		f.close()
-+
-+
-+def regress_init():
-+	"""
-+	Initialisation and sanity checking.
-+	"""
-+
-+	if not os.access(cfg.opkgcl, os.X_OK):
-+		print("Cannot exec {}".format(cfg.opkgcl))
-+		exit(False)
-+
-+	os.chdir(cfg.opkdir)
-+
-+	odir = "{}/usr/lib/opkg".format(cfg.offline_root)
-+	os.system("rm -fr {}".format(odir))
-+	os.mkdir(odir)
-diff --git a/tests/regress/opkgcl.py b/tests/regress/opkgcl.py
-new file mode 100755
-index 0000000..effc5c8
---- /dev/null
-+++ b/tests/regress/opkgcl.py
-@@ -0,0 +1,44 @@
-+#!/usr/bin/python3
-+
-+import os, subprocess
-+import cfg
-+
-+def opkgcl(opkg_args):
-+	cmd = "{} -o {} {}".format(cfg.opkgcl, cfg.offline_root, opkg_args)
-+	#print(cmd)
-+	return subprocess.getstatusoutput(cmd)
-+
-+def install(pkg_name, flags=""):
-+	return opkgcl("{} install {}".format(flags, pkg_name))[0]
-+
-+def remove(pkg_name, flags=""):
-+	return opkgcl("{} remove {}".format(flags, pkg_name))[0]
-+
-+def update():
-+	return opkgcl("update")[0]
-+
-+def upgrade():
-+	return opkgcl("upgrade")[0]
-+
-+def files(pkg_name):
-+	output = opkgcl("files {}".format(pkg_name))[1]
-+	return output.split("\n")[1:]
-+
-+
-+def is_installed(pkg_name, version=None):
-+	out = opkgcl("list_installed {}".format(pkg_name))[1]
-+	if len(out) == 0 or out.split()[0] != pkg_name:
-+		return False
-+	if version and out.split()[2] != version:
-+		return False
-+	if not os.path.exists("{}/usr/lib/opkg/info/{}.control"\
-+				.format(cfg.offline_root, pkg_name)):
-+		return False
-+	return True
-+
-+
-+if __name__ == '__main__':
-+	import sys
-+	(status, output) = opkgcl(" ".join(sys.argv[1:]))
-+	print(output)
-+	exit(status)
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0569-Disable-sha256-code-by-default.-This-makes-opkg-GPLv.patch b/patches/opkg-0.1.8/0569-Disable-sha256-code-by-default.-This-makes-opkg-GPLv.patch
deleted file mode 100644
index 5f914db..0000000
--- a/patches/opkg-0.1.8/0569-Disable-sha256-code-by-default.-This-makes-opkg-GPLv.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 05cc95d0a5d483210ef6b2da18d4ac19821a6a1e Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 20 Sep 2010 23:56:11 +0000
-Subject: [PATCH] Disable sha256 code by default. This makes opkg GPLv2 by default.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@569 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- configure.ac |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 907911b..ac5a035 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -66,8 +66,8 @@ fi
- # check for sha256
- AC_ARG_ENABLE(sha256,
-               AC_HELP_STRING([--enable-sha256], [Enable sha256sum check
--      [[default=yes]] ]),
--    [want_sha256="$enableval"], [want_sha256="yes"])
-+      (sha256.{c,h} are GPLv3 licensed) [[default=no]] ]),
-+    [want_sha256="$enableval"], [want_sha256="no"])
- 
- if test "x$want_sha256" = "xyes"; then
-   AC_DEFINE(HAVE_SHA256, 1, [Define if you want sha256 support])
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0570-Don-t-call-opkg_conf_deinit-if-opkg_conf_init-fails.patch b/patches/opkg-0.1.8/0570-Don-t-call-opkg_conf_deinit-if-opkg_conf_init-fails.patch
deleted file mode 100644
index af24961..0000000
--- a/patches/opkg-0.1.8/0570-Don-t-call-opkg_conf_deinit-if-opkg_conf_init-fails.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-From 578a78948bdeeb11351e22e6dd3edec790f37e19 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 21 Sep 2010 00:49:26 +0000
-Subject: [PATCH] Don't call opkg_conf_deinit() if opkg_conf_init() fails.
-
-Pointed out by Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@570 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg.c |   11 ++++++-----
- 1 files changed, 6 insertions(+), 5 deletions(-)
-
-diff --git a/libopkg/opkg.c b/libopkg/opkg.c
-index b36dc1b..1efefac 100644
---- a/libopkg/opkg.c
-+++ b/libopkg/opkg.c
-@@ -121,20 +121,21 @@ opkg_new()
- 		goto err0;
- 
- 	if (opkg_conf_load())
--		goto err0;
-+		goto err1;
- 
- 	if (pkg_hash_load_feeds())
--		goto err1;
-+		goto err2;
- 
- 	if (pkg_hash_load_status_files())
--		goto err1;
-+		goto err2;
- 
- 	return 0;
- 
--err1:
-+err2:
- 	pkg_hash_deinit();
--err0:
-+err1:
- 	opkg_conf_deinit();
-+err0:
- 	return -1;
- }
- 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0572-Revert-Don-t-call-opkg_conf_deinit-if-opkg_conf_init.patch b/patches/opkg-0.1.8/0572-Revert-Don-t-call-opkg_conf_deinit-if-opkg_conf_init.patch
deleted file mode 100644
index a1aa150..0000000
--- a/patches/opkg-0.1.8/0572-Revert-Don-t-call-opkg_conf_deinit-if-opkg_conf_init.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From b501406f5cd2f475b1f76ea02c42f3d530302bbe Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 21 Sep 2010 01:24:51 +0000
-Subject: [PATCH] Revert "Don't call opkg_conf_deinit() if opkg_conf_init() fails."
-
-This reverts commit 12e726ce863c221d32d20ba41242c2fcb798a909.
-
-I should pay more attention. This does not fix the problem.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@572 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg.c |   11 +++++------
- 1 files changed, 5 insertions(+), 6 deletions(-)
-
-diff --git a/libopkg/opkg.c b/libopkg/opkg.c
-index 1efefac..b36dc1b 100644
---- a/libopkg/opkg.c
-+++ b/libopkg/opkg.c
-@@ -121,21 +121,20 @@ opkg_new()
- 		goto err0;
- 
- 	if (opkg_conf_load())
--		goto err1;
-+		goto err0;
- 
- 	if (pkg_hash_load_feeds())
--		goto err2;
-+		goto err1;
- 
- 	if (pkg_hash_load_status_files())
--		goto err2;
-+		goto err1;
- 
- 	return 0;
- 
--err2:
--	pkg_hash_deinit();
- err1:
--	opkg_conf_deinit();
-+	pkg_hash_deinit();
- err0:
-+	opkg_conf_deinit();
- 	return -1;
- }
- 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0573-A-proper-fix-this-time.-From-Sergey-Jin-Bostandzhyan.patch b/patches/opkg-0.1.8/0573-A-proper-fix-this-time.-From-Sergey-Jin-Bostandzhyan.patch
deleted file mode 100644
index f734221..0000000
--- a/patches/opkg-0.1.8/0573-A-proper-fix-this-time.-From-Sergey-Jin-Bostandzhyan.patch
+++ /dev/null
@@ -1,109 +0,0 @@
-From a12def2ef9f33f024b5cda7f48fc794f48315a5d Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 21 Sep 2010 01:25:04 +0000
-Subject: [PATCH] A proper fix this time. From Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@573 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/file_util.c |    5 +++++
- libopkg/opkg_conf.c |   38 +++++++++++++++++++++++++++-----------
- 2 files changed, 32 insertions(+), 11 deletions(-)
-
-diff --git a/libopkg/file_util.c b/libopkg/file_util.c
-index cf5f774..897546e 100644
---- a/libopkg/file_util.c
-+++ b/libopkg/file_util.c
-@@ -238,6 +238,11 @@ rm_r(const char *path)
- 	DIR *dir;
- 	struct dirent *dent;
- 
-+	if (path == NULL) {
-+		opkg_perror(ERROR, "Missing directory parameter");
-+		return -1;
-+	}
-+
- 	dir = opendir(path);
- 	if (dir == NULL) {
- 		opkg_perror(ERROR, "Failed to open dir %s", path);
-diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
-index 22c99eb..9c1ed34 100644
---- a/libopkg/opkg_conf.c
-+++ b/libopkg/opkg_conf.c
-@@ -484,6 +484,11 @@ opkg_conf_load(void)
- 	else
- 		sprintf_alloc (&lock_file, "%s", OPKGLOCKFILE);
- 
-+	if (lock_file == NULL) {
-+		opkg_perror(ERROR, "Could not allocate memory for lock file name");
-+		goto err2;
-+	}
-+
- 	lock_fd = creat(lock_file, S_IRUSR | S_IWUSR | S_IRGRP);
- 	if (lock_fd == -1) {
- 		opkg_perror(ERROR, "Could not create lock file %s", lock_file);
-@@ -495,6 +500,7 @@ opkg_conf_load(void)
- 		if (close(lock_fd) == -1)
- 			opkg_perror(ERROR, "Couldn't close descriptor %d (%s)",
- 				lock_fd, lock_file);
-+		lock_fd = -1;
- 		goto err2;
- 	}
- 
-@@ -568,7 +574,10 @@ err3:
- 	if (unlink(lock_file) == -1)
- 		opkg_perror(ERROR, "Couldn't unlink %s", lock_file);
- err2:
--	free(lock_file);
-+	if (lock_file) {
-+		free(lock_file);
-+		lock_file = NULL;
-+	}
- err1:
- 	pkg_src_list_deinit(&conf->pkg_src_list);
- 	pkg_dest_list_deinit(&conf->pkg_dest_list);
-@@ -599,9 +608,11 @@ opkg_conf_deinit(void)
- 	int i;
- 	char **tmp;
- 
--	rm_r(conf->tmp_dir);
-+	if (conf->tmp_dir)
-+		rm_r(conf->tmp_dir);
- 
--	free(conf->lists_dir);
-+	if (conf->lists_dir)
-+		free(conf->lists_dir);
- 
- 	if (conf->dest_str)
- 		free(conf->dest_str);
-@@ -633,15 +644,20 @@ opkg_conf_deinit(void)
- 	hash_table_deinit(&conf->file_hash);
- 	hash_table_deinit(&conf->obs_file_hash);
- 
--	if (lockf(lock_fd, F_ULOCK, (off_t)0) == -1)
--		opkg_perror(ERROR, "Couldn't unlock %s", lock_file);
-+	if (lock_fd != -1) {
-+		if (lockf(lock_fd, F_ULOCK, (off_t)0) == -1)
-+			opkg_perror(ERROR, "Couldn't unlock %s", lock_file);
- 
--	if (close(lock_fd) == -1)
--		opkg_perror(ERROR, "Couldn't close descriptor %d (%s)",
--				lock_fd, lock_file);
-+		if (close(lock_fd) == -1)
-+			opkg_perror(ERROR, "Couldn't close descriptor %d (%s)",
-+					lock_fd, lock_file);
- 
--	if (unlink(lock_file) == -1)
--		opkg_perror(ERROR, "Couldn't unlink %s", lock_file);
-+	}
- 
--	free(lock_file);
-+	if (lock_file) {
-+		if (unlink(lock_file) == -1)
-+			opkg_perror(ERROR, "Couldn't unlink %s", lock_file);
-+
-+		free(lock_file);
-+	}
- }
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0574-Remove-dead-code-sprintf_alloc-cannot-fail.-Opkg-wil.patch b/patches/opkg-0.1.8/0574-Remove-dead-code-sprintf_alloc-cannot-fail.-Opkg-wil.patch
deleted file mode 100644
index a3fc567..0000000
--- a/patches/opkg-0.1.8/0574-Remove-dead-code-sprintf_alloc-cannot-fail.-Opkg-wil.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 3cfd512eeae8e66f159957888e38e749e368e302 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 21 Sep 2010 01:30:51 +0000
-Subject: [PATCH] Remove dead code, sprintf_alloc() cannot fail. Opkg will exit instead.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@574 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_conf.c |    5 -----
- 1 files changed, 0 insertions(+), 5 deletions(-)
-
-diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
-index 9c1ed34..acac1b4 100644
---- a/libopkg/opkg_conf.c
-+++ b/libopkg/opkg_conf.c
-@@ -484,11 +484,6 @@ opkg_conf_load(void)
- 	else
- 		sprintf_alloc (&lock_file, "%s", OPKGLOCKFILE);
- 
--	if (lock_file == NULL) {
--		opkg_perror(ERROR, "Could not allocate memory for lock file name");
--		goto err2;
--	}
--
- 	lock_fd = creat(lock_file, S_IRUSR | S_IWUSR | S_IRGRP);
- 	if (lock_fd == -1) {
- 		opkg_perror(ERROR, "Could not create lock file %s", lock_file);
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0576-Implement-list-changed-conffiles-command-based-on-pa.patch b/patches/opkg-0.1.8/0576-Implement-list-changed-conffiles-command-based-on-pa.patch
deleted file mode 100644
index d179db9..0000000
--- a/patches/opkg-0.1.8/0576-Implement-list-changed-conffiles-command-based-on-pa.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-From bef8b3ced498de337792a579af8f5536dae801b3 Mon Sep 17 00:00:00 2001
-From: google@wwsnet.net <google@wwsnet.net@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 5 Oct 2010 07:21:00 +0000
-Subject: [PATCH] Implement "list-changed-conffiles" command - based on patch by Yann Lopez <yann.lopez@gmail.com>.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@576 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_cmd.c |   35 +++++++++++++++++++++++++++++++++++
- man/opkg-cl.1.in   |    3 +++
- src/opkg-cl.c      |    3 +++
- 3 files changed, 41 insertions(+), 0 deletions(-)
-
-diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
-index affa0f7..584d05d 100644
---- a/libopkg/opkg_cmd.c
-+++ b/libopkg/opkg_cmd.c
-@@ -617,6 +617,39 @@ opkg_list_installed_cmd(int argc, char **argv)
- }
- 
- static int
-+opkg_list_changed_conffiles_cmd(int argc, char **argv)
-+{
-+     int i ;
-+     pkg_vec_t *available;
-+     pkg_t *pkg;
-+     char *pkg_name = NULL;
-+     conffile_list_elt_t *iter;
-+     conffile_t *cf;
-+
-+     if (argc > 0) {
-+	  pkg_name = argv[0];
-+     }
-+     available = pkg_vec_alloc();
-+     pkg_hash_fetch_all_installed(available);
-+     pkg_vec_sort(available, pkg_compare_names);
-+     for (i=0; i < available->len; i++) {
-+	  pkg = available->pkgs[i];
-+	  /* if we have package name or pattern and pkg does not match, then skip it */
-+	  if (pkg_name && fnmatch(pkg_name, pkg->name, 0))
-+	    continue;
-+	  if (nv_pair_list_empty(&pkg->conffiles))
-+	    continue;
-+	  for (iter = nv_pair_list_first(&pkg->conffiles); iter; iter = nv_pair_list_next(&pkg->conffiles, iter)) {
-+	    cf = (conffile_t *)iter->data;
-+	    if (cf->name && cf->value && conffile_has_been_modified(cf))
-+	      printf("%s\n", cf->name);
-+	  }
-+     }
-+     pkg_vec_free(available);
-+     return 0;
-+}
-+
-+static int
- opkg_list_upgradable_cmd(int argc, char **argv)
- {
-     struct active_list *head = prepare_upgrade_list();
-@@ -1188,6 +1221,8 @@ static opkg_cmd_t cmds[] = {
-      {"list-installed", 0, (opkg_cmd_fun_t)opkg_list_installed_cmd, PFM_SOURCE},
-      {"list_upgradable", 0, (opkg_cmd_fun_t)opkg_list_upgradable_cmd, PFM_SOURCE},
-      {"list-upgradable", 0, (opkg_cmd_fun_t)opkg_list_upgradable_cmd, PFM_SOURCE},
-+     {"list_changed_conffiles", 0, (opkg_cmd_fun_t)opkg_list_changed_conffiles_cmd, PFM_SOURCE},
-+     {"list-changed-conffiles", 0, (opkg_cmd_fun_t)opkg_list_changed_conffiles_cmd, PFM_SOURCE},
-      {"info", 0, (opkg_cmd_fun_t)opkg_info_cmd, 0},
-      {"flag", 1, (opkg_cmd_fun_t)opkg_flag_cmd, PFM_DESCRIPTION|PFM_SOURCE},
-      {"status", 0, (opkg_cmd_fun_t)opkg_status_cmd, PFM_DESCRIPTION|PFM_SOURCE},
-diff --git a/man/opkg-cl.1.in b/man/opkg-cl.1.in
-index d15e985..2bfb792 100644
---- a/man/opkg-cl.1.in
-+++ b/man/opkg-cl.1.in
-@@ -52,6 +52,9 @@ List installed packages
- \fBlist-upgradable\fR
- List installed and upgradable packages
- .TP
-+\fBlist-changed-conffiles\fR
-+List package configuration files which have been modified after installation
-+.TP
- \fBfiles <\fIpackage\fP>\fR
- List files belonging to \fIpackage\fP
- .TP
-diff --git a/src/opkg-cl.c b/src/opkg-cl.c
-index ebaa3d0..bf123cd 100644
---- a/src/opkg-cl.c
-+++ b/src/opkg-cl.c
-@@ -225,6 +225,7 @@ usage()
- 	printf("\tlist			List available packages\n");
- 	printf("\tlist-installed		List installed packages\n");
- 	printf("\tlist-upgradable		List installed and upgradable packages\n");
-+	printf("\tlist-changed-conffiles	List user modified configuration files\n");
- 	printf("\tfiles <pkg>		List files belonging to <pkg>\n");
- 	printf("\tsearch <file|regexp>	List package providing <file>\n");
- 	printf("\tinfo [pkg|regexp]	Display all info for <pkg>\n");
-@@ -328,6 +329,8 @@ main(int argc, char *argv[])
- 	    !strcmp(cmd_name,"compare-versions") ||
- 	    !strcmp(cmd_name,"list_installed") ||
- 	    !strcmp(cmd_name,"list-installed") ||
-+	    !strcmp(cmd_name,"list_changed_conffiles") ||
-+	    !strcmp(cmd_name,"list-changed-conffiles") ||
- 	    !strcmp(cmd_name,"status") )
- 		noreadfeedsfile = 1;
- 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0577-Remove-an-erroneous-comment.patch b/patches/opkg-0.1.8/0577-Remove-an-erroneous-comment.patch
deleted file mode 100644
index 75272fc..0000000
--- a/patches/opkg-0.1.8/0577-Remove-an-erroneous-comment.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 3a7c004560907c3acf4d7d330a9af8ef6309fa09 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 11 Nov 2010 00:23:29 +0000
-Subject: [PATCH] Remove an erroneous comment.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@577 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libbb/unzip.c |    1 -
- 1 files changed, 0 insertions(+), 1 deletions(-)
-
-diff --git a/libbb/unzip.c b/libbb/unzip.c
-index 472ffba..435effb 100644
---- a/libbb/unzip.c
-+++ b/libbb/unzip.c
-@@ -51,7 +51,6 @@
- 
- static FILE *in_file, *out_file;
- 
--/* these are freed by gz_close */
- static unsigned char *window;
- static unsigned long *crc_table = NULL;
- 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0578-This-is-not-a-bug-any-longer.patch b/patches/opkg-0.1.8/0578-This-is-not-a-bug-any-longer.patch
deleted file mode 100644
index a25140b..0000000
--- a/patches/opkg-0.1.8/0578-This-is-not-a-bug-any-longer.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 039e4e5e6dbc0dde28dbd958078abc15c1c0d8b2 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 15 Nov 2010 22:47:14 +0000
-Subject: [PATCH] This is not a bug any longer.
-
-It was fixed long ago, as is clear by the code in question.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@578 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_download.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/opkg_download.c b/libopkg/opkg_download.c
-index e84340a..b1f009f 100644
---- a/libopkg/opkg_download.c
-+++ b/libopkg/opkg_download.c
-@@ -252,7 +252,7 @@ opkg_download_pkg(pkg_t *pkg, const char *dir)
- 
-     sprintf_alloc(&url, "%s/%s", pkg->src->value, pkg->filename);
- 
--    /* XXX: BUG: The pkg->filename might be something like
-+    /* The pkg->filename might be something like
-        "../../foo.opk". While this is correct, and exactly what we
-        want to use to construct url above, here we actually need to
-        use just the filename part, without any directory. */
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0579-opkg_find_package-should-not-return-garbage-if-it-ca.patch b/patches/opkg-0.1.8/0579-opkg_find_package-should-not-return-garbage-if-it-ca.patch
deleted file mode 100644
index 0e5b70b..0000000
--- a/patches/opkg-0.1.8/0579-opkg_find_package-should-not-return-garbage-if-it-ca.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From dcb875bea220d4eddd6b398046e91d3781083fe6 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 15 Nov 2010 22:47:28 +0000
-Subject: [PATCH] opkg_find_package() should not return garbage if it cannot find the package.
-
-From juliosao via Issue #69.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@579 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg.c |    4 +++-
- 1 files changed, 3 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/opkg.c b/libopkg/opkg.c
-index b36dc1b..6d97789 100644
---- a/libopkg/opkg.c
-+++ b/libopkg/opkg.c
-@@ -778,6 +778,7 @@ pkg_t *
- opkg_find_package(const char *name, const char *ver, const char *arch,
- 		const char *repo)
- {
-+	int pkg_found = 0;
- 	pkg_t *pkg = NULL;
- 	pkg_vec_t *all;
- 	int i;
-@@ -815,12 +816,13 @@ opkg_find_package(const char *name, const char *ver, const char *arch,
- 		}
- 
- 		/* match found */
-+		pkg_found = 1;
- 		break;
- 	}
- 
- 	pkg_vec_free(all);
- 
--	return pkg;
-+	return pkg_found ? pkg : NULL;
- }
- 
- /**
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0580-Fix-indentation.patch b/patches/opkg-0.1.8/0580-Fix-indentation.patch
deleted file mode 100644
index ce39506..0000000
--- a/patches/opkg-0.1.8/0580-Fix-indentation.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-From 6ee4d7075a8d19f1b465bd2d222a182c1d8345e7 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Fri, 19 Nov 2010 03:55:38 +0000
-Subject: [PATCH] Fix indentation.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@580 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/sprintf_alloc.c |   66 +++++++++++++++++++++++-----------------------
- 1 files changed, 33 insertions(+), 33 deletions(-)
-
-diff --git a/libopkg/sprintf_alloc.c b/libopkg/sprintf_alloc.c
-index 03a5f27..08c56bf 100644
---- a/libopkg/sprintf_alloc.c
-+++ b/libopkg/sprintf_alloc.c
-@@ -22,44 +22,44 @@
- 
- int sprintf_alloc(char **str, const char *fmt, ...)
- {
--    va_list ap;
--    int n;
--    unsigned size = 100;
-+	va_list ap;
-+	int n;
-+	unsigned size = 100;
- 
--    if (!str) {
--      opkg_msg(ERROR, "Internal error: str=NULL.\n");
--      return -1;
--    }
--    if (!fmt) {
--      opkg_msg(ERROR, "Internal error: fmt=NULL.\n");
--      return -1;
--    }
-+	if (!str) {
-+		opkg_msg(ERROR, "Internal error: str=NULL.\n");
-+		return -1;
-+	}
-+	if (!fmt) {
-+		opkg_msg(ERROR, "Internal error: fmt=NULL.\n");
-+		return -1;
-+	}
- 
--    /* On x86_64 systems, any strings over 100 were segfaulting.
--       It seems that the ap needs to be reinitalized before every
--       use of the v*printf() functions. I pulled the functionality out
--       of vsprintf_alloc and combined it all here instead.
--    */
-+	/* On x86_64 systems, any strings over 100 were segfaulting.
-+	   It seems that the ap needs to be reinitalized before every
-+	   use of the v*printf() functions. I pulled the functionality out
-+	   of vsprintf_alloc and combined it all here instead.
-+	*/
- 
- 
--    /* ripped more or less straight out of PRINTF(3) */
-+	/* ripped more or less straight out of PRINTF(3) */
- 
--    *str = xcalloc(1, size);
-+	*str = xcalloc(1, size);
- 
--    while(1) {
--      va_start(ap, fmt);
--      n = vsnprintf (*str, size, fmt, ap);
--      va_end(ap);
--      /* If that worked, return the size. */
--      if (n > -1 && n < size)
--	return n;
--	/* Else try again with more space. */
--	if (n > -1)    /* glibc 2.1 */
--	    size = n+1; /* precisely what is needed */
--	else           /* glibc 2.0 */
--	    size *= 2;  /* twice the old size */
--	*str = xrealloc(*str, size);
--    }
-+	while (1) {
-+		va_start(ap, fmt);
-+		n = vsnprintf (*str, size, fmt, ap);
-+		va_end(ap);
-+		/* If that worked, return the size. */
-+		if (n > -1 && n < size)
-+			return n;
-+		/* Else try again with more space. */
-+		if (n > -1)    /* glibc 2.1 */
-+			size = n+1; /* precisely what is needed */
-+		else           /* glibc 2.0 */
-+			size *= 2;  /* twice the old size */
-+		*str = xrealloc(*str, size);
-+	}
- 
--    return -1; /* Just to be correct - it probably won't get here */
-+	return -1; /* Just to be correct - it probably won't get here */
- }
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0581-Rewrite-sprintf_alloc.patch b/patches/opkg-0.1.8/0581-Rewrite-sprintf_alloc.patch
deleted file mode 100644
index 5cec221..0000000
--- a/patches/opkg-0.1.8/0581-Rewrite-sprintf_alloc.patch
+++ /dev/null
@@ -1,111 +0,0 @@
-From 7e8e45766b6fbf8c3ea443646af259f2943e4ef2 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Fri, 19 Nov 2010 03:55:52 +0000
-Subject: [PATCH] Rewrite sprintf_alloc.
-
-The example in printf(3) that this was taken from should not be used as
-it ignores negative return codes from vsnprintf, instead allocating more
-memory. Given an error from vsnprintf, this would loop until the process'
-virtual memory is exhausted.
-
-So we just exit in the event of a problem instead.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@581 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/sprintf_alloc.c |   52 ++++++++++++++++------------------------------
- libopkg/sprintf_alloc.h |    2 +-
- 2 files changed, 19 insertions(+), 35 deletions(-)
-
-diff --git a/libopkg/sprintf_alloc.c b/libopkg/sprintf_alloc.c
-index 08c56bf..e2513ec 100644
---- a/libopkg/sprintf_alloc.c
-+++ b/libopkg/sprintf_alloc.c
-@@ -1,8 +1,6 @@
- /* sprintf_alloc.c -- like sprintf with memory allocation
- 
--   Carl D. Worth
--
--   Copyright (C) 2001 University of Southern California
-+   Copyright (C) 2010 Ubiq Technologies <graham.gower@gmail.com>
- 
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-@@ -20,46 +18,32 @@
- #include "sprintf_alloc.h"
- #include "libbb/libbb.h"
- 
--int sprintf_alloc(char **str, const char *fmt, ...)
-+void
-+sprintf_alloc(char **str, const char *fmt, ...)
- {
- 	va_list ap;
- 	int n;
--	unsigned size = 100;
--
--	if (!str) {
--		opkg_msg(ERROR, "Internal error: str=NULL.\n");
--		return -1;
--	}
--	if (!fmt) {
--		opkg_msg(ERROR, "Internal error: fmt=NULL.\n");
--		return -1;
--	}
--
--	/* On x86_64 systems, any strings over 100 were segfaulting.
--	   It seems that the ap needs to be reinitalized before every
--	   use of the v*printf() functions. I pulled the functionality out
--	   of vsprintf_alloc and combined it all here instead.
--	*/
--
--
--	/* ripped more or less straight out of PRINTF(3) */
-+	unsigned int size = 1;
- 
- 	*str = xcalloc(1, size);
- 
--	while (1) {
-+	for (;;) {
- 		va_start(ap, fmt);
- 		n = vsnprintf (*str, size, fmt, ap);
- 		va_end(ap);
--		/* If that worked, return the size. */
--		if (n > -1 && n < size)
--			return n;
--		/* Else try again with more space. */
--		if (n > -1)    /* glibc 2.1 */
--			size = n+1; /* precisely what is needed */
--		else           /* glibc 2.0 */
--			size *= 2;  /* twice the old size */
-+
-+		if (n < 0) {
-+			fprintf(stderr, "%s: encountered an output or encoding"
-+					" error during vsnprintf.\n",
-+					__FUNCTION__);
-+			exit(EXIT_FAILURE);
-+		}
-+
-+		if (n < size)
-+			break;
-+
-+		/* Truncated, try again with more space. */
-+		size = n+1;
- 		*str = xrealloc(*str, size);
- 	}
--
--	return -1; /* Just to be correct - it probably won't get here */
- }
-diff --git a/libopkg/sprintf_alloc.h b/libopkg/sprintf_alloc.h
-index 3d68d69..bcf42a4 100644
---- a/libopkg/sprintf_alloc.h
-+++ b/libopkg/sprintf_alloc.h
-@@ -18,6 +18,6 @@
- #ifndef SPRINTF_ALLOC_H
- #define SPRINTF_ALLOC_H
- 
--int sprintf_alloc(char **str, const char *fmt, ...);
-+void sprintf_alloc(char **str, const char *fmt, ...);
- 
- #endif
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0582-Check-return-codes-from-vsnprintf-and-vfprintf.patch b/patches/opkg-0.1.8/0582-Check-return-codes-from-vsnprintf-and-vfprintf.patch
deleted file mode 100644
index 35be6de..0000000
--- a/patches/opkg-0.1.8/0582-Check-return-codes-from-vsnprintf-and-vfprintf.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 1c98b4bd7f1e6c7ec10f006b39b5bab96fa1149f Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Fri, 19 Nov 2010 03:56:06 +0000
-Subject: [PATCH] Check return codes from vsnprintf and vfprintf.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@582 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_message.c |   23 +++++++++++++++++++----
- 1 files changed, 19 insertions(+), 4 deletions(-)
-
-diff --git a/libopkg/opkg_message.c b/libopkg/opkg_message.c
-index e5324e6..7114e3a 100644
---- a/libopkg/opkg_message.c
-+++ b/libopkg/opkg_message.c
-@@ -94,13 +94,28 @@ opkg_message (message_level_t level, const char *fmt, ...)
- 	if (level == ERROR) {
- #define MSG_LEN 4096
- 		char msg[MSG_LEN];
--		if (vsnprintf(msg, MSG_LEN, fmt, ap) >= MSG_LEN) {
--			fprintf(stderr, "%s: Message truncated!\n",
-+		int ret;
-+		ret = vsnprintf(msg, MSG_LEN, fmt, ap);
-+		if (ret < 0) {
-+			fprintf(stderr, "%s: encountered an output or encoding"
-+					" error during vsnprintf.\n",
-+					__FUNCTION__);
-+			va_end (ap);
-+			exit(EXIT_FAILURE);
-+		}
-+		if (ret >= MSG_LEN) {
-+			fprintf(stderr, "%s: Message truncated.\n",
- 					__FUNCTION__);
- 		}
- 		push_error_list(msg);
--	} else
--		vprintf(fmt, ap);
-+	} else {
-+		if (vprintf(fmt, ap) < 0) {
-+			fprintf(stderr, "%s: encountered an output or encoding"
-+					" error during vprintf.\n",
-+					__FUNCTION__);
-+			exit(EXIT_FAILURE);
-+		}
-+	}
- 
- 	va_end (ap);
- }
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0583-Remove-an-unnecessary-allocation.patch b/patches/opkg-0.1.8/0583-Remove-an-unnecessary-allocation.patch
deleted file mode 100644
index 0d45e04..0000000
--- a/patches/opkg-0.1.8/0583-Remove-an-unnecessary-allocation.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From f8980c8d1dd162031290602cb3d494d617ff51ba Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Fri, 19 Nov 2010 04:30:47 +0000
-Subject: [PATCH] Remove an unnecessary allocation.
-
-According to SUS3:
-If the value of n is zero on a call to snprintf(), nothing shall be written, the number of bytes that would have been written had n been sufficiently large excluding the terminating null shall be returned, and s may be a null pointer.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@583 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/sprintf_alloc.c |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/libopkg/sprintf_alloc.c b/libopkg/sprintf_alloc.c
-index e2513ec..aef8e06 100644
---- a/libopkg/sprintf_alloc.c
-+++ b/libopkg/sprintf_alloc.c
-@@ -23,9 +23,9 @@ sprintf_alloc(char **str, const char *fmt, ...)
- {
- 	va_list ap;
- 	int n;
--	unsigned int size = 1;
-+	unsigned int size = 0;
- 
--	*str = xcalloc(1, size);
-+	*str = NULL;
- 
- 	for (;;) {
- 		va_start(ap, fmt);
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0584-Use-printf-format-specifier-attribute-for-opkg_messa.patch b/patches/opkg-0.1.8/0584-Use-printf-format-specifier-attribute-for-opkg_messa.patch
deleted file mode 100644
index 5c6ebe0..0000000
--- a/patches/opkg-0.1.8/0584-Use-printf-format-specifier-attribute-for-opkg_messa.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From a91236f83d1777cf9dd94c709f0a974b173c7b8b Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Fri, 19 Nov 2010 06:19:11 +0000
-Subject: [PATCH] Use printf format specifier attribute for opkg_message().
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@584 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_message.h |    3 ++-
- 1 files changed, 2 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/opkg_message.h b/libopkg/opkg_message.h
-index 62a6b83..4fa2a0b 100644
---- a/libopkg/opkg_message.h
-+++ b/libopkg/opkg_message.h
-@@ -30,7 +30,8 @@ typedef enum {
- 
- void free_error_list(void);
- void print_error_list(void);
--void opkg_message(message_level_t level, const char *fmt, ...);
-+void opkg_message(message_level_t level, const char *fmt, ...)
-+				__attribute__ ((format (printf, 2, 3)));
- 
- #define opkg_msg(l, fmt, args...) \
- 	do { \
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0585-Fix-formatting-issues-found-with-the-last-commit.patch b/patches/opkg-0.1.8/0585-Fix-formatting-issues-found-with-the-last-commit.patch
deleted file mode 100644
index b96c251..0000000
--- a/patches/opkg-0.1.8/0585-Fix-formatting-issues-found-with-the-last-commit.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 78ec74138a1bc08d8c130f9e38a9d851db3b74a7 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Fri, 19 Nov 2010 06:19:25 +0000
-Subject: [PATCH] Fix formatting issues found with the last commit.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@585 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_install.c |    4 ++--
- libopkg/opkg_remove.c  |    2 +-
- libopkg/pkg.c          |    2 +-
- 3 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
-index eaa1edc..68c17b3 100644
---- a/libopkg/opkg_install.c
-+++ b/libopkg/opkg_install.c
-@@ -204,8 +204,8 @@ verify_pkg_installable(pkg_t *pkg)
- 	pkg_size_kbs = (pkg->installed_size + 1023)/1024;
- 
- 	if (pkg_size_kbs >= kbs_available) {
--		opkg_msg(ERROR, "Only have %dkb available on filesystem %s, "
--			"pkg %s needs %d\n",
-+		opkg_msg(ERROR, "Only have %ldkb available on filesystem %s, "
-+			"pkg %s needs %ld\n",
- 			kbs_available, root_dir, pkg->name, pkg_size_kbs);
- 		return -1;
- 	}
-diff --git a/libopkg/opkg_remove.c b/libopkg/opkg_remove.c
-index 1ed2dab..e2a63e1 100644
---- a/libopkg/opkg_remove.c
-+++ b/libopkg/opkg_remove.c
-@@ -363,7 +363,7 @@ remove_data_files_and_list(pkg_t *pkg)
- 	  }
- 
- 	  if (!conf->noaction) {
--	  	opkg_msg(INFO, "Deleting %s.\n", file_name, conf->noaction);
-+	  	opkg_msg(INFO, "Deleting %s.\n", file_name);
- 	       unlink(file_name);
- 	  } else
- 	  	opkg_msg(INFO, "Not deleting %s. (noaction)\n",
-diff --git a/libopkg/pkg.c b/libopkg/pkg.c
-index 1606eaa..235741e 100644
---- a/libopkg/pkg.c
-+++ b/libopkg/pkg.c
-@@ -462,7 +462,7 @@ set_flags_from_control(pkg_t *pkg){
- 
-      fp = fopen(file_name, "r");
-      if (fp == NULL) {
--	     opkg_perror(ERROR, "Failed to open %s");
-+	     opkg_perror(ERROR, "Failed to open %s", file_name);
- 	     free(file_name);
- 	     return;
-      }
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0586-Print-the-package-name-corresponding-to-a-failed-scr.patch b/patches/opkg-0.1.8/0586-Print-the-package-name-corresponding-to-a-failed-scr.patch
deleted file mode 100644
index f769ad0..0000000
--- a/patches/opkg-0.1.8/0586-Print-the-package-name-corresponding-to-a-failed-scr.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 970666583189a1f2712c1baa0b8b6a40a9b71b75 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 22 Nov 2010 23:48:31 +0000
-Subject: [PATCH] Print the package name corresponding to a failed script.
-
-From Sergey 'Jin' Bostandzhyan.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@586 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/pkg.c |    3 ++-
- 1 files changed, 2 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/pkg.c b/libopkg/pkg.c
-index 235741e..265f554 100644
---- a/libopkg/pkg.c
-+++ b/libopkg/pkg.c
-@@ -1299,7 +1299,8 @@ pkg_run_script(pkg_t *pkg, const char *script, const char *args)
-      free(cmd);
- 
-      if (err) {
--	  opkg_msg(ERROR, "%s script returned status %d.\n", script, err);
-+	  opkg_msg(ERROR, "package \"%s\" %s script returned status %d.\n", 
-+               pkg->name, script, err);
- 	  return err;
-      }
- 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0587-Abort-package-removal-if-the-prerm-script-of-a-packa.patch b/patches/opkg-0.1.8/0587-Abort-package-removal-if-the-prerm-script-of-a-packa.patch
deleted file mode 100644
index 2cc0184..0000000
--- a/patches/opkg-0.1.8/0587-Abort-package-removal-if-the-prerm-script-of-a-packa.patch
+++ /dev/null
@@ -1,147 +0,0 @@
-From 76282e2441864414fc7548ca5685de5d4dc29c6c Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Wed, 24 Nov 2010 00:01:35 +0000
-Subject: [PATCH] Abort package removal if the prerm script of a package returns non zero.
-
-This can be overridden with --force-remove.
-Also, improve propagation of errors up the call stack for related errors.
-
-From Sergey 'Jin' Bostandzhyan.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@587 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_conf.h   |    1 +
- libopkg/opkg_remove.c |   30 ++++++++++++++++++++++--------
- src/opkg-cl.c         |    7 +++++++
- 3 files changed, 30 insertions(+), 8 deletions(-)
-
-diff --git a/libopkg/opkg_conf.h b/libopkg/opkg_conf.h
-index 0b163b0..af6b9ab 100644
---- a/libopkg/opkg_conf.h
-+++ b/libopkg/opkg_conf.h
-@@ -75,6 +75,7 @@ struct opkg_conf
-      int force_removal_of_dependent_packages;
-      int force_removal_of_essential_packages;
-      int force_postinstall;
-+     int force_remove;
-      int check_signature;
-      int nodeps; /* do not follow dependencies */
-      char *offline_root;
-diff --git a/libopkg/opkg_remove.c b/libopkg/opkg_remove.c
-index e2a63e1..c6f2e37 100644
---- a/libopkg/opkg_remove.c
-+++ b/libopkg/opkg_remove.c
-@@ -170,6 +170,7 @@ static int
- remove_autoinstalled(pkg_t *pkg)
- {
- 	int i, j;
-+	int err = 0;
- 	int n_deps;
- 	pkg_t *p;
- 	struct compound_depend *cdep;
-@@ -205,7 +206,9 @@ remove_autoinstalled(pkg_t *pkg)
- 				 opkg_msg(NOTICE, "%s was autoinstalled and is "
- 					       "now orphaned, removing.\n",
- 					       p->name);
--			         opkg_remove_pkg(p, 0);
-+				if (opkg_remove_pkg(p, 0) != 0) {
-+					err = -1;
-+				}
- 			} else
- 				opkg_msg(INFO, "%s was autoinstalled and is "
- 						"still required by %d "
-@@ -217,7 +220,7 @@ remove_autoinstalled(pkg_t *pkg)
- 		}
- 	}
- 
--	return 0;
-+	return err;
- }
- 
- int
-@@ -291,7 +294,16 @@ opkg_remove_pkg(pkg_t *pkg, int from_upgrade)
-      pkg->state_want = SW_DEINSTALL;
-      opkg_state_changed++;
- 
--     pkg_run_script(pkg, "prerm", "remove");
-+     if (pkg_run_script(pkg, "prerm", "remove") != 0) {
-+         if (!conf->force_remove) {
-+             opkg_msg(ERROR, "not removing package \"%s\", "
-+                             "prerm script failed\n", pkg->name);
-+             opkg_msg(NOTICE, "You can force removal of packages with failed "
-+                              "prerm scripts with the option: \n"
-+                              "\t--force-remove\n");
-+             return -1;
-+         }
-+     }
- 
-      /* DPKG_INCOMPATIBILITY: dpkg is slightly different here. It
- 	maintains an empty filelist rather than deleting it. That seems
-@@ -300,7 +312,7 @@ opkg_remove_pkg(pkg_t *pkg, int from_upgrade)
- 	feel free to fix this. */
-      remove_data_files_and_list(pkg);
- 
--     pkg_run_script(pkg, "postrm", "remove");
-+     err = pkg_run_script(pkg, "postrm", "remove");
- 
-      remove_maintainer_scripts(pkg);
-      pkg->state_status = SS_NOT_INSTALLED;
-@@ -309,10 +321,12 @@ opkg_remove_pkg(pkg_t *pkg, int from_upgrade)
- 	  parent_pkg->state_status = SS_NOT_INSTALLED;
- 
-      /* remove autoinstalled packages that are orphaned by the removal of this one */
--     if (conf->autoremove)
--       remove_autoinstalled(pkg);
--
--     return 0;
-+     if (conf->autoremove) {
-+         if (remove_autoinstalled(pkg) != 0) {
-+             err = -1;
-+         }
-+     }
-+     return err;
- }
- 
- void
-diff --git a/src/opkg-cl.c b/src/opkg-cl.c
-index bf123cd..5b72050 100644
---- a/src/opkg-cl.c
-+++ b/src/opkg-cl.c
-@@ -40,6 +40,7 @@ enum {
- 	ARGS_OPT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES,
- 	ARGS_OPT_FORCE_SPACE,
- 	ARGS_OPT_FORCE_POSTINSTALL,
-+	ARGS_OPT_FORCE_REMOVE,
- 	ARGS_OPT_ADD_ARCH,
- 	ARGS_OPT_ADD_DEST,
- 	ARGS_OPT_NOACTION,
-@@ -79,6 +80,8 @@ static struct option long_options[] = {
- 		ARGS_OPT_FORCE_REMOVAL_OF_ESSENTIAL_PACKAGES},
- 	{"force-postinstall", 0, 0, ARGS_OPT_FORCE_POSTINSTALL},
- 	{"force_postinstall", 0, 0, ARGS_OPT_FORCE_POSTINSTALL},
-+	{"force-remove", 0, 0, ARGS_OPT_FORCE_REMOVE},
-+	{"force_remove", 0, 0, ARGS_OPT_FORCE_REMOVE},
- 	{"noaction", 0, 0, ARGS_OPT_NOACTION},
- 	{"download-only", 0, 0, ARGS_OPT_DOWNLOAD_ONLY},
- 	{"nodeps", 0, 0, ARGS_OPT_NODEPS},
-@@ -166,6 +169,9 @@ args_parse(int argc, char *argv[])
- 		case ARGS_OPT_FORCE_POSTINSTALL:
- 			conf->force_postinstall = 1;
- 			break;
-+		case ARGS_OPT_FORCE_REMOVE:
-+			conf->force_remove = 1;
-+			break;
- 		case ARGS_OPT_NODEPS:
- 			conf->nodeps = 1;
- 			break;
-@@ -270,6 +276,7 @@ usage()
- 	printf("\t--force-downgrade	Allow opkg to downgrade packages\n");
- 	printf("\t--force-space		Disable free space checks\n");
- 	printf("\t--force-postinstall	Run postinstall scripts even in offline mode\n");
-+	printf("\t--force-remove	Remove package even if prerm script fails\n");
- 	printf("\t--noaction		No action -- test only\n");
- 	printf("\t--download-only	No action -- download only\n");
- 	printf("\t--nodeps		Do not follow dependencies\n");
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0588-Fix-if-statement-with-empty-body-due-to-stray-semico.patch b/patches/opkg-0.1.8/0588-Fix-if-statement-with-empty-body-due-to-stray-semico.patch
deleted file mode 100644
index 8a19ae4..0000000
--- a/patches/opkg-0.1.8/0588-Fix-if-statement-with-empty-body-due-to-stray-semico.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 25c4c0cc6f7e142f87be6e0945541a448602f197 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 13 Dec 2010 04:39:11 +0000
-Subject: [PATCH] Fix if statement with empty body due to stray semicolon.
-
-Found with Clang.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@588 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libbb/unarchive.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libbb/unarchive.c b/libbb/unarchive.c
-index 44f8715..1d152f5 100644
---- a/libbb/unarchive.c
-+++ b/libbb/unarchive.c
-@@ -621,7 +621,7 @@ free_header_tar(file_header_t *tar_entry)
- 		return;
- 
- 	free(tar_entry->name);
--	if (tar_entry->link_name);
-+	if (tar_entry->link_name)
- 		free(tar_entry->link_name);
- 
- 	free(tar_entry);
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0589-Fix-missing-declarations-found-by-Clang.patch b/patches/opkg-0.1.8/0589-Fix-missing-declarations-found-by-Clang.patch
deleted file mode 100644
index 10c9874..0000000
--- a/patches/opkg-0.1.8/0589-Fix-missing-declarations-found-by-Clang.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From c52c31b0d3770e83cb68deb4a13932c803fe382e Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 13 Dec 2010 04:39:29 +0000
-Subject: [PATCH] Fix missing declarations, found by Clang.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@589 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- src/opkg-cl.c |    1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
-diff --git a/src/opkg-cl.c b/src/opkg-cl.c
-index 5b72050..993aa66 100644
---- a/src/opkg-cl.c
-+++ b/src/opkg-cl.c
-@@ -28,6 +28,7 @@
- #include "opkg_cmd.h"
- #include "file_util.h"
- #include "opkg_message.h"
-+#include "opkg_download.h"
- #include "../libbb/libbb.h"
- 
- enum {
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0590-Remove-stray-exit-in-the-regress-test.patch b/patches/opkg-0.1.8/0590-Remove-stray-exit-in-the-regress-test.patch
deleted file mode 100644
index 91a91cc..0000000
--- a/patches/opkg-0.1.8/0590-Remove-stray-exit-in-the-regress-test.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 0d9f9342d4b6071c158351d4c30370ddf36dc7ec Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 13 Dec 2010 04:39:47 +0000
-Subject: [PATCH] Remove stray exit() in the regress test.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@590 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- tests/regress/issue50.py |    1 -
- 1 files changed, 0 insertions(+), 1 deletions(-)
-
-diff --git a/tests/regress/issue50.py b/tests/regress/issue50.py
-index 0ef4eae..a4a18cc 100755
---- a/tests/regress/issue50.py
-+++ b/tests/regress/issue50.py
-@@ -9,7 +9,6 @@ open("foo", "w").close()
- a1 = opk.Opk(Package="a", Version="1.0", Architecture="all")
- a1.write(data_files=["foo"])
- 
--exit()
- opkgcl.install("a_1.0_all.opk")
- 
- o = opk.OpkGroup()
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0591-Don-t-print-the-function-name-when-just-outputting-a.patch b/patches/opkg-0.1.8/0591-Don-t-print-the-function-name-when-just-outputting-a.patch
deleted file mode 100644
index 305c5ff..0000000
--- a/patches/opkg-0.1.8/0591-Don-t-print-the-function-name-when-just-outputting-a.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-From a51633c1d32fdf46957a155d1744d6f30fb47420 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 23 Dec 2010 01:37:18 +0000
-Subject: [PATCH] Don't print the function name when just outputting a \n.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@591 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_cmd.c     |    4 ++--
- libopkg/opkg_install.c |    2 +-
- 2 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
-index 584d05d..29ae0cd 100644
---- a/libopkg/opkg_cmd.c
-+++ b/libopkg/opkg_cmd.c
-@@ -1042,7 +1042,7 @@ opkg_what_depends_conflicts_cmd(enum depend_type what_field_type, int recursive,
- 					if (!pkg_dependence_satisfiable(possibility))
- 						opkg_msg(NOTICE,
- 							" unsatisfiable");
--					opkg_msg(NOTICE, "\n");
-+					opkg_message(NOTICE, "\n");
- 					goto next_package;
- 				}
- 			}
-@@ -1121,7 +1121,7 @@ opkg_what_provides_replaces_cmd(enum what_field_type what_field_type, int argc,
- 			      if (strcmp(target, apkg->name) != 0)
- 				   opkg_msg(NOTICE, "\t%s %s\n",
- 						   rel_str, apkg->name);
--			      opkg_msg(NOTICE, "\n");
-+			      opkg_message(NOTICE, "\n");
- 			 }
- 		    }
- 	       }
-diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
-index 68c17b3..ec4afba 100644
---- a/libopkg/opkg_install.c
-+++ b/libopkg/opkg_install.c
-@@ -134,7 +134,7 @@ check_conflicts_for(pkg_t *pkg)
- 	  i = 0;
- 	  while (i < conflicts->len)
- 	       opkg_msg(level, "\t%s", conflicts->pkgs[i++]->name);
--	  opkg_msg(level, "\n");
-+	  opkg_message(level, "\n");
- 	  pkg_vec_free(conflicts);
- 	  return -1;
-      }
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0592-Don-t-gitignore-the-regress-Makefile.patch b/patches/opkg-0.1.8/0592-Don-t-gitignore-the-regress-Makefile.patch
deleted file mode 100644
index 87f7275..0000000
--- a/patches/opkg-0.1.8/0592-Don-t-gitignore-the-regress-Makefile.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 6cdd37a2c49383c4eff4ddc882e8c4aba0069351 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 23 Dec 2010 01:37:42 +0000
-Subject: [PATCH] Don't gitignore the regress Makefile.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@592 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- .gitignore |    1 +
- 1 files changed, 1 insertions(+), 0 deletions(-)
-
-diff --git a/.gitignore b/.gitignore
-index f3a60ef..df61d46 100644
---- a/.gitignore
-+++ b/.gitignore
-@@ -14,6 +14,7 @@ Makefile
- Makefile.in
- # o_0
- Makefile.in.in
-+!tests/regress/Makefile
- 
- # The local aclocal.m4 file
- aclocal.m4
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0593-Add-regress-test-for-issue72.patch b/patches/opkg-0.1.8/0593-Add-regress-test-for-issue72.patch
deleted file mode 100644
index 8060792..0000000
--- a/patches/opkg-0.1.8/0593-Add-regress-test-for-issue72.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-From bab2931ba2828426ae497b23d20590a208ed6f48 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 23 Dec 2010 01:37:58 +0000
-Subject: [PATCH] Add regress test for issue72.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@593 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- tests/regress/Makefile   |   13 +++++++++++
- tests/regress/issue72.py |   52 ++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 65 insertions(+), 0 deletions(-)
- create mode 100644 tests/regress/Makefile
- create mode 100755 tests/regress/issue72.py
-
-diff --git a/tests/regress/Makefile b/tests/regress/Makefile
-new file mode 100644
-index 0000000..c438a16
---- /dev/null
-+++ b/tests/regress/Makefile
-@@ -0,0 +1,13 @@
-+PYTHON=/usr/bin/python3
-+REGRESSION_TESTS=issue26.py issue31.py issue45.py issue46.py \
-+			issue50.py issue51.py issue55.py issue58.py \
-+			issue72.py
-+
-+regress:
-+	@for test in $(REGRESSION_TESTS); do \
-+		echo $$test; \
-+		$(PYTHON) $$test; \
-+	done
-+
-+clean:
-+	rm -f *.pyc
-diff --git a/tests/regress/issue72.py b/tests/regress/issue72.py
-new file mode 100755
-index 0000000..3c71401
---- /dev/null
-+++ b/tests/regress/issue72.py
-@@ -0,0 +1,52 @@
-+#!/usr/bin/python3
-+
-+import os
-+import opk, cfg, opkgcl
-+
-+opk.regress_init()
-+
-+long_dir = 110*"a"
-+long_b = 110*"b"
-+long_filename = long_dir + "/"+ long_b
-+long_filename2 = long_dir + "/" + 110*"c"
-+
-+os.mkdir(long_dir)
-+open(long_filename, "w").close()
-+os.symlink(long_b, long_filename2)
-+a = opk.Opk(Package="a", Version="1.0", Architecture="all")
-+a.write(data_files=[long_dir, long_filename, long_filename2])
-+os.unlink(long_filename)
-+os.unlink(long_filename2)
-+os.rmdir(long_dir)
-+opkgcl.install("a_1.0_all.opk")
-+
-+if not opkgcl.is_installed("a"):
-+	print(__file__, ": Package 'a' not installed.")
-+	exit(False)
-+
-+if not os.path.exists("{}/{}".format(cfg.offline_root, long_dir)):
-+	print(__file__, ": dir with name longer than 100 "
-+					"characters not created.")
-+	exit(False)
-+
-+if not os.path.exists("{}/{}".format(cfg.offline_root, long_filename)):
-+	print(__file__, ": file with a name longer than 100 characters, "
-+				"in dir with name longer than 100 characters, "
-+				"not created.")
-+	exit(False)
-+
-+if not os.path.lexists("{}/{}".format(cfg.offline_root, long_filename2)):
-+	print(__file__, ": symlink with a name longer than 100 characters, "
-+				"pointing at a file with a name longer than "
-+				"100 characters,"
-+				"in dir with name longer than 100 characters, "
-+				"not created.")
-+	exit(False)
-+
-+linky = os.path.realpath("{}/{}".format(cfg.offline_root, long_filename2))
-+linky_dst = "{}/{}".format(cfg.offline_root, long_filename)
-+if linky != linky_dst:
-+	print(__file__, ": symlink path truncated.")
-+	exit(False)
-+
-+opkgcl.remove("a")
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0594-Don-t-truncate-long-symlink-paths.patch b/patches/opkg-0.1.8/0594-Don-t-truncate-long-symlink-paths.patch
deleted file mode 100644
index eadef3b..0000000
--- a/patches/opkg-0.1.8/0594-Don-t-truncate-long-symlink-paths.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From 35a2b8424a53f7f2e8ac3070169a8bb3878f8107 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 23 Dec 2010 01:38:25 +0000
-Subject: [PATCH] Don't truncate long symlink paths.
-
-Patch from Richard Purdie. Tracked as Issue #72. Original patch header follows.
-
-If a tarball contains a long symlink (over 100 chars) in a longpath (over 100
-chars) then the resulting link or path can be truncated to 100 chars.
-
-This is due to a bug where if both 'L' and 'K' entries are found in the tarball,
-only the first one takes affect due to get_header_tar recursively calling itself.
-To fix this, process longname and linkname at the end of the function rather
-than the start after any subcalls have taken place.
-
-Richard Purdie
-22/12/2010
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@594 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libbb/unarchive.c |   55 +++++++++++++++++++++++++++-------------------------
- 1 files changed, 29 insertions(+), 26 deletions(-)
-
-diff --git a/libbb/unarchive.c b/libbb/unarchive.c
-index 1d152f5..5d4464f 100644
---- a/libbb/unarchive.c
-+++ b/libbb/unarchive.c
-@@ -506,23 +506,7 @@ get_header_tar(FILE *tar_stream)
- 	/* convert to type'ed variables */
- 	tar_entry = xcalloc(1, sizeof(file_header_t));
- 
--#ifdef CONFIG_FEATURE_TAR_GNU_EXTENSIONS
--        if (longname) {
--                tar_entry->name = longname;
--                longname = NULL;
--        } else
--#endif
--        {
--                tar_entry->name = xstrndup(tar.formated.name, 100);
- 
--                if (tar.formated.prefix[0]) {
--                        char *temp = tar_entry->name;
--                        char *prefixTemp = xstrndup(tar.formated.prefix, 155);
--                        tar_entry->name = concat_path_file(prefixTemp, temp);
--                        free(temp);
--                        free(prefixTemp);
--                }
--        }
- 
- 	// tar_entry->name = xstrdup(tar.formated.name);
- 
-@@ -535,16 +519,7 @@ get_header_tar(FILE *tar_stream)
- 	tar_entry->gid   = strtol(tar.formated.gid, NULL, 8);
- 	tar_entry->size  = strtol(tar.formated.size, NULL, 8);
- 	tar_entry->mtime = strtol(tar.formated.mtime, NULL, 8);
--#ifdef CONFIG_FEATURE_TAR_GNU_EXTENSIONS
--	if (linkname) {
--		tar_entry->link_name = linkname;
--		linkname = NULL;
--	} else
--#endif
--	{
--		tar_entry->link_name = *tar.formated.linkname != '\0' ?
--			xstrndup(tar.formated.linkname, 100) : NULL;
--	}
-+
- 	tar_entry->device = (strtol(tar.formated.devmajor, NULL, 8) << 8) +
- 		strtol(tar.formated.devminor, NULL, 8);
- 
-@@ -611,6 +586,34 @@ get_header_tar(FILE *tar_stream)
- 
- 	}
- 
-+
-+#ifdef CONFIG_FEATURE_TAR_GNU_EXTENSIONS
-+        if (longname) {
-+                tar_entry->name = longname;
-+                longname = NULL;
-+        } else
-+#endif
-+        {
-+                tar_entry->name = xstrndup(tar.formated.name, 100);
-+
-+                if (tar.formated.prefix[0]) {
-+                        char *temp = tar_entry->name;
-+                        char *prefixTemp = xstrndup(tar.formated.prefix, 155);
-+                        tar_entry->name = concat_path_file(prefixTemp, temp);
-+                        free(temp);
-+                        free(prefixTemp);
-+                }
-+        }
-+
-+	if (linkname) {
-+		tar_entry->link_name = linkname;
-+		linkname = NULL;
-+	} else
-+	{
-+		tar_entry->link_name = *tar.formated.linkname != '\0' ?
-+			xstrndup(tar.formated.linkname, 100) : NULL;
-+	}
-+
- 	return(tar_entry);
- }
- 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0595-Fix-potential-undefined-references-to-FILE-for-libop.patch b/patches/opkg-0.1.8/0595-Fix-potential-undefined-references-to-FILE-for-libop.patch
deleted file mode 100644
index 31ac44f..0000000
--- a/patches/opkg-0.1.8/0595-Fix-potential-undefined-references-to-FILE-for-libop.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From f2fc8450d825b97076835c769f95764bece45140 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 23 Dec 2010 01:38:40 +0000
-Subject: [PATCH] Fix potential undefined references to FILE, for libopkg users.
-
-Patch from Richard Purdie.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@595 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/pkg_dest.h |    2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
-
-diff --git a/libopkg/pkg_dest.h b/libopkg/pkg_dest.h
-index cbc1ce6..4ad417e 100644
---- a/libopkg/pkg_dest.h
-+++ b/libopkg/pkg_dest.h
-@@ -18,6 +18,8 @@
- #ifndef PKG_DEST_H
- #define PKG_DEST_H
- 
-+#include <stdio.h>
-+
- typedef struct pkg_dest pkg_dest_t;
- struct pkg_dest
- {
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0596-Create-the-regress-offline_root-from-scratch.patch b/patches/opkg-0.1.8/0596-Create-the-regress-offline_root-from-scratch.patch
deleted file mode 100644
index a8b05df..0000000
--- a/patches/opkg-0.1.8/0596-Create-the-regress-offline_root-from-scratch.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 7486bf366c05312e7d50d5f969a539a6a581fcac Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 23 Dec 2010 01:38:57 +0000
-Subject: [PATCH] Create the regress offline_root from scratch.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@596 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- tests/regress/opk.py |   12 +++++++++---
- 1 files changed, 9 insertions(+), 3 deletions(-)
-
-diff --git a/tests/regress/opk.py b/tests/regress/opk.py
-index 616658a..9763bd3 100644
---- a/tests/regress/opk.py
-+++ b/tests/regress/opk.py
-@@ -90,6 +90,12 @@ def regress_init():
- 
- 	os.chdir(cfg.opkdir)
- 
--	odir = "{}/usr/lib/opkg".format(cfg.offline_root)
--	os.system("rm -fr {}".format(odir))
--	os.mkdir(odir)
-+	os.system("rm -fr {}".format(cfg.offline_root))
-+
-+	os.makedirs("{}/usr/lib/opkg".format(cfg.offline_root))
-+	os.makedirs("{}/etc/opkg".format(cfg.offline_root))
-+
-+	f = open("{}/etc/opkg/opkg.conf".format(cfg.offline_root), "w")
-+	f.write("arch all 1\n")
-+	f.write("src test file:{}\n".format(cfg.opkdir))
-+	f.close()
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0598-Fixed-a-bug-causing-segfaults-when-an-upgraded-packa.patch b/patches/opkg-0.1.8/0598-Fixed-a-bug-causing-segfaults-when-an-upgraded-packa.patch
deleted file mode 100644
index d8f3932..0000000
--- a/patches/opkg-0.1.8/0598-Fixed-a-bug-causing-segfaults-when-an-upgraded-packa.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 85144bba24942148ae2dee1e94267b6ba83c1741 Mon Sep 17 00:00:00 2001
-From: pixdamix <pixdamix@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 1 Feb 2011 14:36:50 +0000
-Subject: [PATCH] Fixed a bug causing segfaults when an upgraded package has less dependencies than the old package.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@598 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_install.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
-index ec4afba..7838875 100644
---- a/libopkg/opkg_install.c
-+++ b/libopkg/opkg_install.c
-@@ -324,7 +324,7 @@ pkg_remove_orphan_dependent(pkg_t *pkg, pkg_t *old_pkg)
- 			found = 0;
- 
- 			for (k=0; k<count1; k++) {
--				cd1 = &pkg->depends[i];
-+				cd1 = &pkg->depends[k];
- 				if (cd1->type != DEPEND)
- 					continue;
- 				for (l=0; l<cd1->possibility_count; l++) {
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0599-Fix-depmod-intercept.-Patch-from-Andreas-Oberritter.patch b/patches/opkg-0.1.8/0599-Fix-depmod-intercept.-Patch-from-Andreas-Oberritter.patch
deleted file mode 100644
index d7abdf7..0000000
--- a/patches/opkg-0.1.8/0599-Fix-depmod-intercept.-Patch-from-Andreas-Oberritter.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 6d27d9bb440be0006a754c7473e72f6e1dbdad04 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Wed, 2 Feb 2011 00:53:46 +0000
-Subject: [PATCH] Fix depmod intercept. Patch from Andreas Oberritter.
-
-* If depmod -a ${KERNEL_VERSION} is called, the version should be retained.
-* The script calls depmod -A, which does nothing if the installed module's
-  timestamp is older than modules.dep's timestamp. As modules generally
-  inherit the timestamp of the build, this would result in depmod doing nothing.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@599 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- intercept/depmod |    8 ++++----
- 1 files changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/intercept/depmod b/intercept/depmod
-index a60768f..f8a4f9a 100644
---- a/intercept/depmod
-+++ b/intercept/depmod
-@@ -1,10 +1,10 @@
- #!/bin/sh
- 
- if [ "x$1" = "x-a" ] || [ "x$1" = "x-A" ]; then
--  if [ ! -f $OPKG_INTERCEPT_DIR/depmod ]; then
--    echo "depmod -A" > $OPKG_INTERCEPT_DIR/depmod
--    chmod +x $OPKG_INTERCEPT_DIR/depmod
--  fi
-+  echo "depmod $@" >> $OPKG_INTERCEPT_DIR/depmod
-+  sort -u $OPKG_INTERCEPT_DIR/depmod > $OPKG_INTERCEPT_DIR/depmod.tmp
-+  mv $OPKG_INTERCEPT_DIR/depmod.tmp $OPKG_INTERCEPT_DIR/depmod
-+  chmod +x $OPKG_INTERCEPT_DIR/depmod
-   exit 0
- fi
- 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0600-Add-missing-space.patch b/patches/opkg-0.1.8/0600-Add-missing-space.patch
deleted file mode 100644
index d07bbed..0000000
--- a/patches/opkg-0.1.8/0600-Add-missing-space.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 2e7f79df655f82bf42ed2a06fea1a036d3d37024 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 14 Feb 2011 02:45:32 +0000
-Subject: [PATCH] Add missing space.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@600 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/pkg_parse.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/pkg_parse.c b/libopkg/pkg_parse.c
-index 5d08177..ba64269 100644
---- a/libopkg/pkg_parse.c
-+++ b/libopkg/pkg_parse.c
-@@ -139,7 +139,7 @@ parse_version(pkg_t *pkg, const char *vstr)
- 		pkg->epoch= 0;
- 	}
- 
--	pkg->version= xstrdup(vstr);
-+	pkg->version = xstrdup(vstr);
- 	pkg->revision = strrchr(pkg->version,'-');
- 
- 	if (pkg->revision)
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0601-Add-overlay_root-config-option.-Opkg-checks-this-loc.patch b/patches/opkg-0.1.8/0601-Add-overlay_root-config-option.-Opkg-checks-this-loc.patch
deleted file mode 100644
index 600c16c..0000000
--- a/patches/opkg-0.1.8/0601-Add-overlay_root-config-option.-Opkg-checks-this-loc.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From 0f54da55b8717543b08596e58c022ae49e70a184 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 14 Feb 2011 02:46:01 +0000
-Subject: [PATCH] Add overlay_root config option. Opkg checks this location for available space.
-
-This option is useful in the case where root is mounted ro, and another rw
-filesystem is overlaid on top with e.g. mini_fo.
-
-From Nicolas Thill via OpenWrt.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@601 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_conf.c    |    1 +
- libopkg/opkg_conf.h    |    1 +
- libopkg/opkg_install.c |   18 +++++++++++++++---
- 3 files changed, 17 insertions(+), 3 deletions(-)
-
-diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
-index acac1b4..864d2ac 100644
---- a/libopkg/opkg_conf.c
-+++ b/libopkg/opkg_conf.c
-@@ -63,6 +63,7 @@ opkg_option_t options[] = {
- 	  { "download_only", OPKG_OPT_TYPE_BOOL, &_conf.download_only },
- 	  { "nodeps", OPKG_OPT_TYPE_BOOL, &_conf.nodeps },
- 	  { "offline_root", OPKG_OPT_TYPE_STRING, &_conf.offline_root },
-+	  { "overlay_root", OPKG_OPT_TYPE_STRING, &_conf.overlay_root },
- 	  { "proxy_passwd", OPKG_OPT_TYPE_STRING, &_conf.proxy_passwd },
- 	  { "proxy_user", OPKG_OPT_TYPE_STRING, &_conf.proxy_user },
- 	  { "query-all", OPKG_OPT_TYPE_BOOL, &_conf.query_all },
-diff --git a/libopkg/opkg_conf.h b/libopkg/opkg_conf.h
-index af6b9ab..0340ff2 100644
---- a/libopkg/opkg_conf.h
-+++ b/libopkg/opkg_conf.h
-@@ -79,6 +79,7 @@ struct opkg_conf
-      int check_signature;
-      int nodeps; /* do not follow dependencies */
-      char *offline_root;
-+     char *overlay_root;
-      int query_all;
-      int verbosity;
-      int noaction;
-diff --git a/libopkg/opkg_install.c b/libopkg/opkg_install.c
-index 7838875..74a2ce1 100644
---- a/libopkg/opkg_install.c
-+++ b/libopkg/opkg_install.c
-@@ -21,6 +21,7 @@
- #include <time.h>
- #include <signal.h>
- #include <unistd.h>
-+#include <sys/stat.h>
- 
- #include "pkg.h"
- #include "pkg_hash.h"
-@@ -192,13 +193,24 @@ static int
- verify_pkg_installable(pkg_t *pkg)
- {
- 	unsigned long kbs_available, pkg_size_kbs;
--	char *root_dir;
-+	char *root_dir = NULL;
-+	struct stat s;
- 
- 	if (conf->force_space || pkg->installed_size == 0)
- 		return 0;
- 
--	root_dir = pkg->dest ? pkg->dest->root_dir :
--						conf->default_dest->root_dir;
-+	if (pkg->dest)
-+	{
-+		if (!strcmp(pkg->dest->name, "root") && conf->overlay_root
-+		    && !stat(conf->overlay_root, &s) && (s.st_mode & S_IFDIR))
-+			root_dir = conf->overlay_root;
-+		else
-+			root_dir = pkg->dest->root_dir;
-+	}
-+
-+	if (!root_dir)
-+		root_dir = conf->default_dest->root_dir;
-+
- 	kbs_available = get_available_kbytes(root_dir);
- 
- 	pkg_size_kbs = (pkg->installed_size + 1023)/1024;
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0602-Call-gpgme_check_version-before-using-other-gpgpe-fu.patch b/patches/opkg-0.1.8/0602-Call-gpgme_check_version-before-using-other-gpgpe-fu.patch
deleted file mode 100644
index 2026751..0000000
--- a/patches/opkg-0.1.8/0602-Call-gpgme_check_version-before-using-other-gpgpe-fu.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From a28f22ee5c9f868c733572048bbbb1217957507b Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 14 Feb 2011 02:46:33 +0000
-Subject: [PATCH] Call gpgme_check_version() before using other gpgpe functions.
-
-The function initializes some sub-systems, and for this reason alone
-it must be invoked early in your program, before you make use of the
-other functions in GPGME.
-see http://pyme.sourceforge.net/doc/gpgme/Library-Version-Check.html
-
-Patch from Bernhard Guillon.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@602 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_download.c |    2 ++
- 1 files changed, 2 insertions(+), 0 deletions(-)
-
-diff --git a/libopkg/opkg_download.c b/libopkg/opkg_download.c
-index b1f009f..16502d1 100644
---- a/libopkg/opkg_download.c
-+++ b/libopkg/opkg_download.c
-@@ -340,6 +340,8 @@ opkg_verify_file (char *text_file, char *sig_file)
-     gpgme_signature_t s;
-     char *trusted_path = NULL;
- 
-+    gpgme_check_version (NULL);
-+
-     err = gpgme_new (&ctx);
- 
-     if (err)
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0603-Delete-package-sources-that-fail-the-signature-check.patch b/patches/opkg-0.1.8/0603-Delete-package-sources-that-fail-the-signature-check.patch
deleted file mode 100644
index d8a01e9..0000000
--- a/patches/opkg-0.1.8/0603-Delete-package-sources-that-fail-the-signature-check.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From f5072b06fadc446ce4579ac6c8b0b9bfa3d55625 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 14 Feb 2011 02:47:09 +0000
-Subject: [PATCH] Delete package sources that fail the signature check.
-
-From Bernhard Guillon.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@603 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_cmd.c |    6 ++++++
- 1 files changed, 6 insertions(+), 0 deletions(-)
-
-diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
-index 29ae0cd..4059bb7 100644
---- a/libopkg/opkg_cmd.c
-+++ b/libopkg/opkg_cmd.c
-@@ -182,6 +182,12 @@ opkg_update_cmd(int argc, char **argv)
-                   else
-                       opkg_msg(NOTICE, "Signature check failed.\n");
-               }
-+              if (err) {
-+                  /* The signature was wrong so delete it */
-+                  opkg_msg(NOTICE, "Remove wrong Signature file.\n");
-+                  unlink (tmp_file_name);
-+                  unlink (list_file_name);
-+              }
-               /* We shouldn't unlink the signature ! */
-               // unlink (tmp_file_name);
-               free (tmp_file_name);
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0604-Allow-vfork-ing-an-external-gunzip-binary-instead-of.patch b/patches/opkg-0.1.8/0604-Allow-vfork-ing-an-external-gunzip-binary-instead-of.patch
deleted file mode 100644
index 13b8bbe..0000000
--- a/patches/opkg-0.1.8/0604-Allow-vfork-ing-an-external-gunzip-binary-instead-of.patch
+++ /dev/null
@@ -1,163 +0,0 @@
-From 4510dc50d303256dd5f74681119c826c329f6939 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Fri, 18 Feb 2011 00:02:14 +0000
-Subject: [PATCH] Allow vfork()ing an external gunzip binary instead of using fork().
-
-Patch from Mike Westerhof, with minor modifications to allow the use of both
-GNU gunzip and busybox gunzip. His original patch header follows.
-
-This patch allows a user to set an environment variable to cause opkg to
-select either the built-in gunzip code or an external gunzip utility, in
-order to dodge the OOM Killer.
-
-The built-in code is, of course, is the most desirable way to use opkg,
-since it is far more efficient.  However, the built-in code can trigger
-the OOM (out of memory) killer on small-memory machines, like the 32MB
-NSLU2.  This occurs because a standard fork will duplicate the entire
-address space of the parent.  Since opkg reads the entire feed database
-into memory, this problem is compounded by large feeds.
-
-This patch introduces a means for the user to cause opkg to use vfork()
-instead -- vfork() does not behave in the same manner as fork(), and
-does not trigger the OOM killer.  However, the semantics of vfork() are
-such that it cannot run the built-in gunzip code.  Instead, it must
-exec() an external utility to perform the gunzip operation.  It seems
-counter-intuitive, but the vfork()/exec() approach is the only good way
-to avoid triggering the dreaded OOM killer.
-
-In order to use this, the user must manually set the OPKG_USE_VFORK
-environment variable to any value.  For example:
-
-$ OPKG_USE_VFORK=1 opkg install samba
-
-The external utility used to do the gunzip operation is "busybox gunzip".
-It would have been nice to be able to just invoke "gunzip", but the
-full gunzip executable behaves slightly differently than does busybox,
-generating annoying warning messages.
-
-This is an update of the original patch by Mike Westerhof, Dec 2008.
-
-Mike Westerhof, Feb 2011
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@604 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libbb/gz_open.c |   74 +++++++++++++++++++++++++++++++++++++++++++++++-------
- 1 files changed, 64 insertions(+), 10 deletions(-)
-
-diff --git a/libbb/gz_open.c b/libbb/gz_open.c
-index 3997e72..bdc7564 100644
---- a/libbb/gz_open.c
-+++ b/libbb/gz_open.c
-@@ -29,33 +29,69 @@
- #include <unistd.h>
- #include "libbb.h"
- 
-+static int gz_use_vfork;
-+
- FILE *
- gz_open(FILE *compressed_file, int *pid)
- {
- 	int unzip_pipe[2];
-+	off_t floc;
-+	int cfile = -1;
-+
-+	gz_use_vfork = (getenv("OPKG_USE_VFORK") != NULL);
-+
-+	if (gz_use_vfork) {
-+		/* Create a new file descriptor for the input stream
-+		 * (it *must* be associated with a file), and lseek()
-+		 * to the same position in that fd as the stream.
-+		 */
-+		cfile = dup(fileno(compressed_file));
-+		floc = ftello(compressed_file);
-+		lseek(cfile, floc, SEEK_SET);
-+		setenv("GZIP", "--quiet", 0);
-+	}
- 
- 	if (pipe(unzip_pipe)!=0) {
- 		perror_msg("pipe");
- 		return(NULL);
- 	}
- 
--    /* If we don't flush, we end up with two copies of anything pending,
--       one from the parent, one from the child */
--    fflush(stdout);
--    fflush(stderr);
-+	/* If we don't flush, we end up with two copies of anything pending,
-+	   one from the parent, one from the child */
-+	fflush(stdout);
-+	fflush(stderr);
- 
--	if ((*pid = fork()) == -1) {
-+	if (gz_use_vfork) {
-+		*pid = vfork();
-+	} else {
-+		*pid = fork();
-+	}
-+
-+	if (*pid<0) {
- 		perror_msg("fork");
- 		return(NULL);
- 	}
-+
- 	if (*pid==0) {
- 		/* child process */
- 		close(unzip_pipe[0]);
--		unzip(compressed_file, fdopen(unzip_pipe[1], "w"));
--		fflush(NULL);
--		fclose(compressed_file);
--		close(unzip_pipe[1]);
--		_exit(EXIT_SUCCESS);
-+		if (gz_use_vfork) {
-+			dup2(unzip_pipe[1], 1);
-+			dup2(cfile, 0);
-+			execlp("gunzip","gunzip",NULL);
-+			/* If we get here, we had a failure */
-+			_exit(EXIT_FAILURE);
-+		} else {
-+			unzip(compressed_file, fdopen(unzip_pipe[1], "w"));
-+			fflush(NULL);
-+			fclose(compressed_file);
-+			close(unzip_pipe[1]);
-+			_exit(EXIT_SUCCESS);
-+		}
-+	}
-+	/* Parent process is executing here */
-+	if (gz_use_vfork) {
-+		close(cfile);
- 	}
- 	close(unzip_pipe[1]);
- 	return(fdopen(unzip_pipe[0], "r"));
-@@ -67,11 +103,29 @@ gz_close(int gunzip_pid)
- 	int status;
- 	int ret;
- 
-+	if (gz_use_vfork) {
-+		/* The gunzip process remains running in the background if we
-+		 * used the vfork()/exec() technique - so we have to kill it
-+		 * forcibly.  There might be a better way to do this, but that
-+		 * affect a lot of other parts of opkg, and this works fine.
-+		 */
-+		if (kill(gunzip_pid, SIGTERM) == -1) {
-+			perror_msg("gz_close(): unable to kill gunzip pid.");
-+			return -1;
-+		}
-+	}
-+
-+
- 	if (waitpid(gunzip_pid, &status, 0) == -1) {
- 		perror_msg("waitpid");
- 		return -1;
- 	}
- 
-+	if (gz_use_vfork) {
-+		/* Bail out here if we used the vfork()/exec() technique. */
-+		return 0;
-+	}
-+
- 	if (WIFSIGNALED(status)) {
- 		error_msg("Unzip process killed by signal %d.\n",
- 			WTERMSIG(status));
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0605-Get-the-owner-of-the-file_name-after-the-offline-roo.patch b/patches/opkg-0.1.8/0605-Get-the-owner-of-the-file_name-after-the-offline-roo.patch
deleted file mode 100644
index 3b0dc37..0000000
--- a/patches/opkg-0.1.8/0605-Get-the-owner-of-the-file_name-after-the-offline-roo.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From 0eed2e07feb747bfb79cbe01c5ec546286578088 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 21 Feb 2011 04:24:42 +0000
-Subject: [PATCH] Get the owner of the file_name after the offline root has been stripped.
-
-Fixes a problem where the old package maintains that it owns a file even
-though the new pkg has been installed with --force-overwrite.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@605 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/pkg_hash.c |    3 ++-
- 1 files changed, 2 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c
-index 59b285d..b7f1573 100644
---- a/libopkg/pkg_hash.c
-+++ b/libopkg/pkg_hash.c
-@@ -650,7 +650,7 @@ file_hash_get_file_owner(const char *file_name)
- void
- file_hash_set_file_owner(const char *file_name, pkg_t *owning_pkg)
- {
--	pkg_t *old_owning_pkg = hash_table_get(&conf->file_hash, file_name);
-+	pkg_t *old_owning_pkg;
- 	int file_name_len = strlen(file_name);
- 
- 	if (file_name[file_name_len -1] == '/')
-@@ -658,6 +658,7 @@ file_hash_set_file_owner(const char *file_name, pkg_t *owning_pkg)
- 
- 	file_name = strip_offline_root(file_name);
- 
-+	old_owning_pkg = hash_table_get(&conf->file_hash, file_name);
- 	hash_table_insert(&conf->file_hash, file_name, owning_pkg);
- 
- 	if (old_owning_pkg) {
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0606-List-some-sub-commands-that-were-missing-from-the-he.patch b/patches/opkg-0.1.8/0606-List-some-sub-commands-that-were-missing-from-the-he.patch
deleted file mode 100644
index 6715cc2..0000000
--- a/patches/opkg-0.1.8/0606-List-some-sub-commands-that-were-missing-from-the-he.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 093eb1abca0b5429856aa680437db9631d60a1ba Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 21 Feb 2011 04:24:55 +0000
-Subject: [PATCH] List some sub-commands that were missing from the --help output.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@606 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- src/opkg-cl.c |    3 +++
- 1 files changed, 3 insertions(+), 0 deletions(-)
-
-diff --git a/src/opkg-cl.c b/src/opkg-cl.c
-index 993aa66..1b927e5 100644
---- a/src/opkg-cl.c
-+++ b/src/opkg-cl.c
-@@ -241,8 +241,11 @@ usage()
- 	printf("\tcompare-versions <v1> <op> <v2>\n");
- 	printf("\t                    compare versions using <= < > >= = << >>\n");
- 	printf("\tprint-architecture	List installable package architectures\n");
-+	printf("\tdepends [-A] [pkgname|pat]+\n");
- 	printf("\twhatdepends [-A] [pkgname|pat]+\n");
- 	printf("\twhatdependsrec [-A] [pkgname|pat]+\n");
-+	printf("\twhatrecommends[-A] [pkgname|pat]+\n");
-+	printf("\twhatsuggests[-A] [pkgname|pat]+\n");
- 	printf("\twhatprovides [-A] [pkgname|pat]+\n");
- 	printf("\twhatconflicts [-A] [pkgname|pat]+\n");
- 	printf("\twhatreplaces [-A] [pkgname|pat]+\n");
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0607-Add-regress-test-for-the-bug-from-r605.patch b/patches/opkg-0.1.8/0607-Add-regress-test-for-the-bug-from-r605.patch
deleted file mode 100644
index 5a74d63..0000000
--- a/patches/opkg-0.1.8/0607-Add-regress-test-for-the-bug-from-r605.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 5dc29c0675d04089d4f1d8616d6777861f072e21 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Mon, 21 Feb 2011 04:45:33 +0000
-Subject: [PATCH] Add regress test for the bug from r605.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@607 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- tests/regress/Makefile    |    3 ++-
- tests/regress/filehash.py |   35 +++++++++++++++++++++++++++++++++++
- 2 files changed, 37 insertions(+), 1 deletions(-)
- create mode 100755 tests/regress/filehash.py
-
-diff --git a/tests/regress/Makefile b/tests/regress/Makefile
-index c438a16..bb9d212 100644
---- a/tests/regress/Makefile
-+++ b/tests/regress/Makefile
-@@ -1,7 +1,8 @@
- PYTHON=/usr/bin/python3
- REGRESSION_TESTS=issue26.py issue31.py issue45.py issue46.py \
- 			issue50.py issue51.py issue55.py issue58.py \
--			issue72.py
-+			issue72.py \
-+			filehash.py
- 
- regress:
- 	@for test in $(REGRESSION_TESTS); do \
-diff --git a/tests/regress/filehash.py b/tests/regress/filehash.py
-new file mode 100755
-index 0000000..e6cbe62
---- /dev/null
-+++ b/tests/regress/filehash.py
-@@ -0,0 +1,35 @@
-+#!/usr/bin/python3
-+
-+import os
-+import opk, cfg, opkgcl
-+
-+opk.regress_init()
-+
-+open("asdf", "w").close()
-+a = opk.Opk(Package="a", Version="1.0", Architecture="all")
-+a.write(data_files=["asdf"])
-+b = opk.Opk(Package="b", Version="1.0", Architecture="all")
-+b.write(data_files=["asdf"])
-+os.unlink("asdf")
-+opkgcl.install("a_1.0_all.opk")
-+
-+if not opkgcl.is_installed("a"):
-+	print(__file__, ": Package 'a' not installed.")
-+	exit(False)
-+
-+if not os.path.exists("{}/asdf".format(cfg.offline_root)):
-+	print(__file__, ": asdf not created.")
-+	exit(False)
-+
-+opkgcl.install("b_1.0_all.opk", "--force-overwrite")
-+
-+if "{}/asdf".format(cfg.offline_root) not in opkgcl.files("b"):
-+	print(__file__, ": asdf not claimed by ``b''.")
-+	exit(False)
-+
-+if "{}/asdf".format(cfg.offline_root) in opkgcl.files("a"):
-+	print(__file__, ": asdf is still claimed by ``a''.")
-+	exit(False)
-+
-+opkgcl.remove("b")
-+opkgcl.remove("a")
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0608-Fix-memory-leak-when-defined-HAVE_GPGME-and-defined-.patch b/patches/opkg-0.1.8/0608-Fix-memory-leak-when-defined-HAVE_GPGME-and-defined-.patch
deleted file mode 100644
index e7858ea..0000000
--- a/patches/opkg-0.1.8/0608-Fix-memory-leak-when-defined-HAVE_GPGME-and-defined-.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 7ac69b203f3dadd51fe32cfe503509005fa92803 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 22 Feb 2011 03:38:50 +0000
-Subject: [PATCH] Fix memory leak when !defined(HAVE_GPGME) and !defined(HAVE_OPENSSL).
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@608 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/opkg.c b/libopkg/opkg.c
-index 6d97789..574386e 100644
---- a/libopkg/opkg.c
-+++ b/libopkg/opkg.c
-@@ -685,7 +685,6 @@ opkg_update_package_lists(opkg_progress_callback_t progress_callback,
- 				}
- 			}
- 			free(sig_file_name);
--			free(list_file_name);
- 			free(url);
- 		}
- #else
-@@ -693,6 +692,7 @@ opkg_update_package_lists(opkg_progress_callback_t progress_callback,
- 				" has not been enabled in this build\n",
- 				list_file_name);
- #endif
-+		free(list_file_name);
- 
- 		sources_done++;
- 		progress(pdata, 100 * sources_done / sources_list_count);
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0609-Fix-opkg_re_read_config_files.patch b/patches/opkg-0.1.8/0609-Fix-opkg_re_read_config_files.patch
deleted file mode 100644
index c464805..0000000
--- a/patches/opkg-0.1.8/0609-Fix-opkg_re_read_config_files.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From b71b378dc4580dc8773d8b065c2dbc4f9e701028 Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 22 Feb 2011 03:39:04 +0000
-Subject: [PATCH] Fix opkg_re_read_config_files().
-
-This fixes segfaults when opkg_update_package_lists() is called multiple times.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@609 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg.c |   20 ++++++--------------
- 1 files changed, 6 insertions(+), 14 deletions(-)
-
-diff --git a/libopkg/opkg.c b/libopkg/opkg.c
-index 574386e..0757370 100644
---- a/libopkg/opkg.c
-+++ b/libopkg/opkg.c
-@@ -112,11 +112,14 @@ curl_progress_cb(struct _curl_cb_data *cb_data, double t,	/* dltotal */
- }
- 
- 
-+static struct opkg_conf saved_conf;
- /*** Public API ***/
- 
- int
- opkg_new()
- {
-+	saved_conf = *conf;
-+
- 	if (opkg_conf_init())
- 		goto err0;
- 
-@@ -150,20 +153,9 @@ opkg_free(void)
- int
- opkg_re_read_config_files(void)
- {
--	pkg_hash_deinit();
--	pkg_hash_init();
--
--	if (pkg_hash_load_feeds())
--		goto err;
--
--	if (pkg_hash_load_status_files())
--		goto err;
--
--	return 0;
--
--err:
--	pkg_hash_deinit();
--	return -1;
-+	opkg_free();
-+	*conf = saved_conf;
-+	return opkg_new();
- }
- 
- void
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0610-Add-flag-in-opkg_download-calls-to-reduce-the-severi.patch b/patches/opkg-0.1.8/0610-Add-flag-in-opkg_download-calls-to-reduce-the-severi.patch
deleted file mode 100644
index 18625e1..0000000
--- a/patches/opkg-0.1.8/0610-Add-flag-in-opkg_download-calls-to-reduce-the-severi.patch
+++ /dev/null
@@ -1,158 +0,0 @@
-From b427dfbf01c2f8fb8908a28bccbefd1fc1c6595c Mon Sep 17 00:00:00 2001
-From: javiplx@gmail.com <javiplx@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 7 Apr 2011 15:03:54 +0000
-Subject: [PATCH] Add flag in opkg_download calls to reduce the severity of the 'failed download' message
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@610 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg.c          |   10 +++++-----
- libopkg/opkg_cmd.c      |    6 +++---
- libopkg/opkg_download.c |   10 +++++-----
- libopkg/opkg_download.h |    2 +-
- 4 files changed, 14 insertions(+), 14 deletions(-)
-
-diff --git a/libopkg/opkg.c b/libopkg/opkg.c
-index 0757370..7c3e18f 100644
---- a/libopkg/opkg.c
-+++ b/libopkg/opkg.c
-@@ -342,7 +342,7 @@ opkg_install_package(const char *package_name,
- 
- 		err = opkg_download(url, pkg->local_filename,
- 				    (curl_progress_func) curl_progress_cb,
--				    &cb_data);
-+				    &cb_data, 0);
- 		free(url);
- 
- 		if (err) {
-@@ -613,7 +613,7 @@ opkg_update_package_lists(opkg_progress_callback_t progress_callback,
- 
- 			err = opkg_download(url, tmp_file_name,
- 					  (curl_progress_func) curl_progress_cb,
--					  &cb_data);
-+					  &cb_data, 0);
- 
- 			if (err == 0) {
- 				opkg_msg(INFO, "Inflating %s...\n",
-@@ -632,7 +632,7 @@ opkg_update_package_lists(opkg_progress_callback_t progress_callback,
- 			}
- 			free(tmp_file_name);
- 		} else
--			err = opkg_download(url, list_file_name, NULL, NULL);
-+			err = opkg_download(url, list_file_name, NULL, NULL, 0);
- 
- 		if (err) {
- 			opkg_msg(ERROR, "Couldn't retrieve %s\n", url);
-@@ -659,7 +659,7 @@ opkg_update_package_lists(opkg_progress_callback_t progress_callback,
- 			/* make sure there is no existing signature file */
- 			unlink(sig_file_name);
- 
--			err = opkg_download(url, sig_file_name, NULL, NULL);
-+			err = opkg_download(url, sig_file_name, NULL, NULL, 0);
- 			if (err) {
- 				opkg_msg(ERROR, "Couldn't retrieve %s\n", url);
- 			} else {
-@@ -864,7 +864,7 @@ opkg_repository_accessibility_check(void)
- 		iter1 = str_list_pop(src);
- 		repositories--;
- 
--		if (opkg_download(iter1->data, "/dev/null", NULL, NULL))
-+		if (opkg_download(iter1->data, "/dev/null", NULL, NULL, 0))
- 			ret++;
- 		str_list_elt_deinit(iter1);
- 	}
-diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
-index 4059bb7..8c04418 100644
---- a/libopkg/opkg_cmd.c
-+++ b/libopkg/opkg_cmd.c
-@@ -130,7 +130,7 @@ opkg_update_cmd(int argc, char **argv)
- 	      FILE *in, *out;
- 
- 	      sprintf_alloc (&tmp_file_name, "%s/%s.gz", tmp, src->name);
--	      err = opkg_download(url, tmp_file_name, NULL, NULL);
-+	      err = opkg_download(url, tmp_file_name, NULL, NULL, 0);
- 	      if (err == 0) {
- 		   opkg_msg(NOTICE, "Inflating %s.\n", url);
- 		   in = fopen (tmp_file_name, "r");
-@@ -147,7 +147,7 @@ opkg_update_cmd(int argc, char **argv)
- 	      }
- 	      free(tmp_file_name);
- 	  } else
--	      err = opkg_download(url, list_file_name, NULL, NULL);
-+	      err = opkg_download(url, list_file_name, NULL, NULL, 0);
- 	  if (err) {
- 	       failures++;
- 	  } else {
-@@ -171,7 +171,7 @@ opkg_update_cmd(int argc, char **argv)
-               /* Put the signature in the right place */
-               sprintf_alloc (&tmp_file_name, "%s/%s.sig", lists_dir, src->name);
- 
--              err = opkg_download(url, tmp_file_name, NULL, NULL);
-+              err = opkg_download(url, tmp_file_name, NULL, NULL, 0);
-               if (err) {
-                   failures++;
-                   opkg_msg(NOTICE, "Signature check failed.\n");
-diff --git a/libopkg/opkg_download.c b/libopkg/opkg_download.c
-index 16502d1..b9533aa 100644
---- a/libopkg/opkg_download.c
-+++ b/libopkg/opkg_download.c
-@@ -82,7 +82,7 @@ str_starts_with(const char *str, const char *prefix)
- 
- int
- opkg_download(const char *src, const char *dest_file_name,
--	curl_progress_func cb, void *data)
-+	curl_progress_func cb, void *data, const short hide_error)
- {
-     int err = 0;
- 
-@@ -142,7 +142,7 @@ opkg_download(const char *src, const char *dest_file_name,
- 	{
- 	    long error_code;
- 	    curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &error_code);
--	    opkg_msg(ERROR, "Failed to download %s: %s.\n",
-+	    opkg_msg(hide_error?DEBUG2:ERROR, "Failed to download %s: %s.\n",
- 		    src, curl_easy_strerror(res));
- 	    free(tmp_file_location);
- 	    return -1;
-@@ -196,7 +196,7 @@ opkg_download_cache(const char *src, const char *dest_file_name,
-     int err = 0;
- 
-     if (!conf->cache || str_starts_with(src, "file:")) {
--	err = opkg_download(src, dest_file_name, cb, data);
-+	err = opkg_download(src, dest_file_name, cb, data, 0);
- 	goto out1;
-     }
- 
-@@ -215,7 +215,7 @@ opkg_download_cache(const char *src, const char *dest_file_name,
-     if (file_exists(cache_location))
- 	opkg_msg(NOTICE, "Copying %s.\n", cache_location);
-     else {
--	err = opkg_download(src, cache_location, cb, data);
-+	err = opkg_download(src, cache_location, cb, data, 0);
- 	if (err) {
- 	    (void) unlink(cache_location);
- 	    goto out2;
-@@ -287,7 +287,7 @@ opkg_prepare_url_for_install(const char *url, char **namep)
- 	  char *file_base = basename(file_basec);
- 
- 	  sprintf_alloc(&tmp_file, "%s/%s", conf->tmp_dir, file_base);
--	  err = opkg_download(url, tmp_file, NULL, NULL);
-+	  err = opkg_download(url, tmp_file, NULL, NULL, 0);
- 	  if (err)
- 	       return err;
- 
-diff --git a/libopkg/opkg_download.h b/libopkg/opkg_download.h
-index 3e1c760..91b990e 100644
---- a/libopkg/opkg_download.h
-+++ b/libopkg/opkg_download.h
-@@ -25,7 +25,7 @@ typedef void (*opkg_download_progress_callback)(int percent, char *url);
- typedef int (*curl_progress_func)(void *data, double t, double d, double ultotal, double ulnow);
- 
- 
--int opkg_download(const char *src, const char *dest_file_name, curl_progress_func cb, void *data);
-+int opkg_download(const char *src, const char *dest_file_name, curl_progress_func cb, void *data, const short hide_error);
- int opkg_download_pkg(pkg_t *pkg, const char *dir);
- /*
-  * Downloads file from url, installs in package database, return package name.
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0611-Create-parse_util-with-some-of-the-non-public-functi.patch b/patches/opkg-0.1.8/0611-Create-parse_util-with-some-of-the-non-public-functi.patch
deleted file mode 100644
index a32e0f9..0000000
--- a/patches/opkg-0.1.8/0611-Create-parse_util-with-some-of-the-non-public-functi.patch
+++ /dev/null
@@ -1,273 +0,0 @@
-From 449b23e18889d916075d37527cb21834976babb2 Mon Sep 17 00:00:00 2001
-From: javiplx@gmail.com <javiplx@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 7 Apr 2011 15:17:27 +0000
-Subject: [PATCH] Create parse_util with some of the non-public functions from pkg_parse.c
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@611 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/Makefile.am  |    1 +
- libopkg/parse_util.c |   88 ++++++++++++++++++++++++++++++++++++++++++++++++++
- libopkg/parse_util.h |   25 ++++++++++++++
- libopkg/pkg_parse.c  |   73 ++++-------------------------------------
- 4 files changed, 122 insertions(+), 65 deletions(-)
- create mode 100644 libopkg/parse_util.c
- create mode 100644 libopkg/parse_util.h
-
-diff --git a/libopkg/Makefile.am b/libopkg/Makefile.am
-index 6be44ad..5ca55a0 100644
---- a/libopkg/Makefile.am
-+++ b/libopkg/Makefile.am
-@@ -26,6 +26,7 @@ opkg_list_sources = conffile.c conffile.h conffile_list.c conffile_list.h \
- 		    str_list.c str_list.h void_list.c void_list.h \
- 		    active_list.c active_list.h list.h 
- opkg_util_sources = file_util.c file_util.h opkg_message.h opkg_message.c md5.c md5.h \
-+		    parse_util.c parse_util.h \
- 		    sprintf_alloc.c sprintf_alloc.h \
- 		    xregex.c xregex.h xsystem.c xsystem.h
- if HAVE_PATHFINDER
-diff --git a/libopkg/parse_util.c b/libopkg/parse_util.c
-new file mode 100644
-index 0000000..e01b124
---- /dev/null
-+++ b/libopkg/parse_util.c
-@@ -0,0 +1,88 @@
-+/* parse_util.c - the opkg package management system
-+
-+   Copyright (C) 2009 Ubiq Technologies <graham.gower@gmail.com>
-+
-+   Steven M. Ayer
-+   Copyright (C) 2002 Compaq Computer Corporation
-+
-+   This program is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU General Public License as
-+   published by the Free Software Foundation; either version 2, or (at
-+   your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+*/
-+
-+#include <ctype.h>
-+
-+#include "opkg_utils.h"
-+#include "libbb/libbb.h"
-+
-+#include "parse_util.h"
-+
-+int
-+is_field(const char *type, const char *line)
-+{
-+	if (!strncmp(line, type, strlen(type)))
-+		return 1;
-+	return 0;
-+}
-+
-+char *
-+parse_simple(const char *type, const char *line)
-+{
-+	return trim_xstrdup(line + strlen(type) + 1);
-+}
-+
-+/*
-+ * Parse a comma separated string into an array.
-+ */
-+char **
-+parse_list(const char *raw, unsigned int *count, const char sep, int skip_field)
-+{
-+	char **depends = NULL;
-+	const char *start, *end;
-+	int line_count = 0;
-+
-+	/* skip past the "Field:" marker */
-+	if (!skip_field) {
-+	while (*raw && *raw != ':')
-+		raw++;
-+	raw++;
-+	}
-+
-+	if (line_is_blank(raw)) {
-+		*count = line_count;
-+		return NULL;
-+	}
-+
-+	while (*raw) {
-+		depends = xrealloc(depends, sizeof(char *) * (line_count + 1));
-+	
-+		while (isspace(*raw))
-+			raw++;
-+
-+		start = raw;
-+		while (*raw != sep && *raw)
-+			raw++;
-+		end = raw;
-+
-+		while (end > start && isspace(*end))
-+			end--;
-+
-+		if (sep == ' ')
-+			end++;
-+
-+		depends[line_count] = xstrndup(start, end-start);
-+
-+        	line_count++;
-+		if (*raw == sep)
-+		    raw++;
-+	}
-+
-+	*count = line_count;
-+	return depends;
-+}
-diff --git a/libopkg/parse_util.h b/libopkg/parse_util.h
-new file mode 100644
-index 0000000..e4e2abe
---- /dev/null
-+++ b/libopkg/parse_util.h
-@@ -0,0 +1,25 @@
-+/* parse_util.h - the opkg package management system
-+
-+   Steven M. Ayer
-+   
-+   Copyright (C) 2002 Compaq Computer Corporation
-+
-+   This program is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU General Public License as
-+   published by the Free Software Foundation; either version 2, or (at
-+   your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+*/
-+
-+#ifndef PARSE_UTIL_H
-+#define PARSE_UTIL_H
-+
-+int is_field(const char *type, const char *line);
-+char *parse_simple(const char *type, const char *line);
-+char **parse_list(const char *raw, unsigned int *count, const char sep, int skip_field);
-+
-+#endif
-diff --git a/libopkg/pkg_parse.c b/libopkg/pkg_parse.c
-index ba64269..e0d7fce 100644
---- a/libopkg/pkg_parse.c
-+++ b/libopkg/pkg_parse.c
-@@ -26,64 +26,7 @@
- #include "pkg_parse.h"
- #include "libbb/libbb.h"
- 
--static int
--is_field(const char *type, const char *line)
--{
--	if (!strncmp(line, type, strlen(type)))
--		return 1;
--	return 0;
--}
--
--static char *
--parse_simple(const char *type, const char *line)
--{
--	return trim_xstrdup(line + strlen(type) + 1);
--}
--
--/*
-- * Parse a comma separated string into an array.
-- */
--static char **
--parse_comma_separated(const char *raw, unsigned int *count)
--{
--	char **depends = NULL;
--	const char *start, *end;
--	int line_count = 0;
--
--	/* skip past the "Field:" marker */
--	while (*raw && *raw != ':')
--		raw++;
--	raw++;
--
--	if (line_is_blank(raw)) {
--		*count = line_count;
--		return NULL;
--	}
--
--	while (*raw) {
--		depends = xrealloc(depends, sizeof(char *) * (line_count + 1));
--
--		while (isspace(*raw))
--			raw++;
--
--		start = raw;
--		while (*raw != ',' && *raw)
--			raw++;
--		end = raw;
--
--		while (end > start && isspace(*end))
--			end--;
--
--		depends[line_count] = xstrndup(start, end-start);
--
--        	line_count++;
--		if (*raw == ',')
--		    raw++;
--	}
--
--	*count = line_count;
--	return depends;
--}
-+#include "parse_util.h"
- 
- static void
- parse_status(pkg_t *pkg, const char *sstr)
-@@ -194,7 +137,7 @@ pkg_parse_line(pkg_t *pkg, const char *line, uint mask)
- 			goto dont_reset_flags;
- 	    	}
- 		else if ((mask & PFM_CONFLICTS) && is_field("Conflicts", line))
--			pkg->conflicts_str = parse_comma_separated(line, &pkg->conflicts_count);
-+			pkg->conflicts_str = parse_list(line, &pkg->conflicts_count, ',', 0);
- 		break;
- 
- 	case 'D':
-@@ -204,7 +147,7 @@ pkg_parse_line(pkg_t *pkg, const char *line, uint mask)
- 			reading_description = 1;
- 			goto dont_reset_flags;
- 		} else if ((mask & PFM_DEPENDS) && is_field("Depends", line))
--			pkg->depends_str = parse_comma_separated(line, &pkg->depends_count);
-+			pkg->depends_str = parse_list(line, &pkg->depends_count, ',', 0);
- 		break;
- 
- 	case 'E':
-@@ -250,16 +193,16 @@ pkg_parse_line(pkg_t *pkg, const char *line, uint mask)
- 		else if ((mask & PFM_PRIORITY) && is_field("Priority", line))
- 			pkg->priority = parse_simple("Priority", line);
- 		else if ((mask & PFM_PROVIDES) && is_field("Provides", line))
--			pkg->provides_str = parse_comma_separated(line, &pkg->provides_count);
-+			pkg->provides_str = parse_list(line, &pkg->provides_count, ',', 0);
- 		else if ((mask & PFM_PRE_DEPENDS) && is_field("Pre-Depends", line))
--			pkg->pre_depends_str = parse_comma_separated(line, &pkg->pre_depends_count);
-+			pkg->pre_depends_str = parse_list(line, &pkg->pre_depends_count, ',', 0);
- 		break;
- 
- 	case 'R':
- 		if ((mask & PFM_RECOMMENDS) && is_field("Recommends", line))
--			pkg->recommends_str = parse_comma_separated(line, &pkg->recommends_count);
-+			pkg->recommends_str = parse_list(line, &pkg->recommends_count, ',', 0);
- 		else if ((mask & PFM_REPLACES) && is_field("Replaces", line))
--			pkg->replaces_str = parse_comma_separated(line, &pkg->replaces_count);
-+			pkg->replaces_str = parse_list(line, &pkg->replaces_count, ',', 0);
- 
- 		break;
- 
-@@ -279,7 +222,7 @@ pkg_parse_line(pkg_t *pkg, const char *line, uint mask)
- 		else if ((mask & PFM_STATUS) && is_field("Status", line))
- 			parse_status(pkg, line);
- 		else if ((mask & PFM_SUGGESTS) && is_field("Suggests", line))
--			pkg->suggests_str = parse_comma_separated(line, &pkg->suggests_count);
-+			pkg->suggests_str = parse_list(line, &pkg->suggests_count, ',', 0);
- 		break;
- 
- 	case 'T':
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0612-Code-to-handle-the-apt-alike-configuration-entries.patch b/patches/opkg-0.1.8/0612-Code-to-handle-the-apt-alike-configuration-entries.patch
deleted file mode 100644
index 9de93b7..0000000
--- a/patches/opkg-0.1.8/0612-Code-to-handle-the-apt-alike-configuration-entries.patch
+++ /dev/null
@@ -1,765 +0,0 @@
-From a71e5ecc5784fdb03f5ea4edc4eb17c9b00e24bf Mon Sep 17 00:00:00 2001
-From: javiplx@gmail.com <javiplx@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 7 Apr 2011 15:35:24 +0000
-Subject: [PATCH] Code to handle the apt-alike configuration entries
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@612 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/Makefile.am     |    2 +
- libopkg/cksum_list.c    |   87 ++++++++++++
- libopkg/cksum_list.h    |   46 +++++++
- libopkg/release.c       |  342 +++++++++++++++++++++++++++++++++++++++++++++++
- libopkg/release.h       |   53 ++++++++
- libopkg/release_parse.c |  135 +++++++++++++++++++
- libopkg/release_parse.h |   21 +++
- 7 files changed, 686 insertions(+), 0 deletions(-)
- create mode 100644 libopkg/cksum_list.c
- create mode 100644 libopkg/cksum_list.h
- create mode 100644 libopkg/release.c
- create mode 100644 libopkg/release.h
- create mode 100644 libopkg/release_parse.c
- create mode 100644 libopkg/release_parse.h
-
-diff --git a/libopkg/Makefile.am b/libopkg/Makefile.am
-index 5ca55a0..373d09c 100644
---- a/libopkg/Makefile.am
-+++ b/libopkg/Makefile.am
-@@ -15,6 +15,7 @@ opkg_cmd_sources = opkg_cmd.c opkg_cmd.h \
- 		   opkg_upgrade.c opkg_upgrade.h \
- 		   opkg_remove.c opkg_remove.h
- opkg_db_sources = opkg_conf.c opkg_conf.h \
-+		  release.c release.h release_parse.c release_parse.h \
- 		  opkg_utils.c opkg_utils.h pkg.c pkg.h hash_table.h \
- 		  pkg_depends.c pkg_depends.h pkg_extract.c pkg_extract.h \
- 		  hash_table.c pkg_hash.c pkg_hash.h pkg_parse.c pkg_parse.h \
-@@ -27,6 +28,7 @@ opkg_list_sources = conffile.c conffile.h conffile_list.c conffile_list.h \
- 		    active_list.c active_list.h list.h 
- opkg_util_sources = file_util.c file_util.h opkg_message.h opkg_message.c md5.c md5.h \
- 		    parse_util.c parse_util.h \
-+		    cksum_list.c cksum_list.h \
- 		    sprintf_alloc.c sprintf_alloc.h \
- 		    xregex.c xregex.h xsystem.c xsystem.h
- if HAVE_PATHFINDER
-diff --git a/libopkg/cksum_list.c b/libopkg/cksum_list.c
-new file mode 100644
-index 0000000..d17151d
---- /dev/null
-+++ b/libopkg/cksum_list.c
-@@ -0,0 +1,87 @@
-+/* cksum_lis.c - the opkg package management system
-+
-+   Copyright (C) 2010,2011 Javier Palacios
-+
-+   This program is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU General Public License as
-+   published by the Free Software Foundation; either version 2, or (at
-+   your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+*/
-+
-+#include "config.h"
-+
-+#include <stdio.h>
-+
-+#include "cksum_list.h"
-+#include "libbb/libbb.h"
-+
-+
-+int cksum_init(cksum_t *cksum, char **itemlist)
-+{
-+    cksum->value = xstrdup(*itemlist++);
-+    cksum->size = atoi(*itemlist++);
-+    cksum->name = xstrdup(*itemlist++);
-+
-+    return 0;
-+}
-+
-+void cksum_deinit(cksum_t *cksum)
-+{
-+    free (cksum->name);
-+    cksum->name = NULL;
-+
-+    free (cksum->value);
-+    cksum->value = NULL;
-+}
-+
-+void cksum_list_init(cksum_list_t *list)
-+{
-+    void_list_init((void_list_t *) list);
-+}
-+
-+void cksum_list_deinit(cksum_list_t *list)
-+{
-+    cksum_list_elt_t *iter, *n;
-+    cksum_t *cksum;
-+
-+    list_for_each_entry_safe(iter, n, &list->head, node) {
-+      cksum = (cksum_t *)iter->data;
-+      cksum_deinit(cksum);
-+
-+      /* malloced in cksum_list_append */
-+      free(cksum);
-+      iter->data = NULL;
-+    }
-+    void_list_deinit((void_list_t *) list);
-+}
-+
-+cksum_t *cksum_list_append(cksum_list_t *list, char **itemlist)
-+{
-+    /* freed in cksum_list_deinit */
-+    cksum_t *cksum = xcalloc(1, sizeof(cksum_t));
-+    cksum_init(cksum, itemlist);
-+
-+    void_list_append((void_list_t *) list, cksum);
-+
-+    return cksum;
-+}
-+
-+const cksum_t *cksum_list_find(cksum_list_t *list, const char *name)
-+{
-+     cksum_list_elt_t *iter;
-+     cksum_t *cksum;
-+
-+     list_for_each_entry(iter, &list->head, node) {
-+	  cksum = (cksum_t *)iter->data;
-+	  if (strcmp(cksum->name, name) == 0) {
-+	       return cksum;
-+	  }
-+     }    
-+     return NULL;
-+}
-+
-diff --git a/libopkg/cksum_list.h b/libopkg/cksum_list.h
-new file mode 100644
-index 0000000..b752288
---- /dev/null
-+++ b/libopkg/cksum_list.h
-@@ -0,0 +1,46 @@
-+/* cksum_list.h - the opkg package management system
-+
-+   Copyright (C) 2010,2011 Javier Palacios
-+
-+   This program is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU General Public License as
-+   published by the Free Software Foundation; either version 2, or (at
-+   your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+*/
-+
-+#ifndef CKSUM_LIST_H
-+#define CKSUM_LIST_H
-+
-+typedef struct 
-+{
-+  char *name;
-+  char *value;
-+  int size;
-+} cksum_t;
-+
-+int cksum_init(cksum_t *cksum, char **itemlist);
-+void cksum_deinit(cksum_t *cksum);
-+
-+#include "void_list.h"
-+
-+typedef struct void_list_elt cksum_list_elt_t;
-+
-+typedef struct void_list cksum_list_t;
-+
-+static inline int cksum_list_empty(cksum_list_t *list)
-+{
-+    return void_list_empty ((void_list_t *)list);
-+}
-+
-+void cksum_list_init(cksum_list_t *list);
-+void cksum_list_deinit(cksum_list_t *list);
-+
-+cksum_t *cksum_list_append(cksum_list_t *list, char **itemlist);
-+const cksum_t *cksum_list_find(cksum_list_t *list, const char *name);
-+
-+#endif
-diff --git a/libopkg/release.c b/libopkg/release.c
-new file mode 100644
-index 0000000..86f9a8d
---- /dev/null
-+++ b/libopkg/release.c
-@@ -0,0 +1,342 @@
-+/* release.c - the opkg package management system
-+
-+   Copyright (C) 2010,2011 Javier Palacios
-+
-+   This program is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU General Public License as
-+   published by the Free Software Foundation; either version 2, or (at
-+   your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+*/
-+
-+#include <unistd.h>
-+#include <ctype.h>
-+
-+#include "release.h"
-+#include "opkg_utils.h"
-+#include "libbb/libbb.h"
-+
-+#include "opkg_download.h"
-+#include "sprintf_alloc.h"
-+
-+#include "release_parse.h"
-+
-+#include "parse_util.h"
-+#include "file_util.h"
-+
-+static void
-+release_init(release_t *release)
-+{
-+     release->name = NULL;
-+     release->datestring = NULL;
-+     release->architectures = NULL;
-+     release->architectures_count = 0;
-+     release->components = NULL;
-+     release->components_count = 0;
-+     release->complist = NULL;
-+     release->complist_count = 0;
-+}
-+
-+release_t *
-+release_new(void)
-+{
-+     release_t *release;
-+
-+     release = xcalloc(1, sizeof(release_t));
-+     release_init(release);
-+
-+     return release;
-+}
-+
-+void
-+release_deinit(release_t *release)
-+{
-+    int i;
-+
-+    free(release->name);
-+    free(release->datestring);
-+
-+    for(i = 0; i < release->architectures_count; i++){
-+	free(release->architectures[i]);
-+    }
-+    free(release->architectures);
-+
-+    for(i = 0; i < release->components_count; i++){
-+	free(release->components[i]);
-+    }
-+    free(release->components);
-+
-+    for(i = 0; i < release->complist_count; i++){
-+	free(release->complist[i]);
-+    }
-+    free(release->complist);
-+
-+}
-+
-+int
-+release_init_from_file(release_t *release, const char *filename)
-+{
-+	int err = 0;
-+	FILE *release_file;
-+
-+	release_file = fopen(filename, "r");
-+	if (release_file == NULL) {
-+		opkg_perror(ERROR, "Failed to open %s", filename);
-+		return -1;
-+	}
-+
-+	err=release_parse_from_stream(release, release_file);
-+	if (!err) {
-+		if (!release_arch_supported(release)) {
-+			opkg_msg(ERROR, "No valid architecture found on Release file.\n");
-+			err = -1;
-+		}
-+	}
-+
-+	return err;
-+}
-+
-+const char *
-+item_in_list(const char *comp, char **complist, const unsigned int count)
-+{
-+     int i;
-+
-+     if (!complist)
-+	  return comp;
-+
-+     for(i = 0; i < count; i++){
-+	  if (strcmp(comp, complist[i]) == 0)
-+		    return complist[i];
-+     }
-+
-+     return NULL;
-+}
-+
-+int
-+release_arch_supported(release_t *release)
-+{
-+     nv_pair_list_elt_t *l;
-+
-+     list_for_each_entry(l , &conf->arch_list.head, node) {
-+	  nv_pair_t *nv = (nv_pair_t *)l->data;
-+	  if (item_in_list(nv->name, release->architectures, release->architectures_count)) {
-+	       opkg_msg(DEBUG, "Arch %s (priority %s) supported for dist %s.\n",
-+			       nv->name, nv->value, release->name);
-+	       return 1;
-+	  }
-+     }
-+
-+     return 0;
-+}
-+
-+int
-+release_comps_supported(release_t *release, const char *complist)
-+{
-+     int ret = 1;
-+     int i;
-+
-+     if (complist) {
-+	  release->complist = parse_list(complist, &release->complist_count, ' ', 1);
-+	  for(i = 0; i < release->complist_count; i++){
-+	       if (!item_in_list(release->complist[i], release->components, release->components_count)) {
-+		    opkg_msg(ERROR, "Component %s not supported for dist %s.\n",
-+				    release->complist[i], release->name);
-+		    ret = 0;
-+	       }
-+	  }
-+     }
-+
-+     return ret;
-+}
-+
-+const char **
-+release_comps(release_t *release, unsigned int *count)
-+{
-+     char **comps = release->complist;
-+
-+     if (!comps) {
-+	  comps = release->components;
-+	  *count = release->components_count;
-+     } else {
-+	  *count = release->complist_count;
-+     }
-+
-+     return (const char **)comps;
-+}
-+
-+int
-+release_download(release_t *release, pkg_src_t *dist, char *lists_dir, char *tmpdir)
-+{
-+     int ret = 0;
-+     unsigned int ncomp;
-+     const char **comps = release_comps(release, &ncomp);
-+     nv_pair_list_elt_t *l;
-+     int i;
-+
-+     for(i = 0; i < ncomp; i++){
-+	  int err = 0;
-+	  char *prefix;
-+
-+	  sprintf_alloc(&prefix, "%s/dists/%s/%s/binary", dist->value, dist->name,
-+			comps[i]);
-+
-+	  list_for_each_entry(l , &conf->arch_list.head, node) {
-+	       char *url;
-+	       char *tmp_file_name, *list_file_name;
-+	       char *subpath = NULL;
-+
-+	       nv_pair_t *nv = (nv_pair_t *)l->data;
-+
-+	       sprintf_alloc(&list_file_name, "%s/%s-%s-%s", lists_dir, dist->name, comps[i], nv->name);
-+
-+	       sprintf_alloc(&tmp_file_name, "%s/%s-%s-%s%s", tmpdir, dist->name, comps[i], nv->name, ".gz");
-+
-+	       sprintf_alloc(&subpath, "%s/binary-%s/%s", comps[i], nv->name, dist->gzip ? "Packages.gz" : "Packages");
-+
-+	       if (dist->gzip) {
-+	       sprintf_alloc(&url, "%s-%s/Packages.gz", prefix, nv->name);
-+	       err = opkg_download(url, tmp_file_name, NULL, NULL, 1);
-+	       if (!err) {
-+		    err = release_verify_file(release, tmp_file_name, subpath);
-+		    if (err) {
-+			 unlink (tmp_file_name);
-+			 unlink (list_file_name);
-+		    }
-+	       }
-+	       if (!err) {
-+		    FILE *in, *out;
-+		    opkg_msg(NOTICE, "Inflating %s.\n", url);
-+		    in = fopen (tmp_file_name, "r");
-+		    out = fopen (list_file_name, "w");
-+		    if (in && out) {
-+			 err = unzip (in, out);
-+			 if (err)
-+			      opkg_msg(INFO, "Corrumpt file at %s.\n", url);
-+		    } else
-+			 err = 1;
-+		    if (in)
-+			 fclose (in);
-+		    if (out)
-+			 fclose (out);
-+		    unlink (tmp_file_name);
-+	       }
-+	       free(url);
-+	       }
-+
-+	       if (err) {
-+		    sprintf_alloc(&url, "%s-%s/Packages", prefix, nv->name);
-+		    err = opkg_download(url, list_file_name, NULL, NULL, 1);
-+		    if (!err) {
-+			 err = release_verify_file(release, tmp_file_name, subpath);
-+			 if (err)
-+			      unlink (list_file_name);
-+		    }
-+		    free(url);
-+	       }
-+
-+	       free(tmp_file_name);
-+	       free(list_file_name);
-+	  }
-+
-+	  if(err)
-+	       ret = 1;
-+
-+	  free(prefix);
-+     }
-+
-+     return ret;
-+}
-+
-+int
-+release_get_size(release_t *release, const char *pathname)
-+{
-+     const cksum_t *cksum;
-+
-+     if (release->md5sums) {
-+	  cksum = cksum_list_find(release->md5sums, pathname);
-+	  return cksum->size;
-+     }
-+
-+#ifdef HAVE_SHA256
-+     if (release->sha256sums) {
-+	  cksum = cksum_list_find(release->sha256sums, pathname);
-+	  return cksum->size;
-+     }
-+#endif
-+
-+     return -1;
-+}
-+
-+const char *
-+release_get_md5(release_t *release, const char *pathname)
-+{
-+     const cksum_t *cksum;
-+
-+     if (release->md5sums) {
-+	  cksum = cksum_list_find(release->md5sums, pathname);
-+	  return cksum->value;
-+     }
-+
-+     return '\0';
-+}
-+
-+#ifdef HAVE_SHA256
-+const char *
-+release_get_sha256(release_t *release, const char *pathname)
-+{
-+     const cksum_t *cksum;
-+
-+     if (release->sha256sums) {
-+	  cksum = cksum_list_find(release->sha256sums, pathname);
-+	  return cksum->value;
-+     }
-+
-+     return '\0';
-+}
-+#endif
-+
-+int
-+release_verify_file(release_t *release, const char* file_name, const char *pathname)
-+{
-+     struct stat f_info;
-+     char *f_md5 = NULL;
-+     const char *md5 = release_get_md5(release, pathname);
-+#ifndef HAVE_SHA256
-+     char *f_sha256 = NULL;
-+     const char *sha256 = release_get_sha256(release, pathname);
-+#endif
-+     int ret = 0;
-+
-+     if (stat(file_name, &f_info) || (f_info.st_size!=release_get_size(release, pathname))) {
-+	  opkg_msg(ERROR, "Size verification failed for %s - %s.\n", release->name, pathname);
-+	  ret = 1;
-+     } else {
-+
-+     f_md5 = file_md5sum_alloc(file_name);
-+#ifdef HAVE_SHA256
-+     f_sha256 = file_sha256sum_alloc(file_name);
-+#endif
-+
-+     if (md5 && strcmp(md5, f_md5)) {
-+	  opkg_msg(ERROR, "MD5 verification failed for %s - %s.\n", release->name, pathname);
-+	  ret = 1;
-+#ifdef HAVE_SHA256
-+     } else if (sha256 && strcmp(sha256, f_sha256)) {
-+	  opkg_msg(ERROR, "SHA256 verification failed for %s - %s.\n", release->name, pathname);
-+	  ret = 1;
-+#endif
-+     }
-+
-+     }
-+
-+     free(f_md5);
-+#ifdef HAVE_SHA256
-+     free(f_sha256);
-+#endif
-+
-+     return ret;
-+}
-diff --git a/libopkg/release.h b/libopkg/release.h
-new file mode 100644
-index 0000000..239dcca
---- /dev/null
-+++ b/libopkg/release.h
-@@ -0,0 +1,53 @@
-+/* release.h - the opkg package management system
-+
-+   Copyright (C) 2010,2011 Javier Palacios
-+
-+   This program is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU General Public License as
-+   published by the Free Software Foundation; either version 2, or (at
-+   your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+*/
-+
-+#ifndef RELEASE_H
-+#define RELEASE_H
-+
-+#include <stdio.h>
-+#include "pkg.h"
-+#include "cksum_list.h"
-+
-+struct release
-+{
-+     char *name;
-+     char *datestring;
-+     char **architectures;
-+     unsigned int architectures_count;
-+     char **components;
-+     unsigned int components_count;
-+     cksum_list_t *md5sums;
-+#ifdef HAVE_SHA256
-+     cksum_list_t *sha256sums;
-+#endif
-+     char **complist;
-+     unsigned int complist_count;
-+};
-+
-+typedef struct release release_t;
-+
-+release_t *release_new(void);
-+void release_deinit(release_t *release);
-+int release_init_from_file(release_t *release, const char *filename);
-+
-+int release_arch_supported(release_t *release);
-+int release_comps_supported(release_t *release, const char *complist);
-+int release_download(release_t *release, pkg_src_t *dist, char *lists_dir, char *tmpdir);
-+
-+const char **release_comps(release_t *release, unsigned int *count);
-+
-+int release_verify_file(release_t *release, const char *filename, const char *pathname);
-+
-+#endif
-diff --git a/libopkg/release_parse.c b/libopkg/release_parse.c
-new file mode 100644
-index 0000000..e1d9a84
---- /dev/null
-+++ b/libopkg/release_parse.c
-@@ -0,0 +1,135 @@
-+/* release_parse.c - the opkg package management system
-+
-+   Copyright (C) 2010,2011 Javier Palacios
-+
-+   This program is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU General Public License as
-+   published by the Free Software Foundation; either version 2, or (at
-+   your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+*/
-+
-+#include "config.h"
-+
-+#include <stdio.h>
-+
-+#include "release.h"
-+#include "release_parse.h"
-+#include "libbb/libbb.h"
-+#include "parse_util.h"
-+
-+static int
-+release_parse_line(release_t *release, const char *line)
-+{
-+	int ret = 0;
-+	unsigned int count = 0;
-+	char **list = 0;
-+	static int reading_md5sums = 0;
-+#ifdef HAVE_SHA256
-+	static int reading_sha256sums = 0;
-+#endif
-+
-+	switch (*line) {
-+	case 'A':
-+		if (is_field("Architectures", line)) {
-+			release->architectures = parse_list(line, &release->architectures_count, ' ', 0);
-+		}
-+		break;
-+
-+	case 'C':
-+		if (is_field("Codename", line)) {
-+			release->name = parse_simple("Codename", line);
-+	    	}
-+		else if (is_field("Components", line)) {
-+			release->components = parse_list(line, &release->components_count, ' ', 0);
-+	    	}
-+		break;
-+
-+	case 'D':
-+		if (is_field("Date", line)) {
-+			release->datestring = parse_simple("Date", line);
-+		}
-+		break;
-+
-+	case 'M':
-+		if (is_field("MD5sum", line)) {
-+			reading_md5sums = 1;
-+			if (release->md5sums == NULL) {
-+			     release->md5sums = xcalloc(1, sizeof(cksum_list_t));
-+			     cksum_list_init(release->md5sums);
-+			}
-+			goto dont_reset_flags;
-+	    	}
-+		break;
-+
-+#ifdef HAVE_SHA256
-+	case 'S':
-+		if (is_field("SHA256", line)) {
-+			reading_sha256sums = 1;
-+			if (release->sha256sums == NULL) {
-+			     release->sha256sums = xcalloc(1, sizeof(cksum_list_t));
-+			     cksum_list_init(release->sha256sums);
-+			}
-+			goto dont_reset_flags;
-+	    	}
-+		break;
-+#endif
-+
-+	case ' ':
-+		if (reading_md5sums) {
-+			list = parse_list(line, &count, ' ', 1);
-+			cksum_list_append(release->md5sums, list);
-+			goto dont_reset_flags;
-+		}
-+#ifdef HAVE_SHA256
-+		else if (reading_sha256sums) {
-+			list = parse_list(line, &count, ' ', 1);
-+			cksum_list_append(release->sha256sums, list);
-+			goto dont_reset_flags;
-+		}
-+#endif
-+		break;
-+
-+	default:
-+		ret = 1;
-+	}
-+
-+	reading_md5sums = 0;
-+#ifdef HAVE_SHA256
-+	reading_sha256sums = 0;
-+#endif
-+
-+dont_reset_flags:
-+
-+	return ret;
-+}
-+
-+int
-+release_parse_from_stream(release_t *release, FILE *fp)
-+{
-+	int ret = 0;
-+	char *buf = NULL;
-+	size_t buflen, nread;
-+
-+	nread = getline(&buf, &buflen, fp);
-+	while ( nread != -1 ) {
-+		if (buf[nread-1] == '\n') buf[nread-1] = '\0';
-+		if (release_parse_line(release, buf))
-+                        opkg_msg(DEBUG, "Failed to parse release line for %s:\n\t%s\n",
-+					release->name, buf);
-+		nread = getline(&buf, &buflen, fp);
-+	}
-+
-+	if (!feof(fp)) {
-+		opkg_perror(ERROR, "Problems reading Release file for %sd\n", release->name);
-+		ret = -1;
-+	}
-+
-+	free(buf);
-+	return ret;
-+}
-+
-diff --git a/libopkg/release_parse.h b/libopkg/release_parse.h
-new file mode 100644
-index 0000000..5840df6
---- /dev/null
-+++ b/libopkg/release_parse.h
-@@ -0,0 +1,21 @@
-+/* release_parse.h - the opkg package management system
-+
-+   Copyright (C) 2010,2011 Javier Palacios
-+
-+   This program is free software; you can redistribute it and/or
-+   modify it under the terms of the GNU General Public License as
-+   published by the Free Software Foundation; either version 2, or (at
-+   your option) any later version.
-+
-+   This program is distributed in the hope that it will be useful, but
-+   WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+   General Public License for more details.
-+*/
-+
-+#ifndef RELEASE_PARSE_H
-+#define RELEASE_PARSE_H
-+
-+int release_parse_from_stream(release_t *release, FILE *fp);
-+
-+#endif
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0613-Fix-mistype-in-define-clause.patch b/patches/opkg-0.1.8/0613-Fix-mistype-in-define-clause.patch
deleted file mode 100644
index b1b9f49..0000000
--- a/patches/opkg-0.1.8/0613-Fix-mistype-in-define-clause.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 00c5a9ccefea37200e12a8ba42f106d47edc08fa Mon Sep 17 00:00:00 2001
-From: javiplx@gmail.com <javiplx@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 7 Apr 2011 15:51:52 +0000
-Subject: [PATCH] Fix mistype in define clause
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@613 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/release.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/release.c b/libopkg/release.c
-index 86f9a8d..1b6e838 100644
---- a/libopkg/release.c
-+++ b/libopkg/release.c
-@@ -305,7 +305,7 @@ release_verify_file(release_t *release, const char* file_name, const char *pathn
-      struct stat f_info;
-      char *f_md5 = NULL;
-      const char *md5 = release_get_md5(release, pathname);
--#ifndef HAVE_SHA256
-+#ifdef HAVE_SHA256
-      char *f_sha256 = NULL;
-      const char *sha256 = release_get_sha256(release, pathname);
- #endif
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0614-Introduce-a-new-pkg_src-list-in-global-configuration.patch b/patches/opkg-0.1.8/0614-Introduce-a-new-pkg_src-list-in-global-configuration.patch
deleted file mode 100644
index 033ed1f..0000000
--- a/patches/opkg-0.1.8/0614-Introduce-a-new-pkg_src-list-in-global-configuration.patch
+++ /dev/null
@@ -1,148 +0,0 @@
-From 0c51136398083908842f9faeb005cd5a5cc49273 Mon Sep 17 00:00:00 2001
-From: javiplx@gmail.com <javiplx@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 7 Apr 2011 15:53:24 +0000
-Subject: [PATCH] Introduce a new pkg_src list in global configuration to store the contents of 'dists' entries for apt-alike repositories
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@614 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_conf.c |   39 ++++++++++++++++++++++++++++++++++-----
- libopkg/opkg_conf.h |    1 +
- 2 files changed, 35 insertions(+), 5 deletions(-)
-
-diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
-index 864d2ac..4711ce7 100644
---- a/libopkg/opkg_conf.c
-+++ b/libopkg/opkg_conf.c
-@@ -185,13 +185,14 @@ opkg_conf_set_option(const char *name, const char *value)
- 
- static int
- opkg_conf_parse_file(const char *filename,
--				pkg_src_list_t *pkg_src_list)
-+				pkg_src_list_t *pkg_src_list,
-+				pkg_src_list_t *dist_src_list)
- {
-      int line_num = 0;
-      int err = 0;
-      FILE *file;
-      regex_t valid_line_re, comment_re;
--#define regmatch_size 12
-+#define regmatch_size 14
-      regmatch_t regmatch[regmatch_size];
- 
-      file = fopen(filename, "r");
-@@ -213,7 +214,7 @@ opkg_conf_parse_file(const char *filename,
- 		     "^[[:space:]]*(\"([^\"]*)\"|([^[:space:]]*))"
- 		     "[[:space:]]*(\"([^\"]*)\"|([^[:space:]]*))"
- 		     "[[:space:]]*(\"([^\"]*)\"|([^[:space:]]*))"
--		     "([[:space:]]+([^[:space:]]+))?[[:space:]]*$",
-+		     "([[:space:]]+([^[:space:]]+))?([[:space:]]+(.*))?[[:space:]]*$",
- 		     REG_EXTENDED);
-      if (err)
- 	  goto err2;
-@@ -264,10 +265,19 @@ opkg_conf_parse_file(const char *filename,
- 
- 	  extra = NULL;
- 	  if (regmatch[11].rm_so > 0) {
-+	     if (regmatch[13].rm_so > 0 && regmatch[13].rm_so!=regmatch[13].rm_eo )
-+	       extra = xstrndup (line + regmatch[11].rm_so,
-+				regmatch[13].rm_eo - regmatch[11].rm_so);
-+	     else
- 	       extra = xstrndup (line + regmatch[11].rm_so,
- 				regmatch[11].rm_eo - regmatch[11].rm_so);
- 	  }
- 
-+	  if (regmatch[13].rm_so!=regmatch[13].rm_eo && strncmp(type, "dist", 4)!=0) {
-+	       opkg_msg(ERROR, "%s:%d: Ignoring config line with trailing garbage: `%s'\n",
-+		       filename, line_num, line);
-+	  } else {
-+
- 	  /* We use the conf->tmp_dest_list below instead of
- 	     conf->pkg_dest_list because we might encounter an
- 	     offline_root option later and that would invalidate the
-@@ -276,6 +286,20 @@ opkg_conf_parse_file(const char *filename,
- 	     tmp_src_nv_pair_list for sake of symmetry.) */
- 	  if (strcmp(type, "option") == 0) {
- 	       opkg_conf_set_option(name, value);
-+ 	  } else if (strcmp(type, "dist") == 0) {
-+ 	       if (!nv_pair_list_find((nv_pair_list_t*) dist_src_list, name)) {
-+ 		    pkg_src_list_append (dist_src_list, name, value, extra, 0);
-+ 	       } else {
-+ 		    opkg_msg(ERROR, "Duplicate dist declaration (%s %s). "
-+ 				    "Skipping.\n", name, value);
-+ 	       }
-+ 	  } else if (strcmp(type, "dist/gz") == 0) {
-+ 	       if (!nv_pair_list_find((nv_pair_list_t*) dist_src_list, name)) {
-+ 		    pkg_src_list_append (dist_src_list, name, value, extra, 1);
-+ 	       } else {
-+ 		    opkg_msg(ERROR, "Duplicate dist declaration (%s %s). "
-+ 				    "Skipping.\n", name, value);
-+ 	       }
- 	  } else if (strcmp(type, "src") == 0) {
- 	       if (!nv_pair_list_find((nv_pair_list_t*) pkg_src_list, name)) {
- 		    pkg_src_list_append (pkg_src_list, name, value, extra, 0);
-@@ -307,6 +331,8 @@ opkg_conf_parse_file(const char *filename,
- 		       filename, line_num, line);
- 	  }
- 
-+	  }
-+
- 	  free(type);
- 	  free(name);
- 	  free(value);
-@@ -412,6 +438,7 @@ int
- opkg_conf_init(void)
- {
- 	pkg_src_list_init(&conf->pkg_src_list);
-+	pkg_src_list_init(&conf->dist_src_list);
- 	pkg_dest_list_init(&conf->pkg_dest_list);
- 	pkg_dest_list_init(&conf->tmp_dest_list);
- 	nv_pair_list_init(&conf->arch_list);
-@@ -443,7 +470,7 @@ opkg_conf_load(void)
- 			goto err0;
- 		}
- 		if (opkg_conf_parse_file(conf->conf_file,
--				&conf->pkg_src_list))
-+				&conf->pkg_src_list, &conf->dist_src_list))
- 			goto err1;
- 	}
- 
-@@ -472,7 +499,7 @@ opkg_conf_load(void)
- 					!strcmp(conf->conf_file, globbuf.gl_pathv[i]))
- 				continue;
- 		if ( opkg_conf_parse_file(globbuf.gl_pathv[i],
--			&conf->pkg_src_list)<0) {
-+			&conf->pkg_src_list, &conf->dist_src_list)<0) {
- 			globfree(&globbuf);
- 			goto err1;
- 		}
-@@ -576,6 +603,7 @@ err2:
- 	}
- err1:
- 	pkg_src_list_deinit(&conf->pkg_src_list);
-+	pkg_src_list_deinit(&conf->dist_src_list);
- 	pkg_dest_list_deinit(&conf->pkg_dest_list);
- 	nv_pair_list_deinit(&conf->arch_list);
- 
-@@ -617,6 +645,7 @@ opkg_conf_deinit(void)
- 		free(conf->conf_file);
- 
- 	pkg_src_list_deinit(&conf->pkg_src_list);
-+	pkg_src_list_deinit(&conf->dist_src_list);
- 	pkg_dest_list_deinit(&conf->pkg_dest_list);
- 	nv_pair_list_deinit(&conf->arch_list);
- 
-diff --git a/libopkg/opkg_conf.h b/libopkg/opkg_conf.h
-index 0340ff2..3a60bc5 100644
---- a/libopkg/opkg_conf.h
-+++ b/libopkg/opkg_conf.h
-@@ -45,6 +45,7 @@ extern opkg_conf_t *conf;
- struct opkg_conf
- {
-      pkg_src_list_t pkg_src_list;
-+     pkg_src_list_t dist_src_list;
-      pkg_dest_list_t pkg_dest_list;
-      pkg_dest_list_t tmp_dest_list;
-      nv_pair_list_t arch_list;
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0615-Download-all-the-valid-Packages-files-for-dist-entri.patch b/patches/opkg-0.1.8/0615-Download-all-the-valid-Packages-files-for-dist-entri.patch
deleted file mode 100644
index fcde21b..0000000
--- a/patches/opkg-0.1.8/0615-Download-all-the-valid-Packages-files-for-dist-entri.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-From 6474082c529d7dff6790062969d9e1056e66c566 Mon Sep 17 00:00:00 2001
-From: javiplx@gmail.com <javiplx@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 7 Apr 2011 16:07:25 +0000
-Subject: [PATCH] Download all the valid Packages files for dist entries
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@615 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_cmd.c |   37 +++++++++++++++++++++++++++++++++++++
- 1 files changed, 37 insertions(+), 0 deletions(-)
-
-diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
-index 8c04418..ce7cf5e 100644
---- a/libopkg/opkg_cmd.c
-+++ b/libopkg/opkg_cmd.c
-@@ -27,6 +27,7 @@
- #include "opkg_conf.h"
- #include "opkg_cmd.h"
- #include "opkg_message.h"
-+#include "release.h"
- #include "pkg.h"
- #include "pkg_dest.h"
- #include "pkg_parse.h"
-@@ -113,11 +114,47 @@ opkg_update_cmd(int argc, char **argv)
-      }
- 
- 
-+     for (iter = void_list_first(&conf->dist_src_list); iter; iter = void_list_next(&conf->dist_src_list, iter)) {
-+	  char *url, *list_file_name;
-+
-+	  src = (pkg_src_t *)iter->data;
-+
-+	  sprintf_alloc(&url, "%s/dists/%s/Release", src->value, src->name);
-+
-+	  sprintf_alloc(&list_file_name, "%s/%s", lists_dir, src->name);
-+	  err = opkg_download(url, list_file_name, NULL, NULL, 0);
-+	  if (!err) {
-+	       opkg_msg(NOTICE, "Downloaded release files for dist %s.\n",
-+			    src->name);
-+	       release_t *release = release_new(); 
-+	       err = release_init_from_file(release, list_file_name);
-+	       if (!err) {
-+		    if (!release_comps_supported(release, src->extra_data))
-+			 err = -1;
-+	       }
-+	       if (!err) {
-+		    err = release_download(release, src, lists_dir, tmp);
-+	       }
-+	       release_deinit(release); 
-+	       if (err)
-+		    unlink(list_file_name);
-+	  }
-+
-+	  if (err)
-+	       failures++;
-+
-+	  free(list_file_name);
-+	  free(url);
-+     }
-+
-      for (iter = void_list_first(&conf->pkg_src_list); iter; iter = void_list_next(&conf->pkg_src_list, iter)) {
- 	  char *url, *list_file_name;
- 
- 	  src = (pkg_src_t *)iter->data;
- 
-+	  if (src->extra_data && strcmp(src->extra_data, "__dummy__ "))
-+	      continue;
-+
- 	  if (src->extra_data)	/* debian style? */
- 	      sprintf_alloc(&url, "%s/%s/%s", src->value, src->extra_data,
- 			    src->gzip ? "Packages.gz" : "Packages");
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0616-Read-the-contents-of-lists-files-coming-from-dist-en.patch b/patches/opkg-0.1.8/0616-Read-the-contents-of-lists-files-coming-from-dist-en.patch
deleted file mode 100644
index 7b11fca..0000000
--- a/patches/opkg-0.1.8/0616-Read-the-contents-of-lists-files-coming-from-dist-en.patch
+++ /dev/null
@@ -1,121 +0,0 @@
-From cc24363fb731bf71f06d4d758df30216967efdb0 Mon Sep 17 00:00:00 2001
-From: javiplx@gmail.com <javiplx@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Thu, 7 Apr 2011 16:11:55 +0000
-Subject: [PATCH] Read the contents of lists files coming from 'dist' entries
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@616 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/pkg_hash.c |   63 +++++++++++++++++++++++++++++++++++++++++++++++++++-
- libopkg/pkg_hash.h |    1 +
- 2 files changed, 63 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c
-index b7f1573..2a76be8 100644
---- a/libopkg/pkg_hash.c
-+++ b/libopkg/pkg_hash.c
-@@ -18,6 +18,7 @@
- #include <stdio.h>
- 
- #include "hash_table.h"
-+#include "release.h"
- #include "pkg.h"
- #include "opkg_message.h"
- #include "pkg_vec.h"
-@@ -70,6 +71,32 @@ pkg_hash_deinit(void)
- }
- 
- int
-+dist_hash_add_from_file(const char *lists_dir, pkg_src_t *dist)
-+{
-+	nv_pair_list_elt_t *l;
-+	char *list_file, *subname;
-+
-+	list_for_each_entry(l , &conf->arch_list.head, node) {
-+		nv_pair_t *nv = (nv_pair_t *)l->data;
-+		sprintf_alloc(&subname, "%s-%s", dist->name, nv->name);
-+		sprintf_alloc(&list_file, "%s/%s", lists_dir, subname);
-+
-+		if (file_exists(list_file)) {
-+			if (pkg_hash_add_from_file(list_file, dist, NULL, 0)) {
-+				free(list_file);
-+				return -1;
-+			}
-+			pkg_src_list_append (&conf->pkg_src_list, subname, dist->value, "__dummy__", 0);
-+		}
-+
-+		free(list_file);
-+	}
-+
-+	return 0;
-+}
-+
-+
-+int
- pkg_hash_add_from_file(const char *file_name,
- 			pkg_src_t *src, pkg_dest_t *dest, int is_status_file)
- {
-@@ -131,7 +158,7 @@ int
- pkg_hash_load_feeds(void)
- {
- 	pkg_src_list_elt_t *iter;
--	pkg_src_t *src;
-+	pkg_src_t *src, *subdist;
- 	char *list_file, *lists_dir;
- 
- 	opkg_msg(INFO, "\n");
-@@ -139,6 +166,40 @@ pkg_hash_load_feeds(void)
- 	lists_dir = conf->restrict_to_default_dest ?
- 		conf->default_dest->lists_dir : conf->lists_dir;
- 
-+	for (iter = void_list_first(&conf->dist_src_list); iter;
-+			iter = void_list_next(&conf->dist_src_list, iter)) {
-+
-+		src = (pkg_src_t *)iter->data;
-+
-+		sprintf_alloc(&list_file, "%s/%s", lists_dir, src->name);
-+
-+		if (file_exists(list_file)) {
-+			int i;
-+			release_t *release = release_new();
-+			if(release_init_from_file(release, list_file)) {
-+				free(list_file);
-+				return -1;
-+			}
-+
-+			unsigned int ncomp;
-+			const char **comps = release_comps(release, &ncomp);
-+			subdist = (pkg_src_t *) xmalloc(sizeof(pkg_src_t));
-+			memcpy(subdist, src, sizeof(pkg_src_t));
-+
-+			for(i = 0; i < ncomp; i++){
-+				subdist->name = NULL;
-+				sprintf_alloc(&subdist->name, "%s-%s", src->name, comps[i]);
-+				if (dist_hash_add_from_file(lists_dir, subdist)) {
-+					free(subdist->name); free(subdist);
-+					free(list_file);
-+					return -1;
-+				}
-+			}
-+			free(subdist->name); free(subdist);
-+		}
-+		free(list_file);
-+	}
-+
- 	for (iter = void_list_first(&conf->pkg_src_list); iter;
- 			iter = void_list_next(&conf->pkg_src_list, iter)) {
- 
-diff --git a/libopkg/pkg_hash.h b/libopkg/pkg_hash.h
-index 1165d83..b3cf3d1 100644
---- a/libopkg/pkg_hash.h
-+++ b/libopkg/pkg_hash.h
-@@ -29,6 +29,7 @@ void pkg_hash_deinit(void);
- 
- void pkg_hash_fetch_available(pkg_vec_t *available);
- 
-+int dist_hash_add_from_file(const char *file_name, pkg_src_t *dist);
- int pkg_hash_add_from_file(const char *file_name, pkg_src_t *src,
- 		pkg_dest_t *dest, int is_status_file);
- int pkg_hash_load_feeds(void);
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0617-Don-t-include-the-source-URI-in-the-cached-filename.patch b/patches/opkg-0.1.8/0617-Don-t-include-the-source-URI-in-the-cached-filename.patch
deleted file mode 100644
index 242268e..0000000
--- a/patches/opkg-0.1.8/0617-Don-t-include-the-source-URI-in-the-cached-filename.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From d46db43e215d8f3b26e04c99f113db065040ef4c Mon Sep 17 00:00:00 2001
-From: graham.gower@gmail.com <graham.gower@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Fri, 8 Apr 2011 04:30:10 +0000
-Subject: [PATCH] Don't include the source URI in the cached filename.
-
-This avoids multiple downloads in the case where a repository is simply a
-mirror of another. The old, uri mangled, filename is still checked to ensure
-backwards compatibility with existing caches.
-
-Patch from robert.melchers@gmail.com.
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@617 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_download.c |   21 +++++++++++++++++----
- 1 files changed, 17 insertions(+), 4 deletions(-)
-
-diff --git a/libopkg/opkg_download.c b/libopkg/opkg_download.c
-index b9533aa..a1b8341 100644
---- a/libopkg/opkg_download.c
-+++ b/libopkg/opkg_download.c
-@@ -215,10 +215,23 @@ opkg_download_cache(const char *src, const char *dest_file_name,
-     if (file_exists(cache_location))
- 	opkg_msg(NOTICE, "Copying %s.\n", cache_location);
-     else {
--	err = opkg_download(src, cache_location, cb, data, 0);
--	if (err) {
--	    (void) unlink(cache_location);
--	    goto out2;
-+       /* cache file with funky name not found, try simple name */
-+        free(cache_name);
-+        char *filename = strrchr(dest_file_name,'/');
-+        if (filename)
-+           cache_name = xstrdup(filename+1); // strip leading '/'
-+        else
-+           cache_name = xstrdup(dest_file_name);
-+        free(cache_location);
-+        sprintf_alloc(&cache_location, "%s/%s", conf->cache, cache_name);
-+        if (file_exists(cache_location))
-+           opkg_msg(NOTICE, "Copying %s.\n", cache_location);
-+        else  {
-+ 	    err = opkg_download(src, cache_location, cb, data);
-+	    if (err) {
-+	       (void) unlink(cache_location);
-+	       goto out2;
-+	  }
- 	}
-     }
- 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0618-Fix-compilation-after-r617.patch b/patches/opkg-0.1.8/0618-Fix-compilation-after-r617.patch
deleted file mode 100644
index 5e72f95..0000000
--- a/patches/opkg-0.1.8/0618-Fix-compilation-after-r617.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 9c97d5ecd795709c8584e972bfdf3aee3a5b846d Mon Sep 17 00:00:00 2001
-From: google@wwsnet.net <google@wwsnet.net@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Fri, 8 Apr 2011 13:33:11 +0000
-Subject: [PATCH] Fix compilation after r617
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@618 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/opkg_download.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libopkg/opkg_download.c b/libopkg/opkg_download.c
-index a1b8341..4a8b2a2 100644
---- a/libopkg/opkg_download.c
-+++ b/libopkg/opkg_download.c
-@@ -227,7 +227,7 @@ opkg_download_cache(const char *src, const char *dest_file_name,
-         if (file_exists(cache_location))
-            opkg_msg(NOTICE, "Copying %s.\n", cache_location);
-         else  {
-- 	    err = opkg_download(src, cache_location, cb, data);
-+ 	    err = opkg_download(src, cache_location, cb, data, 0);
- 	    if (err) {
- 	       (void) unlink(cache_location);
- 	       goto out2;
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0619-Move-pkg_parse_from_stream_nomalloc-into-parse_util.patch b/patches/opkg-0.1.8/0619-Move-pkg_parse_from_stream_nomalloc-into-parse_util.patch
deleted file mode 100644
index e2bc20b..0000000
--- a/patches/opkg-0.1.8/0619-Move-pkg_parse_from_stream_nomalloc-into-parse_util.patch
+++ /dev/null
@@ -1,289 +0,0 @@
-From 408a9ff806c905990d41194b57368e2a751b60fc Mon Sep 17 00:00:00 2001
-From: javiplx@gmail.com <javiplx@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 26 Apr 2011 11:28:41 +0000
-Subject: [PATCH] Move pkg_parse_from_stream_nomalloc into parse_util
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@619 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/parse_util.c |   81 +++++++++++++++++++++++++++++++++++++++++++
- libopkg/parse_util.h |    5 +++
- libopkg/pkg_hash.c   |    7 +++-
- libopkg/pkg_parse.c  |   93 +++----------------------------------------------
- libopkg/pkg_parse.h  |    3 +-
- 5 files changed, 99 insertions(+), 90 deletions(-)
-
-diff --git a/libopkg/parse_util.c b/libopkg/parse_util.c
-index e01b124..538bb11 100644
---- a/libopkg/parse_util.c
-+++ b/libopkg/parse_util.c
-@@ -22,6 +22,7 @@
- #include "libbb/libbb.h"
- 
- #include "parse_util.h"
-+#include "pkg_parse.h"
- 
- int
- is_field(const char *type, const char *line)
-@@ -86,3 +87,83 @@ parse_list(const char *raw, unsigned int *count, const char sep, int skip_field)
- 	*count = line_count;
- 	return depends;
- }
-+
-+int
-+parse_from_stream_nomalloc(pkg_t *pkg, FILE *fp, uint mask,
-+						char **buf0, size_t buf0len)
-+{
-+	int ret, lineno;
-+	char *buf, *nl;
-+	size_t buflen;
-+
-+	lineno = 1;
-+	ret = 0;
-+
-+	buflen = buf0len;
-+	buf = *buf0;
-+	buf[0] = '\0';
-+
-+	while (1) {
-+		if (fgets(buf, (int)buflen, fp) == NULL) {
-+			if (ferror(fp)) {
-+				opkg_perror(ERROR, "fgets");
-+				ret = -1;
-+			} else if (strlen(*buf0) == buf0len-1) {
-+				opkg_msg(ERROR, "Missing new line character"
-+						" at end of file!\n");
-+				pkg_parse_line(pkg, *buf0, mask);
-+			}
-+			break;
-+		}
-+
-+		nl = strchr(buf, '\n');
-+		if (nl == NULL) {
-+			if (strlen(buf) < buflen-1) {
-+				/*
-+				 * Line could be exactly buflen-1 long and
-+				 * missing a newline, but we won't know until
-+				 * fgets fails to read more data.
-+				 */
-+				opkg_msg(ERROR, "Missing new line character"
-+						" at end of file!\n");
-+				pkg_parse_line(pkg, *buf0, mask);
-+				break;
-+			}
-+			if (buf0len >= EXCESSIVE_LINE_LEN) {
-+				opkg_msg(ERROR, "Excessively long line at "
-+					"%d. Corrupt file?\n",
-+					lineno);
-+				ret = -1;
-+				break;
-+			}
-+
-+			/*
-+			 * Realloc and point buf past the data already read,
-+			 * at the NULL terminator inserted by fgets.
-+			 * |<--------------- buf0len ----------------->|
-+			 * |                     |<------- buflen ---->|
-+			 * |---------------------|---------------------|
-+			 * buf0                   buf
-+			 */
-+			buflen = buf0len +1;
-+			buf0len *= 2;
-+			*buf0 = xrealloc(*buf0, buf0len);
-+			buf = *buf0 + buflen -2;
-+
-+			continue;
-+		}
-+
-+		*nl = '\0';
-+
-+		lineno++;
-+
-+		if (pkg_parse_line(pkg, *buf0, mask))
-+			break;
-+
-+		buf = *buf0;
-+		buflen = buf0len;
-+		buf[0] = '\0';
-+	}
-+
-+	return ret;
-+}
-diff --git a/libopkg/parse_util.h b/libopkg/parse_util.h
-index e4e2abe..d1aba4c 100644
---- a/libopkg/parse_util.h
-+++ b/libopkg/parse_util.h
-@@ -18,8 +18,13 @@
- #ifndef PARSE_UTIL_H
- #define PARSE_UTIL_H
- 
-+#include "pkg.h"
-+
- int is_field(const char *type, const char *line);
- char *parse_simple(const char *type, const char *line);
- char **parse_list(const char *raw, unsigned int *count, const char sep, int skip_field);
- 
-+int parse_from_stream_nomalloc(pkg_t *pkg, FILE *fp, uint mask,
-+						char **buf0, size_t buf0len);
-+
- #endif
-diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c
-index 2a76be8..3e4d9d4 100644
---- a/libopkg/pkg_hash.c
-+++ b/libopkg/pkg_hash.c
-@@ -23,6 +23,7 @@
- #include "opkg_message.h"
- #include "pkg_vec.h"
- #include "pkg_hash.h"
-+#include "parse_util.h"
- #include "pkg_parse.h"
- #include "opkg_utils.h"
- #include "sprintf_alloc.h"
-@@ -119,8 +120,12 @@ pkg_hash_add_from_file(const char *file_name,
- 		pkg->src = src;
- 		pkg->dest = dest;
- 
--		ret = pkg_parse_from_stream_nomalloc(pkg, fp, 0,
-+		ret = parse_from_stream_nomalloc(pkg, fp, 0,
- 				&buf, len);
-+		if (pkg->name == NULL) {
-+			/* probably just a blank line */
-+			ret = 1;
-+		}
- 		if (ret) {
- 			pkg_deinit (pkg);
- 			free(pkg);
-diff --git a/libopkg/pkg_parse.c b/libopkg/pkg_parse.c
-index e0d7fce..3f188a8 100644
---- a/libopkg/pkg_parse.c
-+++ b/libopkg/pkg_parse.c
-@@ -104,7 +104,7 @@ get_arch_priority(const char *arch)
- 	return 0;
- }
- 
--static int
-+int
- pkg_parse_line(pkg_t *pkg, const char *line, uint mask)
- {
- 	/* these flags are a bit hackish... */
-@@ -266,91 +266,6 @@ dont_reset_flags:
- }
- 
- int
--pkg_parse_from_stream_nomalloc(pkg_t *pkg, FILE *fp, uint mask,
--						char **buf0, size_t buf0len)
--{
--	int ret, lineno;
--	char *buf, *nl;
--	size_t buflen;
--
--	lineno = 1;
--	ret = 0;
--
--	buflen = buf0len;
--	buf = *buf0;
--	buf[0] = '\0';
--
--	while (1) {
--		if (fgets(buf, (int)buflen, fp) == NULL) {
--			if (ferror(fp)) {
--				opkg_perror(ERROR, "fgets");
--				ret = -1;
--			} else if (strlen(*buf0) == buf0len-1) {
--				opkg_msg(ERROR, "Missing new line character"
--						" at end of file!\n");
--				pkg_parse_line(pkg, *buf0, mask);
--			}
--			break;
--		}
--
--		nl = strchr(buf, '\n');
--		if (nl == NULL) {
--			if (strlen(buf) < buflen-1) {
--				/*
--				 * Line could be exactly buflen-1 long and
--				 * missing a newline, but we won't know until
--				 * fgets fails to read more data.
--				 */
--				opkg_msg(ERROR, "Missing new line character"
--						" at end of file!\n");
--				pkg_parse_line(pkg, *buf0, mask);
--				break;
--			}
--			if (buf0len >= EXCESSIVE_LINE_LEN) {
--				opkg_msg(ERROR, "Excessively long line at "
--					"%d. Corrupt file?\n",
--					lineno);
--				ret = -1;
--				break;
--			}
--
--			/*
--			 * Realloc and point buf past the data already read,
--			 * at the NULL terminator inserted by fgets.
--			 * |<--------------- buf0len ----------------->|
--			 * |                     |<------- buflen ---->|
--			 * |---------------------|---------------------|
--			 * buf0                   buf
--			 */
--			buflen = buf0len +1;
--			buf0len *= 2;
--			*buf0 = xrealloc(*buf0, buf0len);
--			buf = *buf0 + buflen -2;
--
--			continue;
--		}
--
--		*nl = '\0';
--
--		lineno++;
--
--		if (pkg_parse_line(pkg, *buf0, mask))
--			break;
--
--		buf = *buf0;
--		buflen = buf0len;
--		buf[0] = '\0';
--	}
--
--	if (pkg->name == NULL) {
--		/* probably just a blank line */
--		ret = 1;
--	}
--
--	return ret;
--}
--
--int
- pkg_parse_from_stream(pkg_t *pkg, FILE *fp, uint mask)
- {
- 	int ret;
-@@ -358,7 +273,11 @@ pkg_parse_from_stream(pkg_t *pkg, FILE *fp, uint mask)
- 	const size_t len = 4096;
- 
- 	buf = xmalloc(len);
--	ret = pkg_parse_from_stream_nomalloc(pkg, fp, mask, &buf, len);
-+	ret = parse_from_stream_nomalloc(pkg, fp, mask, &buf, len);
-+	if (pkg->name == NULL) {
-+		/* probably just a blank line */
-+		ret = 1;
-+	}
- 	free(buf);
- 
- 	return ret;
-diff --git a/libopkg/pkg_parse.h b/libopkg/pkg_parse.h
-index 7020a90..f477375 100644
---- a/libopkg/pkg_parse.h
-+++ b/libopkg/pkg_parse.h
-@@ -20,8 +20,7 @@
- 
- int parse_version(pkg_t *pkg, const char *raw);
- int pkg_parse_from_stream(pkg_t *pkg, FILE *fp, uint mask);
--int pkg_parse_from_stream_nomalloc(pkg_t *pkg, FILE *fp, uint mask,
--						char **buf0, size_t buf0len);
-+int pkg_parse_line(pkg_t *pkg, const char *line, uint mask);
- 
- #define EXCESSIVE_LINE_LEN	(4096 << 8)
- 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0620-Introduce-a-specific-pointer-typedef-for-parse_line-.patch b/patches/opkg-0.1.8/0620-Introduce-a-specific-pointer-typedef-for-parse_line-.patch
deleted file mode 100644
index 20fffb9..0000000
--- a/patches/opkg-0.1.8/0620-Introduce-a-specific-pointer-typedef-for-parse_line-.patch
+++ /dev/null
@@ -1,152 +0,0 @@
-From bcf06b0c94483291a280c82242ecbd634cb3a921 Mon Sep 17 00:00:00 2001
-From: javiplx@gmail.com <javiplx@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 26 Apr 2011 13:45:15 +0000
-Subject: [PATCH] Introduce a specific pointer typedef for parse_line functions
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@620 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/parse_util.c |    9 ++++-----
- libopkg/parse_util.h |    7 ++++---
- libopkg/pkg_hash.c   |    2 +-
- libopkg/pkg_parse.c  |    7 ++++---
- libopkg/pkg_parse.h  |    6 +++---
- 5 files changed, 16 insertions(+), 15 deletions(-)
-
-diff --git a/libopkg/parse_util.c b/libopkg/parse_util.c
-index 538bb11..54850a8 100644
---- a/libopkg/parse_util.c
-+++ b/libopkg/parse_util.c
-@@ -22,7 +22,6 @@
- #include "libbb/libbb.h"
- 
- #include "parse_util.h"
--#include "pkg_parse.h"
- 
- int
- is_field(const char *type, const char *line)
-@@ -89,7 +88,7 @@ parse_list(const char *raw, unsigned int *count, const char sep, int skip_field)
- }
- 
- int
--parse_from_stream_nomalloc(pkg_t *pkg, FILE *fp, uint mask,
-+parse_from_stream_nomalloc(parse_line_t parse_line, void *ptr, FILE *fp, uint mask,
- 						char **buf0, size_t buf0len)
- {
- 	int ret, lineno;
-@@ -111,7 +110,7 @@ parse_from_stream_nomalloc(pkg_t *pkg, FILE *fp, uint mask,
- 			} else if (strlen(*buf0) == buf0len-1) {
- 				opkg_msg(ERROR, "Missing new line character"
- 						" at end of file!\n");
--				pkg_parse_line(pkg, *buf0, mask);
-+				parse_line(ptr, *buf0, mask);
- 			}
- 			break;
- 		}
-@@ -126,7 +125,7 @@ parse_from_stream_nomalloc(pkg_t *pkg, FILE *fp, uint mask,
- 				 */
- 				opkg_msg(ERROR, "Missing new line character"
- 						" at end of file!\n");
--				pkg_parse_line(pkg, *buf0, mask);
-+				parse_line(ptr, *buf0, mask);
- 				break;
- 			}
- 			if (buf0len >= EXCESSIVE_LINE_LEN) {
-@@ -157,7 +156,7 @@ parse_from_stream_nomalloc(pkg_t *pkg, FILE *fp, uint mask,
- 
- 		lineno++;
- 
--		if (pkg_parse_line(pkg, *buf0, mask))
-+		if (parse_line(ptr, *buf0, mask))
- 			break;
- 
- 		buf = *buf0;
-diff --git a/libopkg/parse_util.h b/libopkg/parse_util.h
-index d1aba4c..26e2d5b 100644
---- a/libopkg/parse_util.h
-+++ b/libopkg/parse_util.h
-@@ -18,13 +18,14 @@
- #ifndef PARSE_UTIL_H
- #define PARSE_UTIL_H
- 
--#include "pkg.h"
--
- int is_field(const char *type, const char *line);
- char *parse_simple(const char *type, const char *line);
- char **parse_list(const char *raw, unsigned int *count, const char sep, int skip_field);
- 
--int parse_from_stream_nomalloc(pkg_t *pkg, FILE *fp, uint mask,
-+typedef int (*parse_line_t)(void *, const char *, uint);
-+int parse_from_stream_nomalloc(parse_line_t parse_line, void *item, FILE *fp, uint mask,
- 						char **buf0, size_t buf0len);
- 
-+#define EXCESSIVE_LINE_LEN	(4096 << 8)
-+
- #endif
-diff --git a/libopkg/pkg_hash.c b/libopkg/pkg_hash.c
-index 3e4d9d4..e08840b 100644
---- a/libopkg/pkg_hash.c
-+++ b/libopkg/pkg_hash.c
-@@ -120,7 +120,7 @@ pkg_hash_add_from_file(const char *file_name,
- 		pkg->src = src;
- 		pkg->dest = dest;
- 
--		ret = parse_from_stream_nomalloc(pkg, fp, 0,
-+		ret = parse_from_stream_nomalloc(pkg_parse_line, pkg, fp, 0,
- 				&buf, len);
- 		if (pkg->name == NULL) {
- 			/* probably just a blank line */
-diff --git a/libopkg/pkg_parse.c b/libopkg/pkg_parse.c
-index 3f188a8..406220b 100644
---- a/libopkg/pkg_parse.c
-+++ b/libopkg/pkg_parse.c
-@@ -21,7 +21,6 @@
- #include <stdio.h>
- #include <ctype.h>
- 
--#include "pkg.h"
- #include "opkg_utils.h"
- #include "pkg_parse.h"
- #include "libbb/libbb.h"
-@@ -105,8 +104,10 @@ get_arch_priority(const char *arch)
- }
- 
- int
--pkg_parse_line(pkg_t *pkg, const char *line, uint mask)
-+pkg_parse_line(void *ptr, const char *line, uint mask)
- {
-+	pkg_t *pkg = (pkg_t *) ptr;
-+
- 	/* these flags are a bit hackish... */
- 	static int reading_conffiles = 0, reading_description = 0;
- 	int ret = 0;
-@@ -273,7 +274,7 @@ pkg_parse_from_stream(pkg_t *pkg, FILE *fp, uint mask)
- 	const size_t len = 4096;
- 
- 	buf = xmalloc(len);
--	ret = parse_from_stream_nomalloc(pkg, fp, mask, &buf, len);
-+	ret = parse_from_stream_nomalloc(pkg_parse_line, pkg, fp, mask, &buf, len);
- 	if (pkg->name == NULL) {
- 		/* probably just a blank line */
- 		ret = 1;
-diff --git a/libopkg/pkg_parse.h b/libopkg/pkg_parse.h
-index f477375..4e2b8e0 100644
---- a/libopkg/pkg_parse.h
-+++ b/libopkg/pkg_parse.h
-@@ -18,11 +18,11 @@
- #ifndef PKG_PARSE_H
- #define PKG_PARSE_H
- 
-+#include "pkg.h"
-+
- int parse_version(pkg_t *pkg, const char *raw);
- int pkg_parse_from_stream(pkg_t *pkg, FILE *fp, uint mask);
--int pkg_parse_line(pkg_t *pkg, const char *line, uint mask);
--
--#define EXCESSIVE_LINE_LEN	(4096 << 8)
-+int pkg_parse_line(void *ptr, const char *line, uint mask);
- 
- /* package field mask */
- #define PFM_ARCHITECTURE	(1 << 1)
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/0621-Modify-Release-file-parsing-to-use-parse_from_stream.patch b/patches/opkg-0.1.8/0621-Modify-Release-file-parsing-to-use-parse_from_stream.patch
deleted file mode 100644
index d2a1175..0000000
--- a/patches/opkg-0.1.8/0621-Modify-Release-file-parsing-to-use-parse_from_stream.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From 82779432519ebc597fc7b74b4e6313fabd3cb9e0 Mon Sep 17 00:00:00 2001
-From: javiplx@gmail.com <javiplx@gmail.com@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>
-Date: Tue, 26 Apr 2011 13:48:21 +0000
-Subject: [PATCH] Modify Release file parsing to use parse_from_stream_nomalloc
-
-git-svn-id: http://opkg.googlecode.com/svn/trunk@621 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
----
- libopkg/release_parse.c |   27 +++++++++------------------
- 1 files changed, 9 insertions(+), 18 deletions(-)
-
-diff --git a/libopkg/release_parse.c b/libopkg/release_parse.c
-index e1d9a84..f411045 100644
---- a/libopkg/release_parse.c
-+++ b/libopkg/release_parse.c
-@@ -23,8 +23,10 @@
- #include "parse_util.h"
- 
- static int
--release_parse_line(release_t *release, const char *line)
-+release_parse_line(void *ptr, const char *line, uint mask)
- {
-+	release_t *release = (release_t *) ptr;
-+
- 	int ret = 0;
- 	unsigned int count = 0;
- 	char **list = 0;
-@@ -111,25 +113,14 @@ dont_reset_flags:
- int
- release_parse_from_stream(release_t *release, FILE *fp)
- {
--	int ret = 0;
--	char *buf = NULL;
--	size_t buflen, nread;
--
--	nread = getline(&buf, &buflen, fp);
--	while ( nread != -1 ) {
--		if (buf[nread-1] == '\n') buf[nread-1] = '\0';
--		if (release_parse_line(release, buf))
--                        opkg_msg(DEBUG, "Failed to parse release line for %s:\n\t%s\n",
--					release->name, buf);
--		nread = getline(&buf, &buflen, fp);
--	}
--
--	if (!feof(fp)) {
--		opkg_perror(ERROR, "Problems reading Release file for %sd\n", release->name);
--		ret = -1;
--	}
-+	int ret;
-+	char *buf;
-+	const size_t len = 4096;
- 
-+	buf = xmalloc(len);
-+	ret = parse_from_stream_nomalloc(release_parse_line, release, fp, 0, &buf, len);
- 	free(buf);
-+
- 	return ret;
- }
- 
--- 
-1.7.1
-
diff --git a/patches/opkg-0.1.8/autogen.sh b/patches/opkg-0.1.8/autogen.sh
deleted file mode 120000
index 9f8a4cb..0000000
--- a/patches/opkg-0.1.8/autogen.sh
+++ /dev/null
@@ -1 +0,0 @@
-../autogen.sh
\ No newline at end of file
diff --git a/patches/opkg-0.1.8/series b/patches/opkg-0.1.8/series
deleted file mode 100644
index 905917e..0000000
--- a/patches/opkg-0.1.8/series
+++ /dev/null
@@ -1,92 +0,0 @@
-0525-Downgrade-message-from-ERROR-to-NOTICE.patch
-0526-Upgrade-message-from-NOTICE-to-ERROR.patch
-0527-Don-t-use-c-reserved-word-in-header.-Remove-void-cas.patch
-0528-Don-t-try-to-print-cmd_name-before-its-initialised.-.patch
-0529-Add-a-message-for-the-case-that-no-installation-cand.patch
-0530-Bump-maximum-message-length-from-256-to-4096.patch
-0531-Check-that-a-file-belongs-to-the-package-before-remo.patch
-0532-Fix-check_data_file_clashes-for-offline-root-mode.-a.patch
-0533-Correctly-update-the-obs_file_hash-in-offline-root-m.patch
-0534-String-the-offline-root-path-from-the-file_name-in-f.patch
-0535-Promote-file-removal-message-from-INFO-to-NOTICE.patch
-0536-Claim-ownership-of-a-file-if-the-previous-owner-has-.patch
-0537-Minor-cleanup-simplification.patch
-0538-Fix-force-reinstall-by-removing-special-case-code.-J.patch
-0539-s-ipkgetcdir-opkgetcdir.patch
-0540-Improve-error-propagation.patch
-0541-Be-consistent-in-how-to-check-return-codes-for-these.patch
-0542-Don-t-unlink-the-lock-file-in-the-event-that-it-cann.patch
-0543-Fix-infinite-loop-in-list_upgradable-in-libopkg.patch
-0544-Fix-creation-of-symlinks-to-files-with-long-names-gr.patch
-0545-This-was-done-some-time-ago.patch
-0546-This-will-never-be-done-offline-roots-often-point-at.patch
-0547-Add-man-pages-for-opkg-cl-and-opkg-keys.-From-David-.patch
-0548-Forgot-these-two-files-in-the-last-commit.-Oops.patch
-0549-And-remove-the-autogenerated-files.patch
-0550-Fix-segfault-using-the-verbosity-option.patch
-0551-Remove-outdated-comment-regarding-an-old-bug.patch
-0552-Remove-trailing-whitespace.-Sorry-if-this-breaks-you.patch
-0553-Allow-blacklisting-a-package-in-the-status-file.patch
-#0554-Add-generated-man-pages-to-.gitignore.patch
-0555-Ensure-Pre-Depended-and-Recommended-packages-can-be-.patch
-0556-Add-Recommended-packages-to-the-depended_upon_by-fie.patch
-0557-Remove-stray-semicolon.patch
-0558-Accept-a-leading-.-for-the-control-file-name-but-don.patch
-0559-implement-force-postinstall-option-this-allows-forci.patch
-0560-fix-compile-issues-on-OS-X-and-FreeBSD.patch
-0561-split-the-loading-part-of-opkg_conf_init-out-into-op.patch
-0562-utilize-opkg_conf_init-to-initialize-the-pair-lists-.patch
-0563-update-manpages-to-reflect-r559-and-r562.patch
-0564-mask-PFM_FOO-should-instead-be-mask-PFM_FOO.patch
-0565-Use-uppercase-M-for-printing-maintainer-field-to-be-.patch
-0566-Add-simple-regression-testing-code-and-tests-for-som.patch
-0569-Disable-sha256-code-by-default.-This-makes-opkg-GPLv.patch
-0570-Don-t-call-opkg_conf_deinit-if-opkg_conf_init-fails.patch
-0572-Revert-Don-t-call-opkg_conf_deinit-if-opkg_conf_init.patch
-0573-A-proper-fix-this-time.-From-Sergey-Jin-Bostandzhyan.patch
-0574-Remove-dead-code-sprintf_alloc-cannot-fail.-Opkg-wil.patch
-0576-Implement-list-changed-conffiles-command-based-on-pa.patch
-0577-Remove-an-erroneous-comment.patch
-0578-This-is-not-a-bug-any-longer.patch
-0579-opkg_find_package-should-not-return-garbage-if-it-ca.patch
-0580-Fix-indentation.patch
-0581-Rewrite-sprintf_alloc.patch
-0582-Check-return-codes-from-vsnprintf-and-vfprintf.patch
-0583-Remove-an-unnecessary-allocation.patch
-0584-Use-printf-format-specifier-attribute-for-opkg_messa.patch
-0585-Fix-formatting-issues-found-with-the-last-commit.patch
-0586-Print-the-package-name-corresponding-to-a-failed-scr.patch
-0587-Abort-package-removal-if-the-prerm-script-of-a-packa.patch
-0588-Fix-if-statement-with-empty-body-due-to-stray-semico.patch
-0589-Fix-missing-declarations-found-by-Clang.patch
-0590-Remove-stray-exit-in-the-regress-test.patch
-0591-Don-t-print-the-function-name-when-just-outputting-a.patch
-#0592-Don-t-gitignore-the-regress-Makefile.patch
-0593-Add-regress-test-for-issue72.patch
-0594-Don-t-truncate-long-symlink-paths.patch
-0595-Fix-potential-undefined-references-to-FILE-for-libop.patch
-0596-Create-the-regress-offline_root-from-scratch.patch
-0598-Fixed-a-bug-causing-segfaults-when-an-upgraded-packa.patch
-0599-Fix-depmod-intercept.-Patch-from-Andreas-Oberritter.patch
-0600-Add-missing-space.patch
-0601-Add-overlay_root-config-option.-Opkg-checks-this-loc.patch
-0602-Call-gpgme_check_version-before-using-other-gpgpe-fu.patch
-0603-Delete-package-sources-that-fail-the-signature-check.patch
-0604-Allow-vfork-ing-an-external-gunzip-binary-instead-of.patch
-0605-Get-the-owner-of-the-file_name-after-the-offline-roo.patch
-0606-List-some-sub-commands-that-were-missing-from-the-he.patch
-0607-Add-regress-test-for-the-bug-from-r605.patch
-0608-Fix-memory-leak-when-defined-HAVE_GPGME-and-defined-.patch
-0609-Fix-opkg_re_read_config_files.patch
-0610-Add-flag-in-opkg_download-calls-to-reduce-the-severi.patch
-0611-Create-parse_util-with-some-of-the-non-public-functi.patch
-0612-Code-to-handle-the-apt-alike-configuration-entries.patch
-0613-Fix-mistype-in-define-clause.patch
-0614-Introduce-a-new-pkg_src-list-in-global-configuration.patch
-0615-Download-all-the-valid-Packages-files-for-dist-entri.patch
-0616-Read-the-contents-of-lists-files-coming-from-dist-en.patch
-0617-Don-t-include-the-source-URI-in-the-cached-filename.patch
-0618-Fix-compilation-after-r617.patch
-0619-Move-pkg_parse_from_stream_nomalloc-into-parse_util.patch
-0620-Introduce-a-specific-pointer-typedef-for-parse_line-.patch
-0621-Modify-Release-file-parsing-to-use-parse_from_stream.patch
diff --git a/rules/opkg.make b/rules/opkg.make
index 29719e4..a433054 100644
--- a/rules/opkg.make
+++ b/rules/opkg.make
@@ -16,11 +16,11 @@ PACKAGES-$(PTXCONF_OPKG) += opkg
 #
 # Paths and names
 #
-OPKG_VERSION	:= 0.1.8
-OPKG_MD5	:= c714ce0e4863bf1315e3b6913ffe3299
+OPKG_VERSION	:= 0.2.0
+OPKG_MD5	:= e8a6fd34fb2529191fe09dc14c934cc3
 OPKG		:= opkg-$(OPKG_VERSION)
 OPKG_SUFFIX	:= tar.gz
-OPKG_URL	:= http://opkg.googlecode.com/files/$(OPKG).$(OPKG_SUFFIX)
+OPKG_URL	:= https://opkg.googlecode.com/files/$(OPKG).$(OPKG_SUFFIX)
 OPKG_SOURCE	:= $(SRCDIR)/$(OPKG).$(OPKG_SUFFIX)
 OPKG_DIR	:= $(BUILDDIR)/$(OPKG)
 
-- 
1.8.5.2


-- 
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-01-23 16:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-14  7:19 [ptxdist] [PATCH 1/4] opkg: version bump 0.1.8 -> 0.2.0 Robert Schwebel
2014-01-14  7:19 ` [ptxdist] [PATCH 2/4] host-opkg-utils: version bump Robert Schwebel
2014-01-14  7:19 ` [ptxdist] [PATCH 3/4] chrony: version bump 1.24-pre2 -> 1.29 Robert Schwebel
2014-01-14  7:19 ` [ptxdist] [PATCH 4/4] chrony: remove duplicate targetinstall for chrony_command Robert Schwebel
2014-01-23 16:50   ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox