File: changelog2deb.pl

package info (click to toggle)
pdfsandwich 0.1.7-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 188 kB
  • sloc: ml: 946; sh: 318; makefile: 142; perl: 110
file content (38 lines) | stat: -rwxr-xr-x 816 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/perl -w

# convert changelog file to changelog.Debian.gz
# changelog format: 
#package version (date):
#	entry1
#	entry2 ...
# date is generated with: date -R
# (changelog.Debian.gz: see http://www.debian.org/doc/debian-policy/ch-source.html#s-dpkgchangelog)

$DISTRI = "unstable";
$URGENCY = "low";
$MAINTAINER = "Tobias Elze <sourceforge\@tobias-elze.de>";

$counter = 0;
$mstring = " -- $MAINTAINER  ";

while(<>)
{
	if(/^\S+\s+\S+.*\(([^\)]*)\).*/)
	{
		$counter++;
		$date = $new_date;
		($new_date = $1) =~ s/, 0/,  /;
	}
	s/^[ \t]+/  \* /;
	if($counter>1)
	{
		s/^(\S+)\s+(\S+).*/$mstring$date\n\n$1 ($2) $DISTRI; urgency=$URGENCY\n/;
	}
	else 
	{
		s/^(\S+)\s+(\S+).*/$1 ($2) $DISTRI; urgency=$URGENCY\n/;
	}
	print;
}

print "$mstring$new_date\n\nLocal variables:\nmode: debian-changelog\nEnd:";