From 7f5dada8851c3b40ba44ed92e46315cefa9006b2 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Sat, 3 Mar 2007 08:13:59 +0000 Subject: Big commit this time: * Moved entirely to alpm_pkg_get_* accessors, to read data on demand * Mostly removed the INFRQ_ parameters from outside the be_files backend (making the backend more extensible in the long run) * packages created from _alpm_db_scan now have the db and origin set (making accessors actually work for these packages) * removed _alpm_db_ensure_pkgcache * totally revamped the _alpm_checkconflicts function, making it cleaner and easier to read (and thus fix in the long run) - maintainable code ftw NOTE: feel free to rename the functions... I couldn't think of anything better * removed an extra loop in sync.c:find_replacements - no sense in looping over an entire DB while strcmp'ing the name, when we have get_pkgfromcache Other: * package struct "license" -> "licenses" * Created _alpm_sync_find (duplicate code in some places, find_pkginsync * Minor const correctness changes along the way * fixed a couple extra '/' pathing issues (non-issues really) * removed a duplicate pkg_cmp function --- lib/libalpm/versioncmp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/libalpm/versioncmp.c') diff --git a/lib/libalpm/versioncmp.c b/lib/libalpm/versioncmp.c index 3356e99f..ad628866 100644 --- a/lib/libalpm/versioncmp.c +++ b/lib/libalpm/versioncmp.c @@ -256,7 +256,7 @@ int _alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep) if(dep->mod == PM_DEP_MOD_ANY) { equal = 1; } else { - int cmp = _alpm_versioncmp(pkg->version, dep->version); + int cmp = _alpm_versioncmp(alpm_pkg_get_version(pkg), dep->version); switch(dep->mod) { case PM_DEP_MOD_EQ: equal = (cmp == 0); break; case PM_DEP_MOD_GE: equal = (cmp >= 0); break; @@ -275,11 +275,13 @@ int _alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep) if(strlen(dep->version) > 0) { _alpm_log(PM_LOG_DEBUG, _("depcmp: %s-%s %s %s-%s => %s"), - pkg->name, pkg->version, mod, dep->name, dep->version, + alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg), + mod, dep->name, dep->version, (equal ? "match" : "no match")); } else { _alpm_log(PM_LOG_DEBUG, _("depcmp: %s-%s %s %s => %s"), - pkg->name, pkg->version, mod, dep->name, + alpm_pkg_get_name(pkg), alpm_pkg_get_version(pkg), + mod, dep->name, (equal ? "match" : "no match")); } } -- cgit v1.2.3-54-g00ecf