No empty .Rs/.Re
[netbsd-mini2440.git] / distrib / common / list2sh.awk
blob364a5fc1a2e01aeb23d0f00bcd894cf701d7e8d5
1 # $NetBSD: list2sh.awk,v 1.1 1998/11/19 08:58:02 sakamoto Exp $
3 BEGIN {
4 printf("cd ${CURDIR}\n");
5 printf("\n");
7 /^$/ || /^#/ {
8 print $0;
9 next;
11 $1 == "COPY" {
12 printf("echo '%s'\n", $0);
13 printf("rm -f ${TARGDIR}/%s\n", $3);
14 printf("cp %s ${TARGDIR}/%s\n", $2, $3);
15 next;
17 $1 == "LINK" {
18 printf("echo '%s'\n", $0);
19 printf("rm -f ${TARGDIR}/%s\n", $3);
20 printf("(cd ${TARGDIR}; ln %s %s)\n", $2, $3);
21 next;
23 $1 == "SYMLINK" {
24 printf("echo '%s'\n", $0);
25 printf("rm -f ${TARGDIR}/%s\n", $3);
26 printf("(cd ${TARGDIR}; ln -s %s %s)\n", $2, $3);
27 next;
29 $1 == "COPYDIR" {
30 printf("echo '%s'\n", $0);
31 printf("(cd ${TARGDIR}/%s && find . ! -name . | xargs /bin/rm -rf)\n",
32 $3);
33 printf("(cd %s && find . ! -name . | cpio -pdamu ${TARGDIR}/%s)\n", $2,
34 $3);
35 next;
37 $1 == "SPECIAL" {
38 printf("echo '%s'\n", $0);
39 printf("(cd ${TARGDIR};");
40 for (i = 2; i <= NF; i++)
41 printf(" %s", $i);
42 printf(")\n");
43 next;
46 printf("echo '%s'\n", $0);
47 printf("echo 'Unknown keyword \"%s\" at line %d of input.'\n", $1, NR);
48 printf("exit 1\n");
49 exit 1;
51 END {
52 printf("\n");
53 printf("exit 0\n");
54 exit 0;