- pull changelog entries directly from the file on the filesystem
- don't populate the changelogs table
This commit is contained in:
parent
f1a36d48b5
commit
48a49e650d
3 changed files with 104 additions and 108 deletions
25
koji/util.py
25
koji/util.py
|
|
@ -14,6 +14,8 @@
|
|||
# License along with this software; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
import calendar
|
||||
import re
|
||||
import time
|
||||
import koji
|
||||
|
||||
|
|
@ -32,6 +34,29 @@ def formatChangelog(entries):
|
|||
|
||||
return result
|
||||
|
||||
DATE_RE = re.compile(r'(\d+)-(\d+)-(\d+)')
|
||||
TIME_RE = re.compile(r'(\d+):(\d+):(\d+)')
|
||||
|
||||
def parseTime(val):
|
||||
"""
|
||||
Parse a string time in either "YYYY-MM-DD HH24:MI:SS" or "YYYY-MM-DD"
|
||||
format into floating-point seconds since the epoch. If the time portion
|
||||
is not specified, it will be padded with zeros. The string time is treated
|
||||
as UTC. If the time string cannot be parsed into a valid date, None will be
|
||||
returned.
|
||||
"""
|
||||
result = DATE_RE.search(val)
|
||||
if not result:
|
||||
return None
|
||||
else:
|
||||
date = [int(r) for r in result.groups()]
|
||||
time = [0, 0, 0]
|
||||
rest = val[result.end():].strip()
|
||||
result = TIME_RE.search(rest)
|
||||
if result:
|
||||
time = [int(r) for r in result.groups()]
|
||||
return calendar.timegm(date + time + [0, 0, 0])
|
||||
|
||||
def checkForBuilds(session, tag, builds, event):
|
||||
"""Check that the builds existed in tag at the time of the event."""
|
||||
for build in builds:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue