From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id BDD6A1384B4 for ; Mon, 2 Nov 2015 21:46:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0E00EE08BB; Mon, 2 Nov 2015 21:46:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 77D58E08AC for ; Mon, 2 Nov 2015 21:46:33 +0000 (UTC) Received: from localhost.localdomain (d202-251.icpnet.pl [109.173.202.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 62E1C3402A2; Mon, 2 Nov 2015 21:46:31 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-portage-dev@lists.gentoo.org Cc: robbat2@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-portage-dev] [PATCH 1/2] egencache --update-changelogs: Support setting ChangeLog file name Date: Mon, 2 Nov 2015 22:46:25 +0100 Message-Id: <1446500786-23199-1-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 2.6.2 In-Reply-To: <5637B708.2030600@gentoo.org> References: <5637B708.2030600@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org X-Archives-Salt: c398a554-5e05-4230-bb8a-29689d6cca60 X-Archives-Hash: 7cd554a49ca972cb248e18b338d65b63 --- bin/egencache | 14 +++++++++++--- man/egencache.1 | 6 ++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/bin/egencache b/bin/egencache index 30311eb..984d9f2 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 abbbdb9..b4a95b3 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 -- 2.6.2