OSDN Git Service

Merge remote-tracking branch 'toybox/master' into HEAD
authorElliott Hughes <enh@google.com>
Mon, 18 Jul 2016 03:02:10 +0000 (20:02 -0700)
committerElliott Hughes <enh@google.com>
Mon, 18 Jul 2016 03:04:35 +0000 (20:04 -0700)
Change-Id: I7bc7dbd93d4227715c572e31025bb16d49356ab8

generated/flags.h
scripts/mkflags.c
www/roadmap.html

index 90095a4..ebc5c14 100644 (file)
@@ -78,7 +78,7 @@
 
 // blkid    
 #undef OPTSTR_blkid
-#define OPTSTR_blkid " "
+#define OPTSTR_blkid 0
 #ifdef CLEANUP_blkid
 #undef CLEANUP_blkid
 #undef FOR_blkid
 
 // bootchartd    
 #undef OPTSTR_bootchartd
-#define OPTSTR_bootchartd " "
+#define OPTSTR_bootchartd 0
 #ifdef CLEANUP_bootchartd
 #undef CLEANUP_bootchartd
 #undef FOR_bootchartd
 
 // bzcat    
 #undef OPTSTR_bzcat
-#define OPTSTR_bzcat " "
+#define OPTSTR_bzcat 0
 #ifdef CLEANUP_bzcat
 #undef CLEANUP_bzcat
 #undef FOR_bzcat
 
 // cd    
 #undef OPTSTR_cd
-#define OPTSTR_cd " "
+#define OPTSTR_cd 0
 #ifdef CLEANUP_cd
 #undef CLEANUP_cd
 #undef FOR_cd
 
 // chattr    
 #undef OPTSTR_chattr
-#define OPTSTR_chattr " "
+#define OPTSTR_chattr 0
 #ifdef CLEANUP_chattr
 #undef CLEANUP_chattr
 #undef FOR_chattr
 
 // clear    
 #undef OPTSTR_clear
-#define OPTSTR_clear " "
+#define OPTSTR_clear 0
 #ifdef CLEANUP_clear
 #undef CLEANUP_clear
 #undef FOR_clear
 
 // count    
 #undef OPTSTR_count
-#define OPTSTR_count " "
+#define OPTSTR_count 0
 #ifdef CLEANUP_count
 #undef CLEANUP_count
 #undef FOR_count
 
 // dd    
 #undef OPTSTR_dd
-#define OPTSTR_dd " "
+#define OPTSTR_dd 0
 #ifdef CLEANUP_dd
 #undef CLEANUP_dd
 #undef FOR_dd
 
 // dos2unix    
 #undef OPTSTR_dos2unix
-#define OPTSTR_dos2unix " "
+#define OPTSTR_dos2unix 0
 #ifdef CLEANUP_dos2unix
 #undef CLEANUP_dos2unix
 #undef FOR_dos2unix
 
 // exit    
 #undef OPTSTR_exit
-#define OPTSTR_exit " "
+#define OPTSTR_exit 0
 #ifdef CLEANUP_exit
 #undef CLEANUP_exit
 #undef FOR_exit
 
 // expr    
 #undef OPTSTR_expr
-#define OPTSTR_expr " "
+#define OPTSTR_expr 0
 #ifdef CLEANUP_expr
 #undef CLEANUP_expr
 #undef FOR_expr
 
 // factor    
 #undef OPTSTR_factor
-#define OPTSTR_factor " "
+#define OPTSTR_factor 0
 #ifdef CLEANUP_factor
 #undef CLEANUP_factor
 #undef FOR_factor
 
 // false    
 #undef OPTSTR_false
-#define OPTSTR_false " "
+#define OPTSTR_false 0
 #ifdef CLEANUP_false
 #undef CLEANUP_false
 #undef FOR_false
 
 // groups    
 #undef OPTSTR_groups
-#define OPTSTR_groups " "
+#define OPTSTR_groups 0
 #ifdef CLEANUP_groups
 #undef CLEANUP_groups
 #undef FOR_groups
 
 // hello    
 #undef OPTSTR_hello
-#define OPTSTR_hello " "
+#define OPTSTR_hello 0
 #ifdef CLEANUP_hello
 #undef CLEANUP_hello
 #undef FOR_hello
 
 // init    
 #undef OPTSTR_init
-#define OPTSTR_init " "
+#define OPTSTR_init 0
 #ifdef CLEANUP_init
 #undef CLEANUP_init
 #undef FOR_init
 
 // ip    
 #undef OPTSTR_ip
-#define OPTSTR_ip " "
+#define OPTSTR_ip 0
 #ifdef CLEANUP_ip
 #undef CLEANUP_ip
 #undef FOR_ip
 
 // lsmod    
 #undef OPTSTR_lsmod
-#define OPTSTR_lsmod " "
+#define OPTSTR_lsmod 0
 #ifdef CLEANUP_lsmod
 #undef CLEANUP_lsmod
 #undef FOR_lsmod
 
 // lsusb    
 #undef OPTSTR_lsusb
-#define OPTSTR_lsusb " "
+#define OPTSTR_lsusb 0
 #ifdef CLEANUP_lsusb
 #undef CLEANUP_lsusb
 #undef FOR_lsusb
 
 // more    
 #undef OPTSTR_more
-#define OPTSTR_more " "
+#define OPTSTR_more 0
 #ifdef CLEANUP_more
 #undef CLEANUP_more
 #undef FOR_more
 
 // readahead    
 #undef OPTSTR_readahead
-#define OPTSTR_readahead " "
+#define OPTSTR_readahead 0
 #ifdef CLEANUP_readahead
 #undef CLEANUP_readahead
 #undef FOR_readahead
 
 // reset    
 #undef OPTSTR_reset
-#define OPTSTR_reset " "
+#define OPTSTR_reset 0
 #ifdef CLEANUP_reset
 #undef CLEANUP_reset
 #undef FOR_reset
 
 // rev    
 #undef OPTSTR_rev
-#define OPTSTR_rev " "
+#define OPTSTR_rev 0
 #ifdef CLEANUP_rev
 #undef CLEANUP_rev
 #undef FOR_rev
 
 // start    
 #undef OPTSTR_start
-#define OPTSTR_start " "
+#define OPTSTR_start 0
 #ifdef CLEANUP_start
 #undef CLEANUP_start
 #undef FOR_start
 
 // stop    
 #undef OPTSTR_stop
-#define OPTSTR_stop " "
+#define OPTSTR_stop 0
 #ifdef CLEANUP_stop
 #undef CLEANUP_stop
 #undef FOR_stop
 
 // sync    
 #undef OPTSTR_sync
-#define OPTSTR_sync " "
+#define OPTSTR_sync 0
 #ifdef CLEANUP_sync
 #undef CLEANUP_sync
 #undef FOR_sync
 
 // tac    
 #undef OPTSTR_tac
-#define OPTSTR_tac " "
+#define OPTSTR_tac 0
 #ifdef CLEANUP_tac
 #undef CLEANUP_tac
 #undef FOR_tac
 
 // test    
 #undef OPTSTR_test
-#define OPTSTR_test " "
+#define OPTSTR_test 0
 #ifdef CLEANUP_test
 #undef CLEANUP_test
 #undef FOR_test
 
 // test_scankey    
 #undef OPTSTR_test_scankey
-#define OPTSTR_test_scankey " "
+#define OPTSTR_test_scankey 0
 #ifdef CLEANUP_test_scankey
 #undef CLEANUP_test_scankey
 #undef FOR_test_scankey
 
 // toybox    
 #undef OPTSTR_toybox
-#define OPTSTR_toybox " "
+#define OPTSTR_toybox 0
 #ifdef CLEANUP_toybox
 #undef CLEANUP_toybox
 #undef FOR_toybox
 
 // true    
 #undef OPTSTR_true
-#define OPTSTR_true " "
+#define OPTSTR_true 0
 #ifdef CLEANUP_true
 #undef CLEANUP_true
 #undef FOR_true
 
 // unix2dos    
 #undef OPTSTR_unix2dos
-#define OPTSTR_unix2dos " "
+#define OPTSTR_unix2dos 0
 #ifdef CLEANUP_unix2dos
 #undef CLEANUP_unix2dos
 #undef FOR_unix2dos
 
 // uptime    
 #undef OPTSTR_uptime
-#define OPTSTR_uptime " "
+#define OPTSTR_uptime 0
 #ifdef CLEANUP_uptime
 #undef CLEANUP_uptime
 #undef FOR_uptime
 
 // w    
 #undef OPTSTR_w
-#define OPTSTR_w " "
+#define OPTSTR_w 0
 #ifdef CLEANUP_w
 #undef CLEANUP_w
 #undef FOR_w
 
 // xzcat    
 #undef OPTSTR_xzcat
-#define OPTSTR_xzcat " "
+#define OPTSTR_xzcat 0
 #ifdef CLEANUP_xzcat
 #undef CLEANUP_xzcat
 #undef FOR_xzcat
 
 // yes    
 #undef OPTSTR_yes
-#define OPTSTR_yes " "
+#define OPTSTR_yes 0
 #ifdef CLEANUP_yes
 #undef CLEANUP_yes
 #undef FOR_yes
 
 // zcat    
 #undef OPTSTR_zcat
-#define OPTSTR_zcat " "
+#define OPTSTR_zcat 0
 #ifdef CLEANUP_zcat
 #undef CLEANUP_zcat
 #undef FOR_zcat
index 27fc517..39b935b 100644 (file)
@@ -122,7 +122,7 @@ int main(int argc, char *argv[])
 
   for (;;) {
     struct flag *flist, *aflist, *offlist;
-    char *mgaps;
+    char *mgaps = 0;
     unsigned bit;
 
     *command = *flags = *allflags = 0;
@@ -141,11 +141,13 @@ int main(int argc, char *argv[])
 
     bit = 0;
     printf("// %s %s %s\n", command, flags, allflags);
-    mgaps = mark_gaps(flags, allflags);
+    if (*flags != ' ') mgaps = mark_gaps(flags, allflags);
+    else if (*allflags != ' ') mgaps = allflags;
     // If command disabled, use allflags for OLDTOY()
-    printf("#undef OPTSTR_%s\n#define OPTSTR_%s \"%s\"\n",
-            command, command, strcmp(flags, " ") ? mgaps : allflags);
-    free(mgaps);
+    printf("#undef OPTSTR_%s\n#define OPTSTR_%s ", command, command);
+    if (mgaps) printf("\"%s\"\n", mgaps);
+    else printf("0\n");
+    if (mgaps != allflags) free(mgaps);
 
     flist = digest(flags);
     offlist = aflist = digest(allflags);
index 9e24048..9dff8b2 100755 (executable)
@@ -269,9 +269,7 @@ system/core/toolbox/Android.mk</a> the toolbox directory builds the
 following commands:</p>
 
 <blockquote><b>
-dd getevent
-newfs_msdos
-sendevent
+dd getevent newfs_msdos
 </b></blockquote>
 
 <p>The toolbox makefile also builds the BSD grep right now, because toybox
@@ -303,7 +301,6 @@ implementing the full commands (fdisk, init, and sudo) come first.</p>
 dd getevent init
 logcat logwrapper
 newfs_msdos reboot run-as
-sendevent
 </b></blockquote>
 
 <p>We may eventually implement all of that, but for toybox 1.0 we need to
@@ -315,8 +312,7 @@ for later).</p>
 <p>This means toybox should implement (or finish implementing):</p>
 <blockquote><b>
 <span id=toolbox>
-dd getevent logcat logwrapper
-newfs_msdos sendevent
+dd getevent logcat logwrapper newfs_msdos
 </span>
 </b></blockquote>
 
@@ -324,7 +320,7 @@ newfs_msdos sendevent
 of "pending". These should be a priority for cleanup:</p>
 
 <blockquote><b>
-dd expr lsof more netstat route tar tr traceroute
+dd expr lsof more tar tr traceroute
 </b></blockquote>
 
 <p>Android wishlist:</p>