From patchwork Fri Mar 19 10:45:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Bader X-Patchwork-Id: 48124 X-Patchwork-Delegate: stefan.bader@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 0D1D2B7C33 for ; Fri, 19 Mar 2010 21:45:55 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1NsZi7-0001Wo-Kg; Fri, 19 Mar 2010 10:45:47 +0000 Received: from adelie.canonical.com ([91.189.90.139]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1NsZi5-0001WV-UW for kernel-team@lists.ubuntu.com; Fri, 19 Mar 2010 10:45:45 +0000 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1NsZi3-00068J-Fn for ; Fri, 19 Mar 2010 10:45:43 +0000 Received: from p5b2e644a.dip.t-dialin.net ([91.46.100.74] helo=canonical.com) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1NsZi3-0005cn-7h for kernel-team@lists.ubuntu.com; Fri, 19 Mar 2010 10:45:43 +0000 From: Stefan Bader To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/3] UBUNTU: (buildenv) Add insert-ubuntu-changes Date: Fri, 19 Mar 2010 11:45:39 +0100 Message-Id: <1268995541-12057-2-git-send-email-stefan.bader@canonical.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1268995541-12057-1-git-send-email-stefan.bader@canonical.com> References: <1268995541-12057-1-git-send-email-stefan.bader@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com Usage: ./debian/scripts/misc/insert-ubuntu-changes where changelog is the changelog to be modified (needs to be in UNRELEASED state), orev is the the revision number from which to start looking for changes and nrev is the revision number where to stop. Signed-off-by: Stefan Bader --- debian/scripts/misc/insert-ubuntu-changes | 57 +++++++++++++++++++++++++++++ 1 files changed, 57 insertions(+), 0 deletions(-) create mode 100755 debian/scripts/misc/insert-ubuntu-changes diff --git a/debian/scripts/misc/insert-ubuntu-changes b/debian/scripts/misc/insert-ubuntu-changes new file mode 100755 index 0000000..0d97ec4 --- /dev/null +++ b/debian/scripts/misc/insert-ubuntu-changes @@ -0,0 +1,57 @@ +#!/usr/bin/perl + +if ($#ARGV != 2) { + die "Usage: $0 \n"; +} +my ($changelog, $end, $start) = @ARGV; + +$end =~ s/.*\.//; +$start =~ s/.*\.//; + +my @changes = (); +my $output = 0; +open(CHG, "git show master:debian/changelog|") || + die "$0: master:debian/changelog: open failed - $!\n"; +while () { + if (/^\S+\s+\((.*\.(\d+))\)/) { + if ($2 <= $end) { + last; + } + if ($2 == $start) { + $output = 1; + } + if ($output) { + push(@changes, "\n [ Ubuntu: $1 ]\n\n"); + next; + } + } + next if ($output == 0); + + next if (/^\s*$/); + next if (/^\s--/); + next if (/^\s\s[^\*\s]/); + + push(@changes, $_); +} +close(CHG); + +open(CHANGELOG, "< $changelog") or die "Cannot open changelog"; +open(NEW, "> $changelog.new") or die "Cannot open new changelog"; + +$printed = 3; +while () { + if (/^ CHANGELOG: /) { + $printed--; + print NEW; + if ($printed == 0) { + print NEW @changes; + } + next; + } + print NEW; +} + +close(NEW); +close(CHANGELOG); + +rename("$changelog.new", "$changelog");