On Thu, 9 Jan 2014, Cristian Ionescu-Idbohrn wrote:
>
> Yes.  I did miss something after all :(
> Nevertheless, are the POSIX options LHP intended to be default (as
> usage suggests) or DESKTOP dependent?

Answer to self (after staring at the code a little longer):

* yes, the 'HLP' options are (arguably) DESKTOP dependent, in which
  case the attached patch idea 1
  bb-chown-options-HLP-are-DESKTOP-dependent.patch should do the
  necessary cleanup

* alternatively, attached patch idea 2
  bb-chown-options-HLP-not-DESKTOP-dependent.patch which make the
  'HLP' options DESKTOP independent


Cheers,

-- 
Cristian
diff --git a/busybox/coreutils/chown.c b/busybox/coreutils/chown.c
index bb166d8..5310441 100644
--- a/busybox/coreutils/chown.c
+++ b/busybox/coreutils/chown.c
@@ -11,18 +11,18 @@
 /* http://www.opengroup.org/onlinepubs/007904975/utilities/chown.html */
 
 //usage:#define chown_trivial_usage
-//usage:       "[-RhLHP"IF_DESKTOP("cvf")"]... OWNER[<.|:>[GROUP]] FILE..."
+//usage:       "[-Rh"IF_DESKTOP("vcfLHP")"]... OWNER[<.|:>[GROUP]] FILE..."
 //usage:#define chown_full_usage "\n\n"
 //usage:       "Change the owner and/or group of each FILE to OWNER and/or GROUP\n"
 //usage:     "\n	-R	Recurse"
 //usage:     "\n	-h	Affect symlinks instead of symlink targets"
-//usage:     "\n	-L	Traverse all symlinks to directories"
-//usage:     "\n	-H	Traverse symlinks on command line only"
-//usage:     "\n	-P	Don't traverse symlinks (default)"
 //usage:	IF_DESKTOP(
-//usage:     "\n	-c	List changed files"
 //usage:     "\n	-v	List all files"
+//usage:     "\n	-c	List changed files"
 //usage:     "\n	-f	Hide errors"
+//usage:     "\n	-L	Traverse all symlinks to directories"
+//usage:     "\n	-H	Traverse symlinks on command line only"
+//usage:     "\n	-P	Don't traverse symlinks (default)"
 //usage:	)
 //usage:
 //usage:#define chown_example_usage
diff --git a/busybox/coreutils/chown.c b/busybox/coreutils/chown.c
index bb166d8..4e9ab37 100644
--- a/busybox/coreutils/chown.c
+++ b/busybox/coreutils/chown.c
@@ -11,19 +11,19 @@
 /* http://www.opengroup.org/onlinepubs/007904975/utilities/chown.html */
 
 //usage:#define chown_trivial_usage
-//usage:       "[-RhLHP"IF_DESKTOP("cvf")"]... OWNER[<.|:>[GROUP]] FILE..."
+//usage:       "[-Rh"IF_DESKTOP("vcf")"LHP]... OWNER[<.|:>[GROUP]] FILE..."
 //usage:#define chown_full_usage "\n\n"
 //usage:       "Change the owner and/or group of each FILE to OWNER and/or GROUP\n"
 //usage:     "\n	-R	Recurse"
 //usage:     "\n	-h	Affect symlinks instead of symlink targets"
-//usage:     "\n	-L	Traverse all symlinks to directories"
-//usage:     "\n	-H	Traverse symlinks on command line only"
-//usage:     "\n	-P	Don't traverse symlinks (default)"
 //usage:	IF_DESKTOP(
-//usage:     "\n	-c	List changed files"
 //usage:     "\n	-v	List all files"
+//usage:     "\n	-c	List changed files"
 //usage:     "\n	-f	Hide errors"
 //usage:	)
+//usage:     "\n	-L	Traverse all symlinks to directories"
+//usage:     "\n	-H	Traverse symlinks on command line only"
+//usage:     "\n	-P	Don't traverse symlinks (default)"
 //usage:
 //usage:#define chown_example_usage
 //usage:       "$ ls -l /tmp/foo\n"
@@ -40,7 +40,7 @@
 /* This is a NOEXEC applet. Be very careful! */
 
 
-#define OPT_STR     ("Rh" IF_DESKTOP("vcfLHP"))
+#define OPT_STR     ("Rh" IF_DESKTOP("vcf") "LHP")
 #define BIT_RECURSE 1
 #define OPT_RECURSE (opt & 1)
 #define OPT_NODEREF (opt & 2)
@@ -56,10 +56,10 @@
  * The last option specified shall determine the behavior of the utility." */
 /* -L */
 #define BIT_TRAVERSE 0x20
-#define OPT_TRAVERSE (IF_DESKTOP(opt & BIT_TRAVERSE) IF_NOT_DESKTOP(0))
+#define OPT_TRAVERSE (opt & BIT_TRAVERSE)
 /* -H or -L */
 #define BIT_TRAVERSE_TOP (0x20|0x40)
-#define OPT_TRAVERSE_TOP (IF_DESKTOP(opt & BIT_TRAVERSE_TOP) IF_NOT_DESKTOP(0))
+#define OPT_TRAVERSE_TOP (opt & BIT_TRAVERSE_TOP)
 
 #if ENABLE_FEATURE_CHOWN_LONG_OPTIONS
 static const char chown_longopts[] ALIGN1 =
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to