From 3858195c0ec3432e0fd65c7c3a58e7ec01125fdb Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 06 Apr 2019 12:04:42 -0400 Subject: patches: Allow overriding opkg state dir prefix --- (limited to 'patches/0002-cli-Optionally-enforce-argument-to-upgrade-command.patch') diff --git a/patches/0002-cli-Optionally-enforce-argument-to-upgrade-command.patch b/patches/0002-cli-Optionally-enforce-argument-to-upgrade-command.patch deleted file mode 100644 index 9765026..0000000 --- a/patches/0002-cli-Optionally-enforce-argument-to-upgrade-command.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 8297cbe6f15ddef8bb47682913ff10a3cffa997c Mon Sep 17 00:00:00 2001 -From: Patrick McDermott -Date: Thu, 4 Apr 2019 18:25:51 -0400 -Subject: [PATCH] cli: Optionally enforce argument to upgrade command - -This reverts and amends commit 673d7213175c2cf209b25c8eb2632941cdbb8519. - -Signed-off-by: Patrick McDermott ---- - CMakeLists.txt | 4 ++++ - libopkg/opkg_cmd.c | 17 +++++++++++++++++ - src/opkg-cl.c | 4 ++++ - 3 files changed, 25 insertions(+) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 26230b3..508eccc 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -13,6 +13,7 @@ SET(VERSION "" CACHE STRING "Override version") - OPTION(STATIC_UBOX "Statically link libubox" OFF) - OPTION(BUILD_TESTS "Build test programs" ON) - OPTION(ENABLE_USIGN "Enable usign support" ON) -+OPTION(REQUIRE_UPGRADE_ARGS "Require arguments to upgrade command" ON) - - IF(NOT HOST_CPU) - SET(HOST_CPU "${CMAKE_HOST_SYSTEM_PROCESSOR}") -@@ -49,6 +50,9 @@ ADD_DEFINITIONS(-Os -Wall --std=gnu99 -g3 -Wmissing-declarations - IF(ENABLE_USIGN) - ADD_DEFINITIONS(-DHAVE_USIGN) - ENDIF() -+IF(REQUIRE_UPGRADE_ARGS) -+ ADD_DEFINITIONS(-DREQUIRE_UPGRADE_ARGS) -+ENDIF() - - IF(WORDS_BIGENDIAN) - ADD_DEFINITIONS(-DWORDS_BIGENDIAN) -diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c -index c823df8..0a4180d 100644 ---- a/libopkg/opkg_cmd.c -+++ b/libopkg/opkg_cmd.c -@@ -529,6 +529,19 @@ static int opkg_upgrade_cmd(int argc, char **argv) - err = -1; - } - } -+#if !defined(REQUIRE_UPGRADE_ARGS) -+ } else { -+ pkg_vec_t *installed = pkg_vec_alloc(); -+ -+ pkg_info_preinstall_check(); -+ pkg_hash_fetch_all_installed(installed); -+ for (i = 0; i < installed->len; i++) { -+ pkg = installed->pkgs[i]; -+ if (opkg_upgrade_pkg(pkg)) -+ err = -1; -+ } -+ pkg_vec_free(installed); -+#endif - } - - if (opkg_configure_packages(NULL)) -@@ -1256,7 +1269,11 @@ static int opkg_print_architecture_cmd(int argc, char **argv) - static opkg_cmd_t cmds[] = { - {"update", 0, (opkg_cmd_fun_t) opkg_update_cmd, - PFM_DESCRIPTION | PFM_SOURCE}, -+#if defined(REQUIRE_UPGRADE_ARGS) - {"upgrade", 1, (opkg_cmd_fun_t) opkg_upgrade_cmd, -+#else -+ {"upgrade", 0, (opkg_cmd_fun_t) opkg_upgrade_cmd, -+#endif - PFM_DESCRIPTION | PFM_SOURCE}, - {"list", 0, (opkg_cmd_fun_t) opkg_list_cmd, PFM_SOURCE}, - {"list_installed", 0, (opkg_cmd_fun_t) opkg_list_installed_cmd, -diff --git a/src/opkg-cl.c b/src/opkg-cl.c -index a3ea5c1..29cd373 100644 ---- a/src/opkg-cl.c -+++ b/src/opkg-cl.c -@@ -260,7 +260,11 @@ static void usage() - printf("\nPackage Manipulation:\n"); - printf - ("\tupdate Update list of available packages\n"); -+#if defined(REQUIRE_UPGRADE_ARGS) - printf("\tupgrade Upgrade packages\n"); -+#else -+ printf("\tupgrade Upgrade packages\n"); -+#endif - printf("\tinstall Install package(s)\n"); - printf("\tconfigure Configure unpacked package(s)\n"); - printf("\tremove Remove package(s)\n"); --- -2.11.0 - -- cgit v0.9.1