Drop main() prototype. Syncs with NetBSD-8
[minix.git] / distrib / common / list2sh.awk
blob01c3856173726f81c3ad74d458ac08fc37fdf826
1 # $NetBSD: list2sh.awk,v 1.1 2009/09/18 09:24:59 abs 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;