aboutsummaryrefslogtreecommitdiffstats
path: root/package/opkg/patches/009-remove-upgrade.patch
blob: 1d2f4e91d7dd9540e9a49b671d6db0b9958f1edf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
--- a/libopkg/args.c
+++ b/libopkg/args.c
@@ -263,7 +263,6 @@
     
      printf("\nPackage Manipulation:\n");
      printf("\tupdate  		Update list of available packages\n");
-     printf("\tupgrade			Upgrade all installed packages to latest version\n");
      printf("\tinstall <pkg>		Download and install <pkg> (and dependencies)\n");
      printf("\tinstall <file.opk>	Install package <file.opk>\n");
      printf("\tconfigure [<pkg>]	Configure unpacked packages\n");
@@ -274,7 +273,6 @@
      printf("\nInformational Commands:\n");
      printf("\tlist    		List available packages and descriptions\n");
      printf("\tlist_installed		List all and only the installed packages and description \n");
-     printf("\tlist_upgradable		List all the installed and upgradable packages\n");
      printf("\tfiles <pkg>		List all files belonging to <pkg>\n");
      printf("\tsearch <file|regexp>		Search for a package providing <file>\n");
      printf("\tinfo [pkg|regexp]		Display all info for <pkg>\n");
--- a/libopkg/opkg_cmd.c
+++ b/libopkg/opkg_cmd.c
@@ -48,14 +48,12 @@
 static void *p_userdata = NULL;
 
 static int opkg_update_cmd(opkg_conf_t *conf, int argc, char **argv);
-static int opkg_upgrade_cmd(opkg_conf_t *conf, int argc, char **argv);
 static int opkg_list_cmd(opkg_conf_t *conf, int argc, char **argv);
 static int opkg_info_cmd(opkg_conf_t *conf, int argc, char **argv);
 static int opkg_status_cmd(opkg_conf_t *conf, int argc, char **argv);
 static int opkg_install_pending_cmd(opkg_conf_t *conf, int argc, char **argv);
 static int opkg_install_cmd(opkg_conf_t *conf, int argc, char **argv);
 static int opkg_list_installed_cmd(opkg_conf_t *conf, int argc, char **argv);
-static int opkg_list_upgradable_cmd(opkg_conf_t *conf, int argc, char **argv);
 static int opkg_remove_cmd(opkg_conf_t *conf, int argc, char **argv);
 static int opkg_purge_cmd(opkg_conf_t *conf, int argc, char **argv);
 static int opkg_flag_cmd(opkg_conf_t *conf, int argc, char **argv);
@@ -79,10 +77,8 @@
    array for easier maintenance */
 static opkg_cmd_t cmds[] = {
      {"update", 0, (opkg_cmd_fun_t)opkg_update_cmd}, 
-     {"upgrade", 0, (opkg_cmd_fun_t)opkg_upgrade_cmd},
      {"list", 0, (opkg_cmd_fun_t)opkg_list_cmd},
      {"list_installed", 0, (opkg_cmd_fun_t)opkg_list_installed_cmd},
-     {"list_upgradable", 0, (opkg_cmd_fun_t)opkg_list_upgradable_cmd},
      {"info", 0, (opkg_cmd_fun_t)opkg_info_cmd},
      {"flag", 1, (opkg_cmd_fun_t)opkg_flag_cmd},
      {"status", 0, (opkg_cmd_fun_t)opkg_status_cmd},
@@ -599,69 +595,6 @@
      return err;
 }
 
-static int opkg_upgrade_cmd(opkg_conf_t *conf, int argc, char **argv)
-{
-     int i;
-     pkg_t *pkg;
-     int err;
-
-     global_conf = conf;
-     signal(SIGINT, sigint_handler);
-
-     if (argc) {
-	  for (i=0; i < argc; i++) {
-	       char *arg = argv[i];
-
-               err = opkg_prepare_url_for_install(conf, arg, &arg);
-               if (err != EINVAL && err != 0)
-                   return err;
-	  }
-	  pkg_info_preinstall_check(conf);
-
-	  for (i=0; i < argc; i++) {
-	       char *arg = argv[i];
-	       if (conf->restrict_to_default_dest) {
-		    pkg = pkg_hash_fetch_installed_by_name_dest(&conf->pkg_hash,
-								argv[i],
-								conf->default_dest);
-		    if (pkg == NULL) {
-			 opkg_message(conf, OPKG_NOTICE,
-				      "Package %s not installed in %s\n",
-				      argv[i], conf->default_dest->name);
-			 continue;
-		    }
-	       } else {
-		    pkg = pkg_hash_fetch_installed_by_name(&conf->pkg_hash,
-							   argv[i]);
-	       }
-	       if (pkg)
-		    opkg_upgrade_pkg(conf, pkg);
-	       else {
-		    opkg_install_by_name(conf, arg);
-               }
-	  }
-     } else {
-	  pkg_vec_t *installed = pkg_vec_alloc();
-
-	  pkg_info_preinstall_check(conf);
-
-	  pkg_hash_fetch_all_installed(&conf->pkg_hash, installed);
-	  for (i = 0; i < installed->len; i++) {
-	       pkg = installed->pkgs[i];
-	       opkg_upgrade_pkg(conf, pkg);
-	  }
-	  pkg_vec_free(installed);
-     }
-
-     /* recheck to verify that all dependences are satisfied */
-     if (0) opkg_satisfy_all_dependences(conf);
-
-     opkg_configure_packages(conf, NULL);
-
-     write_status_files_if_changed(conf);
-
-     return 0;
-}
 
 static int opkg_download_cmd(opkg_conf_t *conf, int argc, char **argv)
 {
@@ -788,26 +721,6 @@
      return 0;
 }
 
-static int opkg_list_upgradable_cmd(opkg_conf_t *conf, int argc, char **argv) 
-{
-    struct active_list *head = prepare_upgrade_list(conf);
-    struct active_list *node=NULL;
-    pkg_t *_old_pkg, *_new_pkg;
-    char *old_v, *new_v;
-    for (node = active_list_next(head, head); node;node = active_list_next(head,node)) {
-        _old_pkg = list_entry(node, pkg_t, list);
-        _new_pkg = pkg_hash_fetch_best_installation_candidate_by_name(conf, _old_pkg->name, NULL);
-        old_v = pkg_version_str_alloc(_old_pkg);
-        new_v = pkg_version_str_alloc(_new_pkg);
-        if (opkg_cb_list)
-            opkg_cb_list(_old_pkg->name, new_v, old_v, _old_pkg->state_status, p_userdata);
-        free(old_v);
-        free(new_v);
-    }
-    active_list_head_delete(head);
-    return 0;
-}
-
 static int opkg_info_status_cmd(opkg_conf_t *conf, int argc, char **argv, int installed_only)
 {
      int i;