summaryrefslogtreecommitdiff
path: root/debian/scripts/misc/insert-ubuntu-changes
diff options
context:
space:
mode:
authorJohn Rigby <john.rigby@linaro.org>2010-09-03 00:03:56 -0600
committerJohn Fredriksson <john.xj.fredriksson@stericsson.com>2011-10-19 15:16:44 +0200
commit416cf007581a06a08e7b4c2f9100fbc2437b48d8 (patch)
tree3ba3970c9f2500a47ee899d9385ca6711b1fe46a /debian/scripts/misc/insert-ubuntu-changes
parent4bfaf5b8b51ceb9168dd9014fd9fbae0b97b7eeb (diff)
LINARO: Add generic linaro packaging
Signed-off-by: John Rigby <john.rigby@linaro.org>
Diffstat (limited to 'debian/scripts/misc/insert-ubuntu-changes')
-rwxr-xr-xdebian/scripts/misc/insert-ubuntu-changes58
1 files changed, 58 insertions, 0 deletions
diff --git a/debian/scripts/misc/insert-ubuntu-changes b/debian/scripts/misc/insert-ubuntu-changes
new file mode 100755
index 00000000000..61b1faec687
--- /dev/null
+++ b/debian/scripts/misc/insert-ubuntu-changes
@@ -0,0 +1,58 @@
+#!/usr/bin/perl
+
+if ($#ARGV != 2) {
+ die "Usage: $0 <changelog> <stop at> <start at>\n";
+}
+my ($changelog, $end, $start) = @ARGV;
+
+$end =~ s/.*\.//;
+$start =~ s/.*\.//;
+
+my @changes = ();
+my $output = 0;
+open(CHG, "<debian.linaro/changelog") ||
+ open(CHG, "<debian/changelog") ||
+ die "$0: debian/changelog: open failed - $!\n";
+while (<CHG>) {
+ 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 (<CHANGELOG>) {
+ if (/^ CHANGELOG: /) {
+ $printed--;
+ print NEW;
+ if ($printed == 0) {
+ print NEW @changes;
+ }
+ next;
+ }
+ print NEW;
+}
+
+close(NEW);
+close(CHANGELOG);
+
+rename("$changelog.new", "$changelog");