Skip to content

Commit

Permalink
Update spec files #26 WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
dvershinin committed Jul 14, 2021
1 parent 03fa47f commit d39c271
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lastversion/lastversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,16 @@ def parse_version(tag):


def get_rpm_packager():
rpmmacros = expanduser("~") + "/.rpmmacros"
with open(rpmmacros) as f:
for ln in f.readlines():
if ln.startswith('%packager'):
return ln.split('%packager')[1].strip()
try:
rpmmacros = expanduser("~") + "/.rpmmacros"
with open(rpmmacros) as f:
for ln in f.readlines():
if ln.startswith('%packager'):
return ln.split('%packager')[1].strip()
except IOError:
log.warning("~/.rpmmacros does not exist. Changelog will not be generated")
finally:
f.close()
return None


Expand Down

0 comments on commit d39c271

Please sign in to comment.