diff options
author | Aaron Griffin <aaron@archlinux.org> | 2007-02-04 08:26:52 +0000 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2007-02-04 08:26:52 +0000 |
commit | 63000584b6442412dbcdf1dd867e09fbde404afe (patch) | |
tree | 5ac1028f9aaf0ff5a75d9d2144a9ecc337dc2211 /lib/libalpm/sync.c | |
parent | b2da4b42344444dc22f1e5b01fb4cd09033adc1d (diff) | |
download | pacman-63000584b6442412dbcdf1dd867e09fbde404afe.tar.xz |
Implemented a crappy version of -Qu (query upgrades). This simply outputs the
packages to be upgraded in a -Su operation. Much of the code is duplicated from
sync.c.
TODO: move the implementation to upgrades.c, and reimplement the sync_sysupgrade
function in terms of this:
trans->packages = alpm_get_upgrades();
Diffstat (limited to 'lib/libalpm/sync.c')
-rw-r--r-- | lib/libalpm/sync.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 329353a1..9cf973fa 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -115,18 +115,6 @@ static pmsyncpkg_t *find_pkginsync(char *needle, alpm_list_t *haystack) return(sync); } -static int istoonew(pmpkg_t *pkg) -{ - time_t t; - - ALPM_LOG_FUNC; - - if (!handle->upgradedelay) - return 0; - time(&t); - return((pkg->date + handle->upgradedelay) > t); -} - /* Find recommended replacements for packages during a sync. * (refactored from _alpm_sync_prepare) */ @@ -198,6 +186,7 @@ error: return(-1); } +/* TODO reimplement this in terms of alpm_get_upgrades */ int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sync) { alpm_list_t *i, *j; @@ -252,7 +241,7 @@ int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_s /* package should be ignored (IgnorePkg) */ _alpm_log(PM_LOG_WARNING, _("%s-%s: ignoring package upgrade (%s)"), local->name, local->version, spkg->version); - } else if(istoonew(spkg)) { + } else if(_alpm_pkg_istoonew(spkg)) { /* package too new (UpgradeDelay) */ _alpm_log(PM_LOG_DEBUG, _("%s-%s: delaying upgrade of package (%s)"), local->name, local->version, spkg->version); |