summaryrefslogtreecommitdiff
path: root/pkgbuild2mw.2
blob: 272a7b658cad426e7f440d66cbe3833e611ae2e1 (plain)
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
#!/usr/bin/env ruby

$pfix = ''
$ffix = ''
$body = ''

def flush
	if $pfix != ''
		puts 'Packages installed:'
		puts $pfix.split("\n").sort.join("\n")
	end
	if $ffix != ''
		puts 'Files affected:'
		puts $ffix.split("\n").sort.join("\n")
	end
	puts $body
	$pfix = ''
	$ffix = ''
	$body = ''
end

STDIN.each_line do |line|
	if line.start_with? "p*"
		$pfix += line[1,line.length]
	elsif line.start_with? "f*"
		$ffix += line[1,line.length]
	elsif line.start_with? '='
		flush
		puts line
	else
		$body += line
	end
end
flush