annotate scripts/install.c @ 453:8bc2fec2abf3

Added tag 0.2.0 for changeset e708e8933a50
author Rob Landley <rob@landley.net>
date Mon, 13 Feb 2012 07:46:36 -0600
parents 7cb15eae1664
children 786841fdb1e0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
89
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
1 /* vi: set ts=4 :*/
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
2 /* Wrapper to make installation easier with cross-compiling.
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
3 *
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
4 * Copyright 2006 Rob Landley <rob@landley.net>
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
5 */
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
6
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
7 #include "toys.h"
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
8
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
9 #undef NEWTOY
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
10 #undef OLDTOY
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
11 #define NEWTOY(name, opts, flags) {#name, 0, opts, flags},
91
b596b9b3b2af Missing comma, and slight simplification in defconfig sed invocation.
Rob Landley <rob@landley.net>
parents: 89
diff changeset
12 #define OLDTOY(name, oldname, opts, flags) {#name, 0, opts, flags},
89
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
13
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
14 // Populate toy_list[].
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
15
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
16 struct toy_list toy_list[] = {
237
7cb15eae1664 Zap toylist.h, moving contents of global structures into DEFINE_GLOBALS()
Rob Landley <rob@landley.net>
parents: 91
diff changeset
17 #include "generated/newtoys.h"
89
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
18 };
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
19
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
20 #define TOY_LIST_LEN (sizeof(toy_list)/sizeof(struct toy_list))
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
21
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
22 int main(int argc, char *argv[])
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
23 {
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
24 static char *toy_paths[]={"usr/","bin/","sbin/",0};
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
25 int i, len = 0;
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
26
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
27 // Output list of applets.
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
28 for (i=1; i<TOY_LIST_LEN; i++) {
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
29 int fl = toy_list[i].flags;
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
30 if (fl & TOYMASK_LOCATION) {
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
31 if (argc>1) {
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
32 int j;
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
33 for (j=0; toy_paths[j]; j++)
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
34 if (fl & (1<<j)) len += printf("%s", toy_paths[j]);
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
35 }
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
36 len += printf("%s\n",toy_list[i].name);
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
37 }
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
38 }
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
39 return 0;
4f5cdc6552da Add make install_flat.
Rob Landley <rob@landley.net>
parents:
diff changeset
40 }