]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - debian/scripts/misc/insert-changes.pl
UBUNTU: [debian] Initial debian and ubuntu directories
[mirror_ubuntu-bionic-kernel.git] / debian / scripts / misc / insert-changes.pl
1 #!/usr/bin/perl -w
2
3 my $debian;
4 $droot = $ARGV[0] if (defined $ARGV[0]);
5 $droot = 'debian' if (!defined $droot);
6 $debian = $ARGV[1] if (defined $ARGV[1]);
7 $debian = 'debian.master' if (!defined $debian);
8
9 system("make -s -f $droot/rules printchanges > $debian/changes");
10
11 open(CHANGELOG, "< $debian/changelog") or die "Cannot open changelog";
12 open(CHANGES, "< $debian/changes") or die "Cannot open new changes";
13 open(NEW, "> $debian/changelog.new") or die "Cannot open new changelog";
14
15 $printed = 0;
16
17 while (<CHANGELOG>) {
18 if (/^ CHANGELOG: /) {
19 next if $printed;
20
21 while (<CHANGES>) {
22 print NEW;
23 }
24
25 $printed = 1;
26 } else {
27 print NEW;
28 }
29 }
30
31 close(NEW);
32 close(CHANGES);
33 close(CHANGELOG);
34
35 rename("$debian/changelog.new", "$debian/changelog");
36 unlink("$debian/changes");