Diff:
---
 calm/calm.py          |  3 ++-
 calm/package.py       | 10 +++++-----
 calm/past_mistakes.py |  6 ++++++
 calm/pkg2html.py      |  7 +++++++
 calm/utils.py         |  3 +++
 5 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/calm/calm.py b/calm/calm.py
index 86336f7..786c34a 100755
--- a/calm/calm.py
+++ b/calm/calm.py
@@ -661,9 +661,10 @@ def do_output(args, state):
         except (OSError):
             pass
 
+    repology.annotate_packages(args, state.packages)
+
     # write reports
     if (update_json or args.force) and args.reports:
-        repology.annotate_packages(args, state.packages)
         reports.do_reports(args, state.packages)
 
     # update packages listings
diff --git a/calm/package.py b/calm/package.py
index f00ad8d..c0bdadb 100755
--- a/calm/package.py
+++ b/calm/package.py
@@ -791,10 +791,10 @@ def validate_packages(args, packages, 
valid_provides_extra=None, missing_obsolet
     # perform various package validations
     for p in sorted(packages.keys()):
         for (v, hints) in packages[p].version_hints.items():
-            for (c, okmissing, valid) in [
-                    ('depends', 'missing-depended-package', valid_requires),
-                    ('obsoletes', 'missing-obsoleted-package', 
valid_obsoletes),
-                    ('build-depends', 'missing-build-depended-package', 
valid_requires),
+            for (c, okmissing, valid, nonexistent) in [
+                    ('depends', 'missing-depended-package', valid_requires, 
past_mistakes.nonexistent_provides),
+                    ('obsoletes', 'missing-obsoleted-package', 
valid_obsoletes, []),
+                    ('build-depends', 'missing-build-depended-package', 
valid_requires, past_mistakes.nonexistent_build_requires),
             ]:
                 # if c is in hints, and not the empty string
                 if hints.get(c, ''):
@@ -814,7 +814,7 @@ def validate_packages(args, packages, 
valid_provides_extra=None, missing_obsolet
 
                         # all packages listed in a hint must exist (unless the
                         # disable-check option says that's ok)
-                        if (r not in valid) and (r not in 
past_mistakes.expired_provides) and (not any(re.match(nep + r'$', r) for nep in 
past_mistakes.nonexistent_provides)):
+                        if (r not in valid) and (r not in 
past_mistakes.expired_provides) and (not any(re.match(nep + r'$', r) for nep in 
nonexistent)):
                             if okmissing not in getattr(args, 'disable_check', 
[]):
                                 logging.error("package '%s' version '%s' %s: 
'%s', but nothing satisfies that" % (p, v, c, r))
                                 error = True
diff --git a/calm/past_mistakes.py b/calm/past_mistakes.py
index c63a59c..b8491b6 100644
--- a/calm/past_mistakes.py
+++ b/calm/past_mistakes.py
@@ -188,6 +188,12 @@ nonexistent_provides = historical_provides + [
     r'tl_basic_\d+',
 ]
 
+# ditto, but just for build_requires
+nonexistent_build_requires = [
+    'python2',
+    'python27-.*',
+]
+
 # provides which don't exist, and were obsoleted by something else which we've
 # forgotten about..
 substitute_dependency = {
diff --git a/calm/pkg2html.py b/calm/pkg2html.py
index 0366be9..2f4b658 100755
--- a/calm/pkg2html.py
+++ b/calm/pkg2html.py
@@ -186,6 +186,13 @@ def update_package_listings(args, packages):
         if (p in update_summary) or (summary_mtime < hint_mtime) or (now > 
summary_last_touched.get(p, 0) + SUMMARY_REWRITE_INTERVAL) or args.force:
             if not args.dryrun:
                 summary_last_touched[p] = now
+
+                # if older than hint, touch it so we don't keep on trying to
+                # update it here, if hint has changed in a way that doesn't
+                # affect summary page
+                if summary_mtime < hint_mtime:
+                    utils.touch(summary, now)
+
                 with utils.open_amifc(summary) as f:
                     os.fchmod(f.fileno(), 0o755)
 
diff --git a/calm/utils.py b/calm/utils.py
index 16b69a3..2e56631 100644
--- a/calm/utils.py
+++ b/calm/utils.py
@@ -38,6 +38,9 @@ from contextlib import contextmanager
 # touch a file
 #
 def touch(fn, times=None):
+    if times is not None:
+        times = (times, times)
+
     try:
         with open(fn, 'a'):  # ensure fn exists
             os.utime(fn, times)

Reply via email to