summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-02-06 20:57:17 +0000
committerAaron Griffin <aaron@archlinux.org>2007-02-06 20:57:17 +0000
commit79c277a218308d3f11c0852b6feb967923e15587 (patch)
tree4af30187a6926c70e2562730bf7304ee75ca3037 /lib
parentac6e1c696e7194c6762bbc15e82dad20315d341c (diff)
downloadpacman-79c277a218308d3f11c0852b6feb967923e15587.tar.xz
Attempt #2 at -S/-Su unification: verify that the 'force' option has been read before comparing versions
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/package.c5
-rw-r--r--lib/libalpm/package.h2
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index 9bc34016..1afaf38c 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -125,6 +125,11 @@ void _alpm_pkg_free(void *data)
/* Is pkgB an upgrade for pkgA ? */
int alpm_pkg_compare_versions(pmpkg_t *pkgA, pmpkg_t *pkgB)
{
+ if(spkg->origin == PKG_FROM_CACHE) {
+ /* ensure we have the /desc file, which contains the 'force' option */
+ _alpm_db_read(pkgB->data, INFRQ_DESC, pkgB);
+ }
+
if(pkgB->force) {
/* skip the version compare call if this is a 'force' package */
return(1);
diff --git a/lib/libalpm/package.h b/lib/libalpm/package.h
index dfaec2a2..84274cca 100644
--- a/lib/libalpm/package.h
+++ b/lib/libalpm/package.h
@@ -82,7 +82,7 @@ struct __pmpkg_t {
alpm_list_t *conflicts;
alpm_list_t *provides;
/* internal */
- unsigned short origin;
+ pmpkgfrom_t origin;
void *data;
pmdbinfrq_t infolevel;
};