opkg: compare-versions doesn't need any state
authorRoss Burton <ross.burton@intel.com>
Tue, 1 Mar 2016 16:54:26 +0000 (16:54 +0000)
committerJo-Philipp Wich <jo@mein.io>
Wed, 15 Mar 2017 02:12:51 +0000 (03:12 +0100)
compare-versions doesn't need lock files created and databases opened, so don't.

Signed-off-by: Ross Burton <ross.burton@intel.com>
libopkg/opkg_cmd.c
src/opkg-cl.c

index c26e2c384fe27fe7e966f5060e3e94fef5487c6e..c823df8b6006bffa2516443fab3718cd112ae3b3 100644 (file)
@@ -1289,10 +1289,8 @@ static opkg_cmd_t cmds[] = {
        {"find", 1, (opkg_cmd_fun_t) opkg_find_cmd, PFM_SOURCE},
        {"download", 1, (opkg_cmd_fun_t) opkg_download_cmd,
         PFM_DESCRIPTION | PFM_SOURCE},
-       {"compare_versions", 1, (opkg_cmd_fun_t) opkg_compare_versions_cmd,
-        PFM_DESCRIPTION | PFM_SOURCE},
-       {"compare-versions", 1, (opkg_cmd_fun_t) opkg_compare_versions_cmd,
-        PFM_DESCRIPTION | PFM_SOURCE},
+       {"compare_versions", 1, (opkg_cmd_fun_t) opkg_compare_versions_cmd, 0},
+       {"compare-versions", 1, (opkg_cmd_fun_t) opkg_compare_versions_cmd, 0},
        {"print-architecture", 0, (opkg_cmd_fun_t) opkg_print_architecture_cmd,
         PFM_DESCRIPTION | PFM_SOURCE},
        {"print_architecture", 0, (opkg_cmd_fun_t) opkg_print_architecture_cmd,
index e73e04247708cea481814a53763f70427268fb52..c518bfcd0a637c6116663e6a52b31c1504c6c4d8 100644 (file)
@@ -391,7 +391,9 @@ int main(int argc, char *argv[])
            !strcmp(cmd_name, "print-architecture") ||
            !strcmp(cmd_name, "print_architecture") ||
            !strcmp(cmd_name, "print-installation-architecture") ||
-           !strcmp(cmd_name, "print_installation_architecture"))
+           !strcmp(cmd_name, "print_installation_architecture") ||
+           !strcmp(cmd_name, "compare_versions") ||
+           !strcmp(cmd_name, "compare-versions"))
                nocheckfordirorfile = 1;
 
        if (!strcmp(cmd_name, "flag") ||
@@ -400,8 +402,6 @@ int main(int argc, char *argv[])
            !strcmp(cmd_name, "remove") ||
            !strcmp(cmd_name, "files") ||
            !strcmp(cmd_name, "search") ||
-           !strcmp(cmd_name, "compare_versions") ||
-           !strcmp(cmd_name, "compare-versions") ||
            !strcmp(cmd_name, "list_installed") ||
            !strcmp(cmd_name, "list-installed") ||
            !strcmp(cmd_name, "list_changed_conffiles") ||