File: confmodule.build

package info (click to toggle)
cdebconf 0.227
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,552 kB
  • sloc: ansic: 16,568; sh: 549; makefile: 456; sql: 52; perl: 13
file content (23 lines) | stat: -rwxr-xr-x 502 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

COMMANDS=
while read in; do
	if [ "$in" = stop ]; then
		continue
	fi
	COMMANDS="${COMMANDS:+$COMMANDS }$in"
done < $1
export COMMANDS
export DEBCONF_OLD_FD_BASE="$(cpp -dM "$2" | grep '#define DEBCONF_OLD_FD_BASE' | cut -d' ' -f3)"
perl -ne '
	if (s/^REPEAT: //) {
		for my $command (split " ", $ENV{COMMANDS}) {
			local $_ = $_;
			s/\@command\@/$command/g;
			s/\@COMMAND\@/\U$command/g;
			print;
		}
	} else {
		s/\@DEBCONF_OLD_FD_BASE\@/$ENV{DEBCONF_OLD_FD_BASE}/g;
		print;
	}' < $3