From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RHACm-0000SZ-Sn for garchives@archives.gentoo.org; Fri, 21 Oct 2011 08:11:53 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DE24F21C1A2; Fri, 21 Oct 2011 08:11:44 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id AA9B021C1A2 for ; Fri, 21 Oct 2011 08:11:44 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 05B231B4020 for ; Fri, 21 Oct 2011 08:11:44 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 5A84E80042 for ; Fri, 21 Oct 2011 08:11:43 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <0c63881bf206f8b5f707b1ca4ea2b171d740913d.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/repoman/ X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/utilities.py X-VCS-Directories: pym/repoman/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 0c63881bf206f8b5f707b1ca4ea2b171d740913d Date: Fri, 21 Oct 2011 08:11:43 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: ffafa91603afe1b3ac7d40b3f1940f15 commit: 0c63881bf206f8b5f707b1ca4ea2b171d740913d Author: Zac Medico gentoo org> AuthorDate: Fri Oct 21 08:11:32 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Fri Oct 21 08:11:32 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D0c63881b UpdateChangeLog: tweak clold_lines logic There are two cases here that have to be mutually exclusive. --- pym/repoman/utilities.py | 31 +++++++++++++++++-------------- 1 files changed, 17 insertions(+), 14 deletions(-) diff --git a/pym/repoman/utilities.py b/pym/repoman/utilities.py index fa58346..a79ea2c 100644 --- a/pym/repoman/utilities.py +++ b/pym/repoman/utilities.py @@ -771,25 +771,28 @@ def UpdateChangeLog(pkgdir, user, msg, skel_path, c= ategory, package, =20 # append stuff from old ChangeLog if clold_file is not None: - # clold_lines may contain a saved non-header line - # that we want to write first. - # Also, append this line to clnew_lines so that the - # unified_diff call doesn't show it as removed. - for line in clold_lines: - f.write(line) - clnew_lines.append(line) + + if clold_lines: + # clold_lines may contain a saved non-header line + # that we want to write first. + # Also, append this line to clnew_lines so that the + # unified_diff call doesn't show it as removed. + for line in clold_lines: + f.write(line) + clnew_lines.append(line) + + else: + # ensure that there is no more than one blank + # line after our new entry + for line in clold_file: + if line.strip(): + f.write(line) + break =20 # Now prepend old_header_lines to clold_lines, for use # in the unified_diff call below. clold_lines =3D old_header_lines + clold_lines =20 - # ensure that there is no more than one blank - # line after our new entry - for line in clold_file: - if line.strip(): - f.write(line) - break - for line in clold_file: f.write(line) clold_file.close()