From ecbec2f85296ac6c690186ea2e1de611df4d6f72 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 3 Dec 2011 13:41:49 -0600 Subject: reporead: fix --force flag Signed-off-by: Dan McGee --- devel/management/commands/reporead.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'devel/management') diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py index c444538b..ec008ba3 100644 --- a/devel/management/commands/reporead.py +++ b/devel/management/commands/reporead.py @@ -371,9 +371,8 @@ def db_update(archname, reponame, pkgs, force=False): timestamp = None # for a force, we don't want to update the timestamp. # for a non-force, we don't want to do anything at all. - if pkg_same_version(pkg, dbpkg): - if not force: - continue + if not force and pkg_same_version(pkg, dbpkg): + continue else: timestamp = datetime.utcnow() @@ -383,7 +382,7 @@ def db_update(archname, reponame, pkgs, force=False): with transaction.commit_on_success(): # TODO Django 1.4 select_for_update() will work once released dbpkg = select_pkg_for_update(dbpkg) - if pkg_same_version(pkg, dbpkg): + if not force and pkg_same_version(pkg, dbpkg): logger.debug("Package %s was already updated", pkg.name) continue logger.info("Updating package %s", pkg.name) @@ -410,7 +409,7 @@ def filesonly_update(archname, reponame, pkgs, force=False): with transaction.commit_on_success(): if not dbpkg.files_last_update or not dbpkg.last_update: pass - elif dbpkg.files_last_update > dbpkg.last_update: + elif not force and dbpkg.files_last_update > dbpkg.last_update: logger.debug("Files for %s are up to date", pkg.name) continue # TODO Django 1.4 select_for_update() will work once released -- cgit v1.2.3-54-g00ecf