def get_release_date_from_release_file(path): """ return the release date as time_t for the given release file """ if not path or not os.path.exists(path): return None tag = apt_pkg.TagFile(open(path)) section = tag.next() if not "Date" in section: return None date = section["Date"] return apt_pkg.str_to_time(date)
def get_release_date_from_release_file(path): """ return the release date as time_t for the given release file """ if not path or not os.path.exists(path): return None tag = apt_pkg.TagFile(open(path)) section = next(tag) if "Date" not in section: return None date = section["Date"] return apt_pkg.str_to_time(date)
def get_release_date_from_release_file(path): """ return the release date as time_t for the given release file """ if not path or not os.path.exists(path): return None with os.fdopen(apt_pkg.open_maybe_clear_signed_file(path)) as data: tag = apt_pkg.TagFile(data) section = next(tag) if "Date" not in section: return None date = section["Date"] return apt_pkg.str_to_time(date)