def osrt_origin_projects(apiurl, opts, *args): projects = list(project_attribute_list(apiurl, 'OSRT:OriginConfig')) if osrt_origin_dump(opts.format, projects): return for project in sorted(projects): print(project)
def osrt_origin_cron(apiurl, opts, *args): projects = project_attribute_list(apiurl, 'OSRT:OriginConfig') for project in projects: # Preserve cache for locked projects, but create if missing. if project_locked(apiurl, project): lookup_path = osrt_origin_lookup_file(project) if os.path.exists(lookup_path): # Update the last accessed time to avoid cache manager culling. os.utime(lookup_path, (time.time(), os.stat(lookup_path).st_mtime)) print('{}<locked> lookup preserved'.format(project)) continue # Force update lookup information. lookup = osrt_origin_lookup(apiurl, project, force_refresh=True, quiet=True) print('{} lookup updated for {} package(s)'.format(project, len(lookup)))