aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2015-11-02 19:06:31 +0100
committerMichał Górny <mgorny@gentoo.org>2015-11-02 22:45:15 +0100
commitb7154f9b10571c3b9a91d24062af6b11a7ee3dff (patch)
tree7cacd72cee192743fcc034b1b811510b169c0ab3
parentegencache --update-changelogs: Replace $Header$ with autogen note (diff)
downloadportage-b7154f9b10571c3b9a91d24062af6b11a7ee3dff.tar.gz
portage-b7154f9b10571c3b9a91d24062af6b11a7ee3dff.tar.bz2
portage-b7154f9b10571c3b9a91d24062af6b11a7ee3dff.zip
egencache --update-changelogs: Support setting ChangeLog file name
-rwxr-xr-xbin/egencache14
-rw-r--r--man/egencache.16
2 files changed, 17 insertions, 3 deletions
diff --git a/bin/egencache b/bin/egencache
index 30311eb7f..984d9f2a2 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -170,6 +170,12 @@ def parse_args(args):
help="output file for use.local.desc data (or '-' for stdout)",
dest="uld_output")
+ uc = parser.add_argument_group('--update-changelogs options')
+ uc.add_argument("--changelog-output",
+ help="output filename for change logs",
+ dest="changelog_output",
+ default="ChangeLog")
+
options, args = parser.parse_known_args(args)
if options.jobs:
@@ -739,7 +745,7 @@ class _special_filename(_filename_base):
return self.file_name < other.file_name
class GenChangeLogs(object):
- def __init__(self, portdb):
+ def __init__(self, portdb, changelog_output):
self.returncode = os.EX_OK
self._portdb = portdb
self._wrapper = textwrap.TextWrapper(
@@ -747,6 +753,7 @@ class GenChangeLogs(object):
initial_indent = ' ',
subsequent_indent = ' '
)
+ self._changelog_output = changelog_output
@staticmethod
def grab(cmd):
@@ -756,7 +763,7 @@ class GenChangeLogs(object):
def generate_changelog(self, cp):
try:
- output = io.open('ChangeLog',
+ output = io.open(self._changelog_output,
mode='w', encoding=_encodings['repo.content'],
errors='backslashreplace')
except IOError as e:
@@ -1132,7 +1139,8 @@ def egencache_main(args):
ret.append(gen_desc.returncode)
if options.update_changelogs:
- gen_clogs = GenChangeLogs(portdb)
+ gen_clogs = GenChangeLogs(portdb,
+ changelog_output=options.changelog_output)
gen_clogs.run()
ret.append(gen_clogs.returncode)
diff --git a/man/egencache.1 b/man/egencache.1
index abbbdb93c..b4a95b38e 100644
--- a/man/egencache.1
+++ b/man/egencache.1
@@ -40,6 +40,12 @@ information about why this is necessary.
.br
Defaults to /var/cache/edb/dep.
.TP
+.BR "\-\-changelog\-output=FILENAME"
+Specifies the file name used to store autogenerated ChangeLogs inside
+the package directories.
+.br
+Defaults to ChangeLog.
+.TP
.BR "\-\-config\-root=PORTAGE_CONFIGROOT"
Location of portage config files.
.br