diff options
Diffstat (limited to 'apt/utils.py')
-rw-r--r-- | apt/utils.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/apt/utils.py b/apt/utils.py index 08140258..948aac92 100644 --- a/apt/utils.py +++ b/apt/utils.py @@ -16,6 +16,7 @@ # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +from __future__ import print_function import os.path @@ -32,7 +33,7 @@ def get_maintenance_end_date(release_date, m_months): years = m_months // 12 months = m_months % 12 support_end_year = (release_date.year + years + - (release_date.month + months)//12) + (release_date.month + months) // 12) support_end_month = (release_date.month + months) % 12 # special case: this happens when e.g. doing 2010-06 + 18 months if support_end_month == 0: @@ -49,7 +50,7 @@ def get_release_date_from_release_file(path): return None tag = apt_pkg.TagFile(open(path)) section = next(tag) - if not "Date" in section: + if "Date" not in section: return None date = section["Date"] return apt_pkg.str_to_time(date) @@ -69,8 +70,8 @@ def get_release_filename_for_pkg(cache, pkgname, label, release): for ver_file, _index in aver.file_list: #print verFile if (ver_file.origin == label and - ver_file.label == label and - ver_file.archive == release): + ver_file.label == label and + ver_file.archive == release): ver = aver if not ver: return None @@ -78,8 +79,8 @@ def get_release_filename_for_pkg(cache, pkgname, label, release): for metaindex in cache._list.list: for m in metaindex.index_files: if (indexfile and - indexfile.describe == m.describe and - indexfile.is_trusted): + indexfile.describe == m.describe and + indexfile.is_trusted): dirname = apt_pkg.config.find_dir("Dir::State::lists") name = (apt_pkg.uri_to_filename(metaindex.uri) + "dists_%s_Release" % metaindex.dist) |