summaryrefslogtreecommitdiffstats
path: root/opkg_upgrade.c
diff options
context:
space:
mode:
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-14 23:25:08 (EST)
committer ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-14 23:25:08 (EST)
commit4b0b7ca249bfa4ecc099c2ca56527eb91776f198 (patch)
treedb5d2602d75a69cc9e1f7f30cbac584f0ab45c45 /opkg_upgrade.c
parent868cbd739052719d5e0580a0fda6101dada1ce1e (diff)
opkg: re-arrange source code into sub-directories
git-svn-id: http://opkg.googlecode.com/svn/trunk@33 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'opkg_upgrade.c')
-rw-r--r--opkg_upgrade.c77
1 files changed, 0 insertions, 77 deletions
diff --git a/opkg_upgrade.c b/opkg_upgrade.c
deleted file mode 100644
index b0b047f..0000000
--- a/opkg_upgrade.c
+++ /dev/null
@@ -1,77 +0,0 @@
-/* opkg_upgrade.c - the itsy package management system
-
- Carl D. Worth
- Copyright (C) 2001 University of Southern California
-
- Copyright (C) 2003 Daniele Nicolodi <daniele@grinta.net>
-
- 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 "opkg.h"
-#include "opkg_install.h"
-#include "opkg_message.h"
-
-int opkg_upgrade_pkg(opkg_conf_t *conf, pkg_t *old)
-{
- pkg_t *new;
- int cmp;
- char *old_version, *new_version;
-
- if (old->state_flag & SF_HOLD) {
- opkg_message(conf, OPKG_NOTICE,
- "Not upgrading package %s which is marked "
- "hold (flags=%#x)\n", old->name, old->state_flag);
- return 0;
- }
-
- new = pkg_hash_fetch_best_installation_candidate_by_name(conf, old->name);
- if (new == NULL) {
- old_version = pkg_version_str_alloc(old);
- opkg_message(conf, OPKG_NOTICE,
- "Assuming locally installed package %s (%s) "
- "is up to date.\n", old->name, old_version);
- 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_message(conf, OPKG_DEBUG,
- "comparing visible versions of pkg %s:"
- "\n\t%s is installed "
- "\n\t%s is available "
- "\n\t%d was comparison result\n",
- old->name, old_version, new_version, cmp);
- if (cmp == 0) {
- opkg_message(conf, OPKG_INFO,
- "Package %s (%s) installed in %s is up to date.\n",
- old->name, old_version, old->dest->name);
- free(old_version);
- free(new_version);
- return 0;
- } else if (cmp > 0) {
- opkg_message(conf, OPKG_NOTICE,
- "Not downgrading package %s on %s from %s to %s.\n",
- old->name, old->dest->name, old_version, new_version);
- free(old_version);
- free(new_version);
- return 0;
- } else if (cmp < 0) {
- new->dest = old->dest;
- old->state_want = SW_DEINSTALL;
- }
-
- new->state_flag |= SF_USER;
- return opkg_install_pkg(conf, new,1);
-}