Skip to content

Commit

Permalink
Merge pull request #125 from pabs3/fix-changelog-generation
Browse files Browse the repository at this point in the history
Make the copying of changelog lines less brittle
  • Loading branch information
rickysarraf committed May 30, 2020
2 parents 9ca1ceb + 2528795 commit b806385
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion apt_offline_core/AptOfflineCoreLib.py
Expand Up @@ -1135,8 +1135,17 @@ def buildChangelog(self, pkgPath, installedVersion):
#Seek to beginning
chlogFile.seek(0)

if 'Source' in pkgHandle:
srcname = pkgHandle['Source']
else:
srcname = pkgHandle.pkgname
if ' ' in srcname:
srcname = srcname.split(' ', 1)[0]
installedVersion_changelog_line = "%s (%s) " % (srcname, installedVersion)

# FIXME: replace this with parsing the changelog using the Python debian module
for eachLine in chlogFile.readlines():
if installedVersion in eachLine:
if eachLine.startswith(installedVersion_changelog_line):
break
else:
pkgLogFile.writelines(eachLine)
Expand Down

0 comments on commit b806385

Please sign in to comment.