summaryrefslogtreecommitdiff
path: root/apt
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-06-10 11:55:18 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-06-10 11:55:18 +0200
commit3b4330920da718d2dbb2a4a94577c07eaa58a8c5 (patch)
tree90dd732cd2c9cb8a3abcc95bb06238aa15b715b5 /apt
parent919e1b4d3dad602130aff9bb56d6741be02d831d (diff)
downloadpython-apt-3b4330920da718d2dbb2a4a94577c07eaa58a8c5.tar.gz
* apt/utils.py:
- fix end date calculation for releases in june
Diffstat (limited to 'apt')
-rw-r--r--apt/utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/apt/utils.py b/apt/utils.py
index 80ba6d65..8fc69215 100644
--- a/apt/utils.py
+++ b/apt/utils.py
@@ -28,11 +28,16 @@ def get_maintenance_end_date(release_date, m_months):
ends. Needs the data of the release and the number of months that
its is supported as input
"""
+ # calc end date
years = m_months / 12
months = m_months % 12
support_end_year = (release_date.year + years +
(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:
+ support_end_month = 12
+ support_end_year -= 1
return (support_end_year, support_end_month)